get_regression_table: Get regression table

Description Usage Arguments Value See Also Examples

View source: R/regression_functions.R

Description

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.

Usage

1
get_regression_table(model, digits = 3, print = FALSE)

Arguments

model

an lm() model object

digits

number of digits precision in output table

print

If TRUE, return in print format suitable for R Markdown

Value

A tibble-formatted regression table along with lower and upper end points of all confidence intervals for all parameters lower_ci and upper_ci.

See Also

tidy, get_regression_points, get_regression_summaries

Examples

1
2
3
4
5
6
7
library(moderndive)

# Fit lm() regression:
mpg_model <- lm(mpg ~ cyl, data = mtcars)

# Get regression table:
get_regression_table(mpg_model)

Example output

# A tibble: 2 x 7
  term      estimate std_error statistic p_value lower_ci upper_ci
  <chr>        <dbl>     <dbl>     <dbl>   <dbl>    <dbl>    <dbl>
1 intercept    37.9      2.07      18.3        0    33.6     42.1 
2 cyl          -2.88     0.322     -8.92       0    -3.53    -2.22

moderndive documentation built on Jan. 9, 2021, 1:34 a.m.