Skip to content
Prev 5161 / 20628 Next

overdispersion estimation in a binomial GLMM

Here is a small function to compute the dispersion of
a  binomial  model, according to  a previous answer of D. Bates on the 
topic:

  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 at resid)

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