[R] How to tell if there is overdispersion in a GLMM?
maggy yan
kiotoqq at gmail.com
Tue Feb 3 16:27:09 CET 2015
I read something on http://glmm.wikidot.com/faq, under "How can I deal with
overdispersion in GLMMs?":
library(lme4) ## 1.0-4set.seed(101)
d <- data.frame(y=rpois(1000,lambda=3),x=runif(1000),
f=factor(sample(1:10,size=1000,replace=TRUE)))
m1 <- glmer(y~x+(1|f),data=d,family=poisson)
overdisp_fun(m1)## chisq ratio rdf p
## 1026.7780815 1.0298677 997.0000000 0.2497659
library(glmmADMB) ## 0.7.7
m2 <- glmmadmb(y~x+(1|f),data=d,family="poisson")
overdisp_fun(m2)## chisq ratio rdf p
## 1026.7585031 1.0298480 997.0000000 0.2499024
In both case, the chisq is > rdf, does it mean there is over dispersion?
thanks for any help
[[alternative HTML version deleted]]
More information about the R-help
mailing list