1

I ran a robust mixed effects model with the rlmer command implemented in the robustlmm package. The package includes a plotting function plot.lmerMod for residual analysis, the resulting plots are ggplot objects. As you can see in the example below I managed to add a reference line to the Q-Q vs. residuals plot (see below). However, I'm unsure how to do this for the random effects (RE) Q-Q plot. Through the getMefunction several "components" are accessible. I extracted the conditional mode of the “spherical” random effects variable which is represented by ``u```. The lines in the resulting plot appear to be fine but I'm really not sure if that is the right thing to do?

library(lme4)
library(robustlmm)
library(ggplot2)

fit <- rlmer(Reaction ~ Days + (Days|Subject), sleepstudy)

# Q-Q versus residuals
QQ1 <- plot.rlmerMod(fit, which=2)
QQ1[[1]]+
  stat_qq_line(aes(sample=resid(fit)))

# Q-Q versus RE
RE <- getME(fit,name = c("u"))
QQ2 <- plot.rlmerMod(fit, which=3)
QQ2[[1]]+
  stat_qq_line(aes(sample=RE2))

Normal Q-Q vs. Residuals Normal Q-Q vs. Random Effects

Julian
  • 240
  • 1
  • 8

0 Answers0