# How to get dispersion parameter from a binomial mixed model?

I am modelling data with a generalized mixed model with binomial error distribution and I am concerned about overdispersion. I know that dispersion parameter can be measured as deviance/df, but for mixed models (= with random effect), the number of degrees of freedom cannot be extracted (I am using the function lmer from R). Is there any way to find out if my data are overdispersed?

You may be able to use this function attributed to D. Bates to get the scale parameter:

dispersion_glmer<- function(modelglmer)
{
# computing  estimated scale  ( binomial model)
#following  D. Bates :
#That quantity is the square root of the penalized residual sum of
#squares divided by n, the number of observations, evaluated as:

n <- length(modelglmer@resid)

return(  sqrt( sum(c(modelglmer@resid, modelglmer@u) ^2) / n ) )
}