liqiu jiang
2005-Jun-28 20:31 UTC
[R] How to extract the within group correlation structure matrix in "lme"
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> bCorrelation 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]]
Spencer Graves
2005-Jun-28 21:07 UTC
[R] How to extract the within group correlation structure matrix in "lme"
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 at 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 at pdf.com www.pdf.com <http://www.pdf.com> Tel: 408-938-4420 Fax: 408-280-7915
Maybe Matching Threads
- Query: lme output
- Help: lme
- trouble with extraction/interpretation of variance structure para meters from a model built using gnls and varConstPower
- [R-sig-ME] account for temporal correlation
- lme and gls : accessing values from correlation structure and variance functions