Solved – Intraclass correlation with count data

anovacount-datageneralized linear modelglmmintraclass-correlation

I want to calculate the ICC between 3 different measurements where the dependent variable is a count. As far as I understood, if the data were normally distributed, I would use a repeated measures ANOVA for this. But for count data, the normality assumption doesn't hold true. Do you have any hints how to get the ICC without using rmANOVA? I know that generalized linear models are somehow crucial for that, but I don't know how to exactly use them for this purpose.

Best Answer

You need to work with a Generalized Linear Mixed-effects Model (GLMM). The repeated measures ANOVA is actually a special case of the Linear Mixed-effects Model (LMM), so GLMM:LMM as GLM:LM. From there, just recognize that the ICC is a descriptive statistic that assesses how distinctive the units are relative to the total spread of the data. The standard formula is:
$$ ICC = \frac{\sigma_{\bar{x_i}}^2}{\sigma_{\bar{x_i}}^2+\sigma_\varepsilon^2} $$ In the context of a mixed-effects model, the distinctiveness of the individuals is the variance of the random effects. Since variances add, the total is the variance of the random effects plus the residual variance.

To illustrate, here is a simple example, coded in R:

library(lme4)   # we'll use this package to fit the GLMM
set.seed(1189)  # this makes the example exactly reproducible

N          = 20                                     # there are 20 people in your study
reps       = 3                                      # w/ 3 observation each
id         = rep(1:N, each=reps)                    # this is the ID indicator
sub.lambda = rnorm(N, mean=1.6, sd=.3)              # here we generate each unit's mean
sub.lambda = rep(sub.lambda, each=reps)             #  & copy them for each observation
y          = rpois(reps*N, lambda=exp(sub.lambda))  # here we generate the counts

mod = glmer(y~(1|id), family=poisson)               # this fits the Poisson GLMM
summary(mod)                                        # here is the output:
# Generalized linear mixed model fit by maximum likelihood 
#   (Laplace Approximation) [glmerMod]
#  Family: poisson  ( log )
# ... 
# 
# Random effects:
#   Groups Name        Variance Std.Dev.
#   id     (Intercept) 0.1066   0.3265  
# Number of obs: 60, groups:  id, 20
# 
# Fixed effects:
#             Estimate Std. Error z value Pr(>|z|)    
# (Intercept)  1.45853    0.09745   14.97   <2e-16 ***

  ## now we get the variance of the random effects, the residuals, & calculate the ICC:
v.RE  = summary(mod)$varcor$id[1];  v.RE   # 0.1066211
v.res = var(resid(mod));            v.res  # 1.141968
ICC   = v.RE/(v.RE+v.res);          ICC    # 0.08539324
Related Question