Dieter Menne wrote:


Michal Figurski wrote:
I am running a simple mixed effects model using lme(). The call looks like this:
fit <- lme(Analyte~Sample, data=Data, random=~1 | Run)

I am particularly interested in the estimated random effects. When I print the 'fit' object, it looks something like example below:

(...)
Random effects:
  Formula: ~1 | Run
         (Intercept) Residual
StdDev:    3.483794 3.637523
(...)

While I have no problem obtaining the 'Residual' value by calling fit$sigma, I have no idea how to obtain the '(Intercept)' value from the 'fit' object. Anyone can help with that?



There might be an official way to get it, but I would use as a hack.

library(nlme)
fm2 <- summary(lme(distance ~ age + Sex, data = Orthodont, random = ~ 1))
sqrt(getVarCov(fm2)[1,1])

or get both from VarCorr(model):

VarCorr(fm2)
#Subject = pdLogChol(1)
#            Variance StdDev
#(Intercept) 3.266784 1.807425
#Residual    2.049456 1.431592

 -Peter Ehlers

--
Peter Ehlers
University of Calgary
403.202.3921

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to