[R] 'nlme' library - lme function results

Dieter Menne dieter.menne at menne-biomed.de
Sat Jan 16 11:54:17 CET 2010




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])

Dieter


-- 
View this message in context: http://n4.nabble.com/nlme-library-lme-function-results-tp1015224p1015559.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list