View source: R/regression_functions.R
get_regression_table | R Documentation |
Output regression table for an lm()
regression in "tidy" format. This function
is a wrapper function for broom::tidy()
and includes confidence
intervals in the output table by default.
get_regression_table( model, conf.level = 0.95, digits = 3, print = FALSE, default_categorical_levels = FALSE )
model |
an |
conf.level |
The confidence level to use for the confidence interval
if |
digits |
number of digits precision in output table |
print |
If TRUE, return in print format suitable for R Markdown |
default_categorical_levels |
If TRUE, do not change the non-baseline categorical variables in the term column. Otherwise non-baseline categorical variables will be displayed in the format "categorical_variable_name: level_name" |
A tibble-formatted regression table along with lower and upper end
points of all confidence intervals for all parameters lower_ci
and
upper_ci
; the confidence levels default to 95\
tidy()
, get_regression_points()
, get_regression_summaries()
library(moderndive) # Fit lm() regression: mpg_model <- lm(mpg ~ cyl, data = mtcars) # Get regression table: get_regression_table(mpg_model) # Vary confidence level of confidence intervals get_regression_table(mpg_model, conf.level = 0.99)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.