report_lm_with_std | R Documentation |
This function creates a summary table for lm models (including mice::mira objects containing lm-models) that shows a standardized and non-standardized version of the model side-by-side. Several pairs of such models can be compared side-by-side.
report_lm_with_std(
mod,
mod_std,
conf_level = 0.95,
coef_renames = NULL,
fmt = "%.2f",
statistic_vertical = FALSE,
filename = NULL,
model_names = NULL,
show_nimp = FALSE,
R2_change = FALSE,
notes = list(NULL),
apa_style = TRUE,
stars = std_stars_pad,
...
)
mod |
A lm-model/mira object of lm models, with variables not standardized (or a list of such models) |
mod_std |
A lm-model/mira object of lm models, with standardized variables. Can be
created with |
conf_level |
Confidence level to use for confidence intervals, defaults to .95 |
coef_renames |
A named character vector with new names for the coefficients or a tibble as provided by |
fmt |
how to format numeric values: integer, user-supplied function, or
|
statistic_vertical |
Should standard errors and CIs be shown below coefficients? Defaults to horizontal layout |
filename |
the file name to create a HTML file on disk. |
model_names |
If several pairs of models are to be plotted side by side, indicate the label for each pair here |
show_nimp |
Logical - DEFUNCT. If mira objects are passed, this determines whether the number of imputations will be reported as a model statistic |
R2_change |
Logical. Report R2 change and F-test to compare models. |
notes |
List of notes to append to bottom of table. An explanation of significance stars is automatically added. If the std models were run with a helper function in this package, a note regarding the standardization is also automatically added. |
apa_style |
Logical, should APA-style formatting be applied |
stars |
Named vector of significance stars and their thresholds, check |
... |
Arguments passed on to
|
A list with gt_tab
(the gt-table object including the parts of the table
that can be created with gt. This can be post-processed and formatted with functions in
the gt-package, but does not include the lower part with model statistics, e.g., R^2.) and
html_code
(the code that creates the full table, and is used to render it in
the Viewer).
# Standard lm model
mod1 <- lm(mpg ~ hp + wt, mtcars)
# Model with standardized coefficients
mod2 <- lm_std(mpg ~ hp + wt, mtcars)
report_lm_with_std(mod1, mod2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.