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?

  • 1
    $\begingroup$ Why are you calculating the ICC? $\endgroup$
    – AdamO
    Commented Jun 27, 2013 at 19:08
  • 1
    $\begingroup$ 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? $\endgroup$
    – Megan
    Commented Jun 27, 2013 at 19:15
  • $\begingroup$ 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? $\endgroup$
    – AdamO
    Commented Jun 27, 2013 at 20:13
  • 4
    $\begingroup$ @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. $\endgroup$
    – Randel
    Commented Jun 27, 2013 at 23:50
  • 4
    $\begingroup$ @Megan: It is intercept_variance / (intercept_variance + pi^2/3) -- so don't square the variance. $\endgroup$
    – Wolfgang
    Commented Jul 20, 2015 at 19:31

1 Answer 1


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.

  • $\begingroup$ Do you have a reference for this formula? $\endgroup$
    – Jeanine
    Commented Sep 5, 2016 at 12:39
  • $\begingroup$ Do you mean me? Wasn't your comment initially at the OP posting? $\endgroup$
    – Daniel
    Commented Sep 5, 2016 at 13:23
  • $\begingroup$ @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 $\endgroup$
    – grumbles
    Commented Jun 10, 2017 at 0:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.