Skip to content
Prev 6168 / 20628 Next

using lmer() to estimate intraclass correlation coefficients (ICCs)

Thomas,

If I understand your question correctly, you want to stratify both the 
random effects variance and the residual error variance.   This topic 
has been discussed on this list in several different threads, here is 
one summary:

https://stat.ethz.ch/pipermail/r-sig-mixed-models/2007q3/000248.html

Basically, the way to specify a random effects stratification in lmer 
and nlme is:
(Pind and Dind are indicator variables for the respective groups that 
have different random effects variance)

lmer:
fm.het <- lmer( dv ~ time.num*drug + ( 0 + Dind | Patient ) + ( 0 + Pind 
| Patient ), data=dat.new ) )
lme:
fm.het <- lme( dv ~ time.num*drug, random = list(~ 0 + Pind  | 
Patient.new, ~ 0 + Dind  | Patient.new), data=dat.new )

If it was a crossover study and you wanted to have a covariance between 
the two groups you would have the following changes:

lmer:
  (0 + Dind + Pind | Patient )
lme:
random = list(~ 0 + Pind + Dind | Patient.new)


To stratify the residual error variance as well:

lmer:
If I recall correctly, not possible in lme

lme:
weights = varIdent(form = ~ 1 | treatment.ind) )

Cheers,
David