Skip to content
Prev 10547 / 20628 Next

Overdispersion and model selection: glmmadmb vs. glmer

Hi Luca,

I've also seen this difference in residuals from a glmmadmb nbinom2 fit and a lognormal-Poisson fit with glmer. Generally the residuals X fitted plot from glmmadmb looks good (homoscedastic, no trend) while that from the lognormal-Poisson looks wrong (strong curve climbing sharply from negative to positive before plateauing). After some head-scratching I've decided that this isn't a problem.

The reason for the discrepancy is that the fitted values from the lognormal-Poisson fit include the overdispersion random effects, i.e. everything expect the Poisson variation, while the NB fitted values don't, because overdispersion is intrinsic to the NB, not an added random effect. Because the obs-level random effect is there to increase the spread of the Poisson distribution, it's almost inevitable with strong overdispersion that the residuals with low fitted values will be negative while those with high fitted values will be positive.

The way to get a fair comparison between the two is to remove the obs-level random effect from the fitted values of the lognormal-Poisson, leaving just the fixed effects and any other random effects. I find this generally gives a residual pattern much more similar to NB in glmmadmb:
 
  Fitted <- exp(log(fitted(mod)) - ranef(mod)$obs[[1]])
  Resid <- (dat$response - Fitted) / sqrt(Fitted + (Fitted^2) * c(exp(VarCorr(mod)$obs) - 1)) 
  plot(Fitted, Resid) 

# obs is the name of the factor used for the obs-level random effect, 
# mod is the glmer fit of the lognormal-Poisson model, dat$response are the responses, and
# the bit inside the sqrt() is the variance function for the lognormal-Poisson

Generally I don't find that the model estimates and SEs differ much though.

Best wishes,
Paul


Paul Johnson

Institute of BAH&CM
Graham Kerr Building
University of Glasgow
Glasgow G12 8QQ

http://www.gla.ac.uk/researchinstitutes/bahcm/staff/pauljohnson/
http://www.stats.gla.ac.uk/~paulj/index.html