[R-sig-ME] VarCorr vs ranef

Daniel Ezra Johnson danielezrajohnson at gmail.com
Sun Aug 31 12:13:50 CEST 2008


On Sun, Aug 31, 2008 at 6:53 AM, D Chaws <cat.dev.urandom at gmail.com> wrote:
> Can someone tell me why correlations between raw random effects are
> different from that provided in VarCorr for lme models?
> For example:
>
> fm1 = lme(distance ~ I(age-8), random = ~ 1 + I(age-8) | Subject, data =
> Orthodont)
> R# VarCorr(fm1)
> Subject = pdLogChol(1 + I(age - 8))
>            Variance StdDev Corr
> (Intercept) 3.55937  1.8866 (Intr)
> I(age - 8)  0.05127  0.2264 0.209
> Residual    1.71620  1.3100
>
> and
>
> R# cor(ranef(fm1))
>            (Intercept) I(age - 8)
> (Intercept)      1.0000     0.5764
> I(age - 8)       0.5764     1.0000
>

This isn't a complete answer, but the figures in VarCorr and the model
summary are the population estimates for the random effects (the
parameters) while everything derived from ranef() refers to the actual
Subjects in the data (the BLUPs).

Look at:

> sd(ranef(fm1))
(Intercept)  I(age - 8)
  1.7359554   0.1557322

Those figures don't match the VarCorr standard deviations either,
especially the second.

I don't know why the BLUPs pattern differently, exactly, but I did
look at plot(coefs(fm1)) which suggested Sex should be added as a
fixed effect. Once I did that, the correlation between the random
effects changed quite a lot (but was still different between VarCorr
and ranef; the population correlation was actually negative...)

D




More information about the R-sig-mixed-models mailing list