levelCompare: Reports on a comparison of the mixed model vs. a model that...

View source: R/levelCompare.R

levelCompareR Documentation

Reports on a comparison of the mixed model vs. a model that does not account for nesting

Description

Uses AIC and BIC to compare whether the model that accounts for the correlation of responses within the same unit fits the data better than a model that assumes 0 correlation between responses within the same unit.

Usage

levelCompare(model)

Arguments

model

A linear mixed-effects model of class lmerMod or lmerModLmerTest

Value

Computes the AIC and BIC of the requested model and a model with the same predictors but absent the random intercept(s) and slope(s).

References

Burnham, K. P., & Anderson, D. R. (2004). Multimodel inference: understanding AIC and BIC in model selection. Sociological methods & research, 33(2), 261-304. Raftery, A. E. (1995). Bayesian model selection in social research. Sociological methodology, 111-163.

Examples



data(instruction)
mod <- lme4::lmer(mathgain ~ (1 | classid), data = instruction)
levelCompare(mod)



lj5yn/mlmtools documentation built on March 10, 2023, 8:37 p.m.