[R-sig-ME] var(ranef(.)) v. VarCorr(.)

Douglas Bates bates at stat.wisc.edu
Mon Mar 21 17:17:50 CET 2011


On Mon, Mar 21, 2011 at 7:01 AM, Robert Kinley <KINLEY_ROBERT at lilly.com> wrote:
> [ windows  XP , R 2.12.2 , lme4 ]
>
> This is probably a naive question.
>
> I have a data set where 1 measurement is taken at each of 2
> specific locations on each subject; these are considered to be
> random effects varying from subject to subject, but with  different
> variances for the two locations - the two measurements  on each
> subject are also highly correlated.
>
> Data layout and formula are shown below - the measurement
> location is  specified by the factor 'Label'  .
>
> Having fitted the mixed effects model,  I extracted the various
> random effects using ranef(.) and calculated their variance.covariance
> matrices  ...  but these are not the same as, or even similar to, the
> variance.covariance matrices given by VarCorr(.) ...
>
> Should they be the same ?

No.  They are, of course, related, but they are not the same thing.
The VarCorr() result is the estimate of the variance-covariance matrix
of the *marginal* or unconditional distribution of the random effects.
 The result of ranef is the conditional mean of the random effects,
given the observed data.

>                thanks  Robert Kinley
>
> Formula:
>
> Hist.lmer<-lme4::lmer(Data ~ (Group*Label ) +
>                             (0+Label |Study) +
>                             (0+Label |Study:Group)  +
>                             (0+Label |Subject:Study:Group),
>  data=Hist)
>
> Data Layout:
>
>      Study   Group    Label        Data Subject
> 1   8221-631      QC log10Cer -1.33161408       1
> 73  8221-631      QC log10Hip -1.12378216       1
> 2   8221-631      QC log10Cer -1.00000000       2
> 74  8221-631      QC log10Hip -0.74232142       2
> 3   8221-631      QC log10Cer -1.26360350       3
> 75  8221-631      QC log10Hip -1.04817696       3
> 4   8221-631      QC log10Cer -1.25414480       4
> 76  8221-631      QC log10Hip -1.01367622       4
> 5   8221-631 Vehicle log10Cer -1.27654433       5
> 77  8221-631 Vehicle log10Hip -0.86966623       5
> 6   8221-631 Vehicle log10Cer -1.00921731       6
> 78  8221-631 Vehicle log10Hip -0.58838029       6
> ... etc
>
>
>
>
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>




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