[R] extracting standard error from lme output

Spencer Graves spencer.graves at pdf.com
Tue Feb 17 16:59:25 CET 2004


Consider the following:

> library(nlme)
Loading required package: lattice
> DF <- data.frame(x=rep(c("a", "b"), 4), y=1:8)
> fit <- lme(y~1, random=~1|x, data=DF)
> summary(fit)
Linear mixed-effects model fit by REML
Data: DF
AIC BIC logLik
40.48753 40.32526 -17.24376

Random effects:
Formula: ~1 | x
(Intercept) Residual
StdDev: 0.03759522 2.449435

Fixed effects: y ~ 1
Value Std.Error DF t-value p-value
(Intercept) 4.5 0.8664139 6 5.193822 0.002

Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-1.4287089 -0.7143544 0.0000000 0.7143544 1.4287089

Number of Observations: 8
Number of Groups: 2

If you want to store the standard errors for future computations,
"attributes(summary(fits))" revealed a component "varFix", which led me
to the following:

> sqrt(summary(fit)$varFix)
(Intercept)
(Intercept) 0.866414

This matched the standard error printed above. The R purists may direct
me to some other function that I should use in place of accessing
components like this. However, I don't know how to find that other
function, and I've been able to make progress with this methodology in
many situations.

hope this helps. spencer graves

Tu Yu-Kang wrote:

> Dear R experts,
>
> I want to extract standard error from the output of lme, but I found
> fix.effects() does not include SE of the coefficients. Many thanks in
> advance.
>
> Best regards,
>
> Yu-Kang
>
> _________________________________________________________________
> ²{¦b´N¤W MSN ·|­û¥Ø¿ý¡G¦b½u¤Wµ²¥æ·sªB¤Í¡A§ä¨ì¿³½ì¬Û§ëªº¹Ù¦ñ
>
> ______________________________________________
> R-help at 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




More information about the R-help mailing list