Robust Multilevel Model in R
Robust Linear Mixed Effects Model in R
Arndt Regorz, Dipl. Kfm. & M.Sc. Psychology, 12/15/2023
(Note: When you click on this video you are using a service offered by YouTube.)
The following code runs a robust multilevel model in R
library(lme4)
library(robustlmm)
head(popular2, 5)
# Normal estimation (not robust)
random_slopes <- lmer(popular ~ 1 + sex + extrav + texp +
(1+extrav|class), data=popular2, REML=F)
summary(random_slopes)
# Robust estimation
rob_random_slopes <- rlmer(popular ~ 1 + sex + extrav + texp +
(1+extrav|class), data=popular2, REML=F)
summary(rob_random_slopes)
# Robust estimation, no random slopes
rob_fixed_slopes <- rlmer(popular ~ 1 + sex + extrav + texp +
(1|class), data=popular2, REML=F)
summary(rob_fixed_slopes)
# Weights
getME(rob_fixed_slopes, "w_e") # Level 1
getME(rob_fixed_slopes, "w_b") # Level 2
# Additional information
vignette("rlmer")