# 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? – AdamO Jun 27 '13 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? – Megan Jun 27 '13 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? – AdamO Jun 27 '13 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. – Randel Jun 27 '13 at 23:50
• @Megan: It is intercept_variance / (intercept_variance + pi^2/3) -- so don't square the variance. – Wolfgang Jul 20 '15 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? – Jeanine Sep 5 '16 at 12:39
• Do you mean me? Wasn't your comment initially at the OP posting? – Daniel Sep 5 '16 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 – grumbles Jun 10 '17 at 0:28

## protected by Community♦Jun 10 '17 at 5:46

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?