Skip to contents

The summaries are always in the form of a data frame

  • conf_interval() --- displays coefficients and their confidence intervals

  • R2() --- R-squared of a model together with related measures such as F, adjusted R-squared, the p-value, and degrees of freedom used in calculating the p-value.

  • regression_summary() -- A regression report in data-frame format.

  • anova_summary() --- An ANOVA report in data-frame format. If only one model is passed as an argument, the data frame will have one line per model term. If multiple models are given as arguments, the ANOVA report will show the increments from one model to the next.

Usage

conf_interval(model, level = 0.95, show_p = FALSE)

R2(model)

regression_summary(model)

anova_summary(...)

Arguments

model

A model as produced by model_train(), lm(), glm(), and so on

level

Confidence level to use in conf_interval() (default: 0.95)

show_p

For conf_interval(), append the p-value to the report.

...

One or more models (for ANOVA)

Value

a data frame

Details

Many of these are wrappers around broom::tidy() used to emphasize to students that the results are a summary in the form of a regression report, similar to the summaries produced by stats::confint(), stats::coef(), etc.

Examples

Model <- FEV |> model_train(FEV ~ age + smoker)
Model |> conf_interval()
#> # A tibble: 3 × 4
#>   term           .lwr  .coef    .upr
#>   <chr>         <dbl>  <dbl>   <dbl>
#> 1 (Intercept)   0.207  0.367  0.527 
#> 2 age           0.215  0.231  0.247 
#> 3 smokersmoker -0.368 -0.209 -0.0504
Model |> R2()
#>     n k  Rsquared        F     adjR2 p df.num df.denom
#> 1 654 2 0.5765875 443.2539 0.5752867 0      2      651
Model |> anova_summary()
#> # A tibble: 3 × 6
#>   term         df  sumsq  meansq statistic    p.value
#>   <chr>     <int>  <dbl>   <dbl>     <dbl>      <dbl>
#> 1 age           1 281.   281.       880.    5.54e-123
#> 2 smoker        1   2.14   2.14       6.70  9.86e-  3
#> 3 Residuals   651 208.     0.319     NA    NA