Hi all,

I would like to check whether I am properly checking for overdispersion in
a mixed effects logistic regression. Here is the code:

m1 <- lmer(mortality.under.2 ~ maternal_age_d +B0 + B4 + V102 + BORD +
WLTHIND5+ time +                       new_time + democracy + V106 +
 WLTHIND5*time + WLTHIND5*new_time +      democracy*WLTHIND5 +
             (1 |CASEID)-1,data=brazil1,family=binomial(link="logit"))


# testing for overdispersion
n <- length(residuals(m1)) # the number of obs
k <- length(unique(brazil1$CASEID)) # the number of random effects
z <- sum(residuals(m1,type=standardize)^2) # squared, standardize residuals
cat("the overdispersion factor is",z/(n-k),"\n")
cat("the p-value of the overdispersion test is", pchisq(z,n-k))


Thanks!

apr.

	[[alternative HTML version deleted]]

