[R] How to calculate Intraclass-coefficient in 2-level Linear Mixed-Effects models?

Thu Jan 31 16:25:43 CET 2008

```Dear R-users,

consider a 2-level linear mixed effects model (LME) with random intercept
AND random slope for level 1 AND 2. Does anybody know how to calculate
Intraclass-coefficient (ICC) for highest (innermost) level 2 ??? In the
literature, I did not find an example for these kind of komplex models.

For 1-level Random-Intercept models it would be easy:
ICC = variance due to the clustering variable / (variance due to the
clustering variable + variance remaining) = sigma^2_RandomIntercept /
(sigma^2_RIntercept + sigma^2_error)

My data are similar to Pixel-Data from R-package nlme:
=> Please assume an adequate model is the following (although you really do
not need the Random Slope on Level "Side within Dog" here... and an adequate
model is also different concerning fixed effects):
-----------------------------------------------------------------------------------
m1 <- lme(pixel ~ day + I(day^2), data = Pixel,
random = list(Dog = ~ day, Side = ~ day))

Linear mixed-effects model fit by REML
Data: Pixel
AIC    BIC  logLik
904.27 927.71 -443.13

Random effects:
----------------
Formula: ~day | Dog
Structure: General positive-definite, Log-Cholesky parametrization
StdDev    Corr
(Intercept) 31.494   (Intr)
day           1.0720   -0.786

Formula: ~day | Side %in% Dog
Structure: General positive-definite, Log-Cholesky parametrization
StdDev         Corr
(Intercept) 15.09          (Intr)
day          0.0000249        0
Residual    14.534

Fixed effects: pixel ~ day
Value      Std.Error    DF   t-value   p-value
(Intercept) 1093.22   10.9566    81  99.777    0.0000
day           -0.15       0.4912     81  -0.303    0.7629

Correlation:
(Intr)
day -0.668

----------------------------------------------------------------------------------------------
There are 2 nested grouping factors: "Dog" (=Level 1) and "Side within Dog"
(=Level 2).
A LME could be used to calculate the intraclass correlation coefficient
(ICC) as a measure of concordance of pixel intensity in between left and
right Side .

Can anybody help me with the correct formula, i.e. do you have to include
variance component estimator for level 1 ("Dog"), too?
Is it something like this:

ICC = (sigma2_RandomSlope-Dog + sigma2_RandomSlope-SidewithinDog) /
(sigma2_RandomSlope-Dog + sigma2_RandomSlope-SidewithinDog + sigma2_error)

Any hints would be appreciated!