Solved – Mixed effects model validation and selection with `lme4::glmer`

glmmlme4-nlmemixed modelrrandom-effects-model

If I had a glm using on count data I may do the following:

glm(response ~ exp1 * exp2, family = poisson, data =data)

The first thing I would do here is check for overdispersion with the residual deviance/df. If there was overdispersion I may choose to use family = quasipossion

glm(response ~ exp1 * exp2, family = quaispoisson, data =data)

I would then simplify my model to find the optimal model using analysis of deviance based on log likelihoods (likelihood ratio tests)e.g.

m1 <- glm(response ~ exp1 * exp2, family = quaipoissn, data =data)
m2 <- glm(response ~ exp1 + exp2, family = quaipoissn, data =data) #remove interaction
anova(m1, m2, test = "chi") #if it was still poisson
# or
anova(m1, m2, test = "F") #for quasipoisson
# using p-values to assess the significance of the removed interaction

Finally then I would then validate my model by plotting deviance residuals against fitted values, explanatory values e.g. plot(m2). If all is ok, there is independence and no patterns, I don't have to add in extra explanatory variables etc.

My question is, what are the key differences to this process using glmer e.g.

glmer(response ~ exp1 * exp2 + (1|random1/random2), family = poisson, data =data)

Best Answer

A good deal of this is covered in Ben Bolker's excellent at mixed models in R FAQ/wiki