Home  /  Products  /  Features  /   Intraclass correlations for multilevel models

Stata’s estat icc command is a postestimation command that can be used after linear, logistic, or probit random-effects models. It estimates intraclass correlations for multilevel models.

We fit a three-level mixed model for gross state product using mixed. Fixed-effects covariates include the state unemployment rate and different categories of public capital stock: hwy, water, and other. Random intercepts are present at both the region and state levels. Seventeen years of annual data are used. We use estat icc to estimate the intraclass correlations for this model.

. webuse productivity
(Public Capital Productivity)

. mixed gsp private emp hwy water other unemp || region: || state:

Performing EM optimization ...

Performing gradient-based optimization: 
Iteration 0:   log likelihood =  1430.5017  
Iteration 1:   log likelihood =  1430.5017  

Computing standard errors ...

Mixed-effects ML regression                     Number of obs     =        816

        Grouping information
No. of Observations per group
Group variable groups Minimum Average Maximum
region 9 51 90.7 136
state 48 17 17.0 17
Wald chi2(6) = 18829.06 Log likelihood = 1430.5017 Prob > chi2 = 0.0000
gsp Coefficient Std. err. z P>|z| [95% conf. interval]
private .2671484 .0212591 12.57 0.000 .2254814 .3088154
emp .754072 .0261868 28.80 0.000 .7027468 .8053973
hwy .0709767 .023041 3.08 0.002 .0258172 .1161363
water .0761187 .0139248 5.47 0.000 .0488266 .1034109
other -.0999955 .0169366 -5.90 0.000 -.1331906 -.0668004
unemp -.0058983 .0009031 -6.53 0.000 -.0076684 -.0041282
_cons 2.128823 .1543854 13.79 0.000 1.826233 2.431413
Random-effects parameters Estimate Std. err. [95% conf. interval]
region: Identity
var(_cons) .0014506 .0012995 .0002506 .0083957
state: Identity
var(_cons) .0062757 .0014871 .0039442 .0099855
var(Residual) .0013461 .0000689 .0012176 .0014882
LR test vs. linear model: chi2(2) = 1154.73 Prob > chi2 = 0.0000 Note: LR test is conservative and provided only for reference. . estat icc Residual intraclass correlation
Level ICC Std. err. [95% conf. interval]
region .159893 .127627 .0287143 .5506202
state|region .8516265 .0301733 .7823466 .9016272

estat icc reports two intraclass correlations for this three-level nested model. The first is the level-3 intraclass correlation at the region level, the correlation between productivity years in the same region. The second is the level-2 intraclass correlation at the state-within-region level, the correlation between productivity years in the same state and region.

Conditional on the fixed-effects covariates, we find that annual productivity is only slightly correlated within the same region, but it is highly correlated within the same state and region. We estimate that state and region random effects compose approximately 85% of the total residual variance.

Now we fit a three-level logistic model for successful completion of the Tower of London computerized task. The variable group is used to classify individuals as controls (1), relatives of a schizophrenic (2), or schizophrenic (3). The difficulty level of the task and separate indicators for the different values of group are fixed-effect covariates. Random intercepts are present at both the family and subject levels.

. webuse towerlondon
(Tower of London data)

. melogit dtlm difficulty i.group || family: || subject:, or nolog

Mixed-effects logistic regression               Number of obs      =       677

        Grouping information
No. of Observations per group
Group variable groups Minimum Average Maximum
family 118 2 5.7 27
subject 226 2 3.0 3
Integration method: mvaghermite Integration points = 7 Wald chi2(3) = 74.90 Log likelihood = -305.12041 Prob > chi2 = 0.0000
dtlm Odds ratio Std. err. z P>|z| [95% conf. interval]
difficulty .1923372 .037161 -8.53 0.000 .1317057 .2808806
group
2 .7798263 .2763763 -0.70 0.483 .3893369 1.561961
3 .3491318 .13965 -2.63 0.009 .15941 .764651
_cons .226307 .0644625 -5.22 0.000 .1294902 .3955112
family
var(_cons) .5692105 .5215654 .0944757 3.429459
family>
subject
var(_cons) 1.137917 .6854853 .3494165 3.705762
Note: Estimates are transformed only in the first equation to odds ratios. Note: _cons estimates baseline odds (conditional on zero random effects). LR test vs. logistic model: chi2(2) = 17.54 Prob > chi2 = 0.0002 Note: LR test is conservative and provided only for reference.

We use estat icc to estimate the intraclass correlations for this model.

. estat icc

Residual intraclass correlation

Level ICC Std. err. [95% conf. interval]
family .1139105 .0997727 .0181851 .4715289
subject|family .3416307 .0889471 .192923 .5297291

estat icc reports two intraclass correlations for this three-level nested model. The first is the level-3 intraclass correlation at the family level, the correlation between latent measurements of the cognitive ability in the same family. The second is the level-2 intraclass correlation at the subject-within-family level, the correlation between the latent measurements of cognitive ability in the same subject and family.

There is not a strong correlation between individual realizations of the latent response, even within the same subject.