Skip to contents

Computes parameters for regression models.

Usage

tidy_parameters(x, conf.int = TRUE, ...)

Arguments

x

An object to be converted into a tidy tibble::tibble().

conf.int

Indicating whether or not to include a confidence interval in the tidied output (defaults to TRUE).

...

Additional arguments that will be passed to parameters::model_parameters() or broom::tidy(), whichever method works. Note that you should pay attention to different naming conventions across these packages. For example, the required confidence interval width is specified using ci argument in parameters::model_parameters, while using conf.level in broom::tidy.

Value

A data frame of indices related to the model's parameters.

Details

The function will attempt to get these details first using parameters::model_parameters(), and if this fails, then using broom::tidy().

Examples

set.seed(123)
mod <- lm(mpg ~ wt + cyl, data = mtcars)
broomExtra::tidy_parameters(mod)
#> # A tibble: 3 × 9
#>   term        estimate std.er…¹ conf.…² conf.…³ conf.…⁴ stati…⁵ df.er…⁶  p.value
#>   <chr>          <dbl>    <dbl>   <dbl>   <dbl>   <dbl>   <dbl>   <int>    <dbl>
#> 1 (Intercept)    39.7     1.71     0.95   36.2   43.2     23.1       29 3.04e-20
#> 2 wt             -3.19    0.757    0.95   -4.74  -1.64    -4.22      29 2.22e- 4
#> 3 cyl            -1.51    0.415    0.95   -2.36  -0.660   -3.64      29 1.06e- 3
#> # … with abbreviated variable names ¹​std.error, ²​conf.level, ³​conf.low,
#> #   ⁴​conf.high, ⁵​statistic, ⁶​df.error