View source: R/multiple_regression.R
multiple_regression | R Documentation |
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 )
data |
a data object (a data frame or a data.table) |
formula |
a formula object for the regression equation |
vars_to_mean_center |
a character vector specifying names of variables that will be mean-centered before the regression model is estimated |
sigfigs |
number of significant digits to round to |
round_digits_after_decimal |
round to nth digit after decimal
(alternative to |
pretty_round_p_value |
logical. Should the p-values be rounded
in a pretty format (i.e., lower threshold: "<.001").
By default, |
return_table_upper_half |
logical. Should only the upper part
of the table be returned?
By default, |
round_r_squared |
number of digits after the decimal both r-squared and adjusted r-squared values should be rounded to (default 3) |
round_f_stat |
number of digits after the decimal the f statistic of the regression model should be rounded to (default 2) |
prettify_reg_table_col_names |
logical. Should the column names
of the regression table be made pretty (e.g., change "std_beta" to
"Std. Beta")? (Default = |
silent |
If |
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
the output will be a data.table showing multiple regression results.
multiple_regression(data = mtcars, formula = mpg ~ gear * cyl) multiple_regression( data = mtcars, formula = mpg ~ gear * cyl, vars_to_mean_center = "gear")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.