Skip to content
Prev 10545 / 20628 Next

How to extract the variance of interaction from lme

Tal Lahav <lahav.t at ...> writes:
It should be possible, via VarCorr(model). 

library(nlme)
data(Pastes,package="lme4")
head(Pastes)
  strength batch cask sample
1     62.8     A    a    A:a
2     62.6     A    a    A:a
3     60.1     A    b    A:b
4     62.3     A    b    A:b
5     62.7     A    c    A:c
6     63.1     A    c    A:c
fm <- lme(strength~cask, random=~1|batch/cask, 
     method="REML", data=Pastes)
VarCorr(fm)
            Variance     StdDev   
batch =     pdLogChol(1)          
(Intercept) 1.5227888    1.2340133
cask =      pdLogChol(1)          
(Intercept) 8.8373194    2.9727629
Residual    0.6779997    0.8234073

  I think the reported 'cask (Intercept)' variance should be
what you want; I hope someone will correct me if necessary.

  Ben Bolker