View source: R/mlm_assumptions.R
mlm_assumptions | R Documentation |
Reports the results from testing all assumptions of a multilevel model and provides suggestions if an assumption is not passed
mlm_assumptions(model, re_type = c("NA"))
model |
A linear mixed-effects model of class lmerMod, lmerModLmerTest, or glmerMod of type binomial. |
re_type |
A value indicating whether a model with two random effects is nested or cross-classified |
If re_type
is "NA", the proportion of variance at the random effect is computed.
If re_type = "nested", the likeness of y scores in the same level 3 unit (the proportion of variance at Level3_factor), the likeness of y scores in the same level 2 units in the same level 3 unit (proportion of variance at Level3_factor and Level2_factor), and the likeness of level 2 units in the same level 3 unit (proportion of Level2_factor variance at Level3_factor) are computed.
If re_type = "cc", the likeness of y scores in the same C1_factor unit (correlation between outcome values of units in same C1_factor but different C2_factor), the likeness of y scores in the same C2_factor (correlation between outcome values of units in the same C2_factor but different C2_factor), and the likeness of y scores in the same C1_factor and C2_factor combination (correlation between outcome values of units in the same C2_factor and C2_factor) are computed.
Tests the relevant assumptions of the specified multilevel model.
Glaser, R. E. (2006). Levene’s Robust Test of Homogeneity of Variances. Encyclopedia of Statistical Sciences. 6.
# Gaussian ## Read in data data(instruction) ## Create model mod <- lme4::lmer(mathgain ~ mathkind + (1 | classid), data = instruction) ## Evaluate assumptions mlm_assumptions(mod) # Logistic ## Read in data data(reporting) ## Create model mod <- lme4::glmer(mention.outliers ~ Basics + (1 | Journal), data = reporting, family = "binomial") ## Evaluate assumptions mlm_assumptions(mod)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.