[R] Extracting intercept and residual std dev from lme results

Douglas Bates bates at stat.wisc.edu
Wed May 29 23:48:48 CEST 2002

getVarCov() in nlme_3.1-27

Andrew Perrin <clists at perrin.socsci.unc.edu> writes:

> Greetings-
> I need to extract, programatically, the standard deviations of the
> intercept and residuals from an lme model.  These are presented by
> print.lme as:
> ...
>         (Intercept)  Residual
> StdDev:    1.410635 0.7800512
> ...
> (data taken from ?lme's examples section)
> I can get the residuals with x$sigma where x is the fitted lme object. I
> can't find the intercept, though. The closest I've got is:
> > tmp$modelStruct$reStruct     
> Random effects:
>  Formula: ~1 | ID
>         (Intercept) Residual
> StdDev:    1.808388        1
> which still doesn't give me just the number. I've been looking in the
> summary() and print() methods to the structures, but haven't had any luck
> in pinpointing where this number is stored and/or calculated. I want to
> use these numbers in a further function, so that's why I need access to
> them in themselves rather than just in a summary.
> Thanks for any advice.
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list