The get_regression_x() Functions

Learn about the get_regression_x() functions in the moderndive package and how they can help us simplify the regression process.

Recall that we introduced two functions from the moderndive package:

  • The get_regression_table() function that returns a regression table

  • The get_regression_points() function that returns point-by-point information from a regression model

What’s going on behind the scenes with the get_regression_table() and get_regression_points() functions? We mentioned that these were examples of wrapper functions. Such functions take other preexisting functions and wrap them into single functions that hide the user from their inner workings. This way, all the user needs to worry about is what the inputs look like and what the outputs look like. Let’s try to closely examine these functions and see how the “engine” of these wrapper functions works.

Recall our two-step process to generate a regression table:

Get hands-on with 1400+ tech skills courses.