[R] lme: extract variance estimate

From: Stephen Ellner <spe2_at_cornell.edu>
Date: Thu 08 Jul 2004 - 05:26:41 EST


Spencer Graves wrote:

> Have you considered "VarCorr"? I've used it with "lme", and the
>documentation in package lme4 suggests it should work with GLMM, which
>might also do what you want from glmmPQL.

Thanks for the pointer (I was not aware that nlme and lme4 had different versions of lme), but I'm still stuck at the same place using lme4:> VarCorr(fit)  Groups Name Variance Std.Dev.
 yeart (Intercept) 0.040896 0.20223
 Residual 0.091125 0.30187

The number I need to extract and store is the .20223, but all the components I can find in VarCorr(fit) are something else.

u=VarCorr(fit); slotNames(u)
[1] "scale" "reSumry" "useScale"
> u@scale

[1] 0.3018693
> u@reSumry

$yeart
An object of class "corrmatrix"

            (Intercept)
(Intercept)           1

Slot "stdDev":
(Intercept)
  0.6699156
> u@useScale

[1] TRUE In glmmML the estimate is returned as the $sigma component of the model, but I also need the same info from 'family=gaussian' models.

Stephen P. Ellner (spe2@cornell.edu)
Department of Ecology and Evolutionary Biology Corson Hall, Cornell University, Ithaca NY 14853-2701 Phone (607) 254-4221 FAX (607) 255-8088



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jul 08 05:30:59 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 02:34:54 EST