I've been working on a GLMM in R and I see that an assumption of the test is that the random factor must be normally distributed (that is, unless you're using a package like hglm where you can specify a different distribution). However, I can't find any sort of code for how to test the distribution of the random effect, does anyone here have any ideas?
I'm only aware of how to test the residuals of the GLMM for normality, via:
resid <- residuals(model)
qqnorm(resid)
qqline(resid, col = 2)
and
shapiro.test(residuals(model, type = "normalized"))
ranefdo? Readers who use non-Rsoftware surely would want to know so that they could apply your answer, too. – whuber Sep 29 '14 at 20:48`model<-lmer(VPL~Age+Sex+DET+DOC+GS+NND+Month+(1|FocalID),data=VPtest)
ranef.model<-ranef(model)$FocalID$
(Intercept)qqnorm(ranef.model) qqline(ranef.model) shapiro.test(ranef.model)`Which gives me tests run on 40 different points.
I'm confused about the use of Intercept and slope in your example though, could you explain how that might apply to my model? Do I need to use the actual output intercept value?
– Reese Sep 30 '14 at 00:24ranef(model)$Subject$``(Intercept)– Robert Long Sep 30 '14 at 09:47