View source: R/compare_parameters.R
compare_parameters | R Documentation |
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,
ci_method = "wald",
p_adjust = NULL,
select = NULL,
column_names = NULL,
pretty_names = TRUE,
keep = NULL,
drop = NULL,
verbose = TRUE
)
compare_models(
...,
ci = 0.95,
effects = "fixed",
component = "conditional",
standardize = NULL,
exponentiate = FALSE,
ci_method = "wald",
p_adjust = NULL,
select = NULL,
column_names = NULL,
pretty_names = TRUE,
keep = NULL,
drop = NULL,
verbose = TRUE
)
... |
One or more regression model objects, or objects returned by
|
ci |
Confidence Interval (CI) level. Default to |
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
coefficients (and related confidence intervals). This is typical for
logistic regression, or more generally speaking, for models with log or
logit links. It is also recommended to use |
ci_method |
Method for computing degrees of freedom for p-values
and confidence intervals (CI). See documentation for related model class
in |
p_adjust |
Character vector, if not |
select |
Determines which columns and and which layout columns are printed. There are three options for this argument:
For |
column_names |
Character vector with strings that should be used as
column headers. Must be of same length as number of models in |
pretty_names |
Can be |
keep |
Character containing a regular expression pattern that
describes the parameters that should be included (for |
drop |
See |
verbose |
Toggle warnings and messages. |
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. It should also be noted that when including models with interaction terms, not only do the values of the parameters change, but so does their meaning (from main effects, to simple slopes), thereby making such comparisons hard. Therefore, you should not use this function to compare models with interaction terms with models without interaction terms.
A data frame of indices related to the model's parameters.
data(iris)
lm1 <- lm(Sepal.Length ~ Species, data = iris)
lm2 <- lm(Sepal.Length ~ Species + Petal.Length, data = iris)
compare_parameters(lm1, lm2)
# custom style
compare_parameters(lm1, lm2, select = "{estimate}{stars} ({se})")
# custom style, in HTML
result <- compare_parameters(lm1, lm2, select = "{estimate}<br>({se})|{p}")
print_html(result)
data(mtcars)
m1 <- lm(mpg ~ wt, data = mtcars)
m2 <- glm(vs ~ wt + cyl, data = mtcars, family = "binomial")
compare_parameters(m1, m2)
# 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.