Tidy dataframes of model parameters using {broom}
and {easystats}
Source: R/hybrid_easystats.R
tidy_parameters.Rd
Computes parameters for regression models.
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()
orbroom::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 usingci
argument inparameters::model_parameters
, while usingconf.level
inbroom::tidy
.
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