# 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? 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? 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? 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. Jun 27, 2013 at 23:50
• @Megan: It is intercept_variance / (intercept_variance + pi^2/3) -- so don't square the variance. Jul 20, 2015 at 19:31

## 1 Answer

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:

Wu S, Crespi CM, Wong WK. 2012. Comparison of methods for estimating the intraclass correlation coefficient for binary responses in cancer prevention cluster randomized trials. Contempory Clinical Trials 33: 869-880 (doi: 10.1016/j.cct.2012.05.004)

The residual deviance in logistic regression is fixed to (pi ^ 2) / 3.

• Do you have a reference for this formula? Sep 5, 2016 at 12:39
• Do you mean me? Wasn't your comment initially at the OP posting? Sep 5, 2016 at 13:23
• @Jeanine- ICC citation: Moineddin, R., Matheson, F. I., & Glazier, R. H. (2007). A simulation study of sample size for multilevel logistic regression models. BMC Medical Research Methodology, 7, 34. doi.org/10.1186/1471-2288-7-34 Jun 10, 2017 at 0:28