Description Usage Arguments Value Examples
View source: R/variance_reduction.r
Function to compute the amount explained variance on each level by a random-intercept multilevel model. The amount of explained variance is computed by comparing the relevant models to the baseline (null-) model (i.e., the bare random-intercept model without any predictors).
1 | variance_reduction(object, ..., digits = 2, print = FALSE)
|
object |
An object of class merMod (more specifically, an object of subclass lmerMod). This first object needs to be the null model with no predictors. All other models will be compared to this baseline model. |
... |
Up to four objects of class merMod. |
red |
A logical value indicating wether only the explained variance should be reported (defaults to TRUE). |
A data fram containing the explained variance on both levels.
1 2 3 4 | m0 <- lme4::lmer(Reaction ~ 1 + (1 | Subject), sleepstudy)
m1 <- lme4::lmer(Reaction ~ 1 + Days + (1 | Subject), sleepstudy)
variance_reduction(m0, m1, print = T, digits = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.