Conduct multiple regression analysis and summarize the results in a data.table.
multiple_regression(
data = NULL,
formula = NULL,
vars_to_mean_center = NULL,
sigfigs = NULL,
round_digits_after_decimal = NULL,
pretty_round_p_value = TRUE,
return_table_upper_half = FALSE,
round_r_squared = 3,
round_f_stat = 2,
prettify_reg_table_col_names = TRUE,
silent = FALSE
)
the output will be a data.table showing multiple regression results.
a data object (a data frame or a data.table)
a formula object for the regression equation
a character vector specifying names of variables that will be mean-centered before the regression model is estimated
number of significant digits to round to
round to nth digit after decimal
(alternative to sigfigs
)
logical. Should the p-values be rounded
in a pretty format (i.e., lower threshold: "<.001").
By default, pretty_round_p_value = TRUE
.
logical. Should only the upper part
of the table be returned?
By default, return_table_upper_half = FALSE
.
number of digits after the decimal both r-squared and adjusted r-squared values should be rounded to (default 3)
number of digits after the decimal the f statistic of the regression model should be rounded to (default 2)
logical. Should the column names
of the regression table be made pretty (e.g., change "std_beta" to
"Std. Beta")? (Default = TRUE
)
If silent = FALSE
, a message regarding
mean-centered variables will be printed. If silent = TRUE
,
this message will be suppressed. By default, silent = FALSE
.
To include standardized beta(s) in the regression results table, the following package(s) must be installed prior to running the function: Package 'lm.beta' v1.5-1 (or possibly a higher version) by Stefan Behrendt (2014), https://cran.r-project.org/package=lm.beta
# \donttest{
multiple_regression(data = mtcars, formula = mpg ~ gear * cyl)
multiple_regression(
data = mtcars, formula = mpg ~ gear * cyl,
vars_to_mean_center = "gear")
# }
Run the code above in your browser using DataLab