[R-sig-ME] how to extract the values in the nlme package?
bates at stat.wisc.edu
Tue Oct 7 23:12:51 CEST 2008
On Tue, Oct 7, 2008 at 2:06 AM, Ming Liu <dannyliu1002 at yahoo.com.cn> wrote:
> Dear friends,
> I take a lm for an example.
>> lm(formula = weight ~ group)
>> Min 1Q Median 3Q Max
>> -1.0710 -0.4938 0.0685 0.2462 1.3690
>> Estimate Std. Error t value Pr(>|t|)
>> (Intercept) 5.0320 0.2202 22.850 9.55e-15 ***
>> groupTrt -0.3710 0.3114 -1.191 0.249
>> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>> Residual standard error: 0.6964 on 18 degrees of freedom
>> Multiple R-squared: 0.07308, Adjusted R-squared: 0.02158
>> F-statistic: 1.419 on 1 and 18 DF, p-value: 0.249
> I can use the commands (summary(lm.D9)$r.squared,
> summary(lm.D9)$coef[1,4]) to extract the values(r.squared, p-value)
> from the above result.
But that only works if there are components named r.squared and coef
in the object returned by the summary method and it really has nothing
to do with the object returned by an nlme or lme fit. If you want the
estimate of the standard deviation of the random effects, you should
VarCrr> fm1 <- lme(distance ~ age, data = Orthodont, random = ~age)
Subject = pdLogChol(age)
Variance StdDev Corr
(Intercept) 5.41508751 2.3270341 (Intr)
age 0.05126955 0.2264278 -0.609
Residual 1.71620400 1.3100397
It happens that the object returned by VarCorr is a character matrix
(not a really great design, I must admit) so you would need to use
to get the numeric value.
> So, in your package I want to extract the values the StdDev of Random
> effects, could you give me a hand ? Thank you so much indeed.
> Best wishes,
> [[alternative HTML version deleted]]
> R-sig-mixed-models at r-project.org mailing list
More information about the R-sig-mixed-models