Compute and extract model parameters of multiple regression models.
See model_parameters
for further details.
compare_parameters(
...,
ci = 0.95,
effects = "fixed",
component = "conditional",
standardize = NULL,
exponentiate = FALSE,
df_method = "wald",
p_adjust = NULL,
style = NULL,
column_names = NULL,
keep = NULL,
drop = NULL,
parameters = keep,
verbose = TRUE
)
compare_models(
...,
ci = 0.95,
effects = "fixed",
component = "conditional",
standardize = NULL,
exponentiate = FALSE,
df_method = "wald",
p_adjust = NULL,
style = NULL,
column_names = NULL,
keep = NULL,
drop = NULL,
parameters = keep,
verbose = TRUE
)
...  One or more regression model objects, or objects returned by


ci  Confidence Interval (CI) level. Default to 0.95 (95%). 
effects  Should parameters for fixed effects ( 
component  Model component for which parameters should be shown. See
documentation for related model class in 
standardize  The method used for standardizing the parameters. Can be

exponentiate  Logical, indicating whether or not to exponentiate the
the coefficients (and related confidence intervals). This is typical for
logistic regression, or more generally speaking, for models with log
or logit links. Note: Deltamethod standard errors are also
computed (by multiplying the standard errors by the transformed
coefficients). This is to mimic behaviour of other software packages, such
as Stata, but these standard errors poorly estimate uncertainty for the
transformed coefficient. The transformed confidence interval more clearly
captures this uncertainty. For 
df_method  Method for computing degrees of freedom for p values,
standard errors and confidence intervals (CI). See documentation for
related model class in 
p_adjust  Character vector, if not 
style  String, indicating which style of output is requested. Following templates are possible:

column_names  Character vector with strings that should be used as
column headers. Must be of same length as number of models in 
keep  Character containing a regular expression pattern
that describes the parameters that should be included in the returned data
frame (for 
drop  Character containing a regular expression pattern
that describes the parameters that should be included in the returned data
frame (for 
parameters  Deprecated, alias for 
verbose  Toggle warnings and messages. 
A data frame of indices related to the model's parameters.
This function is in an early stage and does not yet cope with more complex models, and probably does not yet properly render all model components.
data(iris)
lm1 < lm(Sepal.Length ~ Species, data = iris)
lm2 < lm(Sepal.Length ~ Species + Petal.Length, data = iris)
lm3 < lm(Sepal.Length ~ Species * Petal.Length, data = iris)
compare_parameters(lm1, lm2, lm3)
#> Parameter  lm1  lm2  lm3
#> 
#> (Intercept)  5.01 (4.86, 5.15)  3.68 ( 3.47, 3.89)  4.21 ( 3.41, 5.02)
#> Species (versicolor)  0.93 (0.73, 1.13)  1.60 (1.98, 1.22)  1.81 (2.99, 0.62)
#> Species (virginica)  1.58 (1.38, 1.79)  2.12 (2.66, 1.58)  3.15 (4.41, 1.90)
#> Petal Length   0.90 ( 0.78, 1.03)  0.54 ( 0.00, 1.09)
#> Species (versicolor) * Petal Length    0.29 (0.30, 0.87)
#> Species (virginica) * Petal Length    0.45 (0.12, 1.03)
#> 
#> Observations  150  150  150
data(mtcars)
m1 < lm(mpg ~ wt, data = mtcars)
m2 < glm(vs ~ wt + cyl, data = mtcars, family = "binomial")
compare_parameters(m1, m2)
#> Parameter  m1  m2
#> 
#> (Intercept)  37.29 (33.45, 41.12)  10.62 ( 2.45, 18.79)
#> wt  5.34 (6.49, 4.20)  2.10 (0.93, 5.13)
#> cyl   2.93 (5.63, 0.23)
#> 
#> Observations  32  32
if (FALSE) {
# exponentiate coefficients, but not for lm
compare_parameters(m1, m2, exponentiate = "nongaussian")
# change column names
compare_parameters("linear model" = m1, "logistic reg." = m2)
compare_parameters(m1, m2, column_names = c("linear model", "logistic reg."))
# or as list
compare_parameters(list(m1, m2))
compare_parameters(list("linear model" = m1, "logistic reg." = m2))
}