
Convert {parameters} package output to {tidyverse} conventions
Source: R/helpers-easystats.R
tidy_model_parameters.RdRuns parameters::model_parameters() on a model object and standardizes
the result to {broom}-style column names (e.g. estimate, std.error,
conf.low, conf.high, statistic, df.error, p.value). Bayes factors
are returned in a bf10 column, along with their natural logarithm in
log_e_bf10. For Bayesian ANOVA designs ({BayesFactor} linear models),
the estimate is replaced by the Bayesian R-squared.
Arguments
- model
Statistical Model.
- ...
Arguments passed to or from other methods. Non-documented arguments are
digits,p_digits,ci_digitsandfooter_digitsto set the number of digits for the output.groupscan be used to group coefficients. These arguments will be passed to the print-method, or can directly be used inprint(), see documentation inprint.parameters_model().If
s_value = TRUE, the p-value will be replaced by the S-value in the output (cf. Rafi and Greenland 2020).pdadds an additional column with the probability of direction (seebayestestR::p_direction()for details). Furthermore, see 'Examples' inmodel_parameters.default().For developers, whose interest mainly is to get a "tidy" data frame of model summaries, it is recommended to set
pretty_names = FALSEto speed up computation of the summary table.
Citation
Patil, I., (2021). statsExpressions: R Package for Tidy Dataframes and Expressions with Statistical Details. Journal of Open Source Software, 6(61), 3236, https://doi.org/10.21105/joss.03236
Examples
model <- lm(mpg ~ wt + cyl, data = mtcars)
tidy_model_parameters(model)
#> # A tibble: 3 × 10
#> term estimate std.error conf.level conf.low conf.high statistic df.error
#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <int>
#> 1 (Intercep… 39.7 1.71 0.95 36.2 43.2 23.1 29
#> 2 wt -3.19 0.757 0.95 -4.74 -1.64 -4.22 29
#> 3 cyl -1.51 0.415 0.95 -2.36 -0.660 -3.64 29
#> # ℹ 2 more variables: p.value <dbl>, conf.method <chr>