Re: [R] How to extract the within group correlation structure matrix in "lme"

From: Spencer Graves <spencer.graves_at_pdf.com>
Date: Wed 29 Jun 2005 - 07:07:03 EST

          Have you tried "VarCorr(f)"?

          spencer graves

liqiu jiang wrote:

> Dear R users,
> I fitted a repeated measure model without random effects by using lme. I will use the estimates from that model as an initial estimates to do multiple imputation for missing values of the response variable in the model. I am trying to extract the within group correlation matrix or covariance matrix.
>
> here is my code:
> f = lme(y ~x0+x1+trt+tim+x1:tim +tim:trt,random=~-1|subj, data=dat,corr =corAR1())
>

>>f$sigma

>
> [1] 2.330854
>
> b=summary(f)$modelStruct$corStruct
>
>>b

>
> Correlation structure of class corAR1 representing
> Phi
> 0.8518711
>
> I think 0.8518711 and f$sigma is what I need to reconstruct the variance-cavariance matrix. So, How can I extract 0.8518711 so that I can assign it to a variable? Also, I don't understand what the following parameters estimates mean?
>
> >summary(f)$modelStruct
> reStruct parameters:
> subj
> -20.15833
> corStruct parameters:
> [1] 2.525869
>
> I appreciate your time on this.
>
> Best wishes,
> Liqiu
>
>
>
>
>
>
>
>
> ---------------------------------
>
> Rekindle the Rivalries. Sign up for Fantasy Football
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

spencer.graves@pdf.com
www.pdf.com <http://www.pdf.com>
Tel:  408-938-4420
Fax: 408-280-7915

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Wed Jun 29 07:12:56 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:06 EST