# Calculating ICC for random-effects logistic regression

I'm running a logistic regression model in the form:

lmer(response~1+(1|site), family=binomial, REML = FALSE)


Normally I would calculate the ICC from the intercept and residual variances, but the summary of the model doesn't include residual variance. How do I calculate this?

• Why are you calculating the ICC? Commented Jun 27, 2013 at 19:08
• In order to test the assumption that ordinary logistic regression is not valid for these data, as evidence that I should be using GLMM. I found an equation: ICClogit=intercept variance^2/(intercept variance^2+pi^2/3). Does this seem reasonable? Commented Jun 27, 2013 at 19:15
• You're using the full maximum likelihood approach. Can't you do a likelihood ratio test with 1 degree of freedom against the fixed effects model? Commented Jun 27, 2013 at 20:13
• @Megan: You are right. In practice, Zeger et al. (1988) suggests $(15/16)^2\pi^2/3$ works better than $\pi^2/3$ as residual variance for logistic regression models, though the two are very close. See S. L. Zeger, K. Y. Liang, and P. S. Albert. Models for longitudinal data: a generalized estimating equation approach. Biometrics, 44: 1049-1060 1988. Commented Jun 27, 2013 at 23:50
• @Megan: It is intercept_variance / (intercept_variance + pi^2/3) -- so don't square the variance. Commented Jul 20, 2015 at 19:31

You can use the icc()-function from the sjstats-package.
In the help-file ?sjstats::icc you find a reference to the formula for mixed models with binary response:
The residual deviance in logistic regression is fixed to (pi ^ 2) / 3.