[R] repeated measures and covariance structures

Doran, Harold HDoran at air.org
Tue Sep 14 18:18:42 CEST 2004


Yes. Try something akin to

> fm1<- lme(y~time, data, random=~time|ID)

> fm2<-update(fm1, correlation=corAR1(form~time|ID) 

You can then use anova(fm1,fm2) to compare.

Harold

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Chris Solomon
Sent: Tuesday, September 14, 2004 12:07 PM
To: R-help at stat.math.ethz.ch
Subject: [R] repeated measures and covariance structures

Hello-

I'm trying to do some repeated measures ANOVAs. In the past, using SAS,
I have used the framework outlined in Littell et al.'s "SAS System for
Mixed Models", using the REPEATED statement in PROC MIXED to model
variation across time within an experimental unit. SAS allows you to
specify different within-unit covariance structures (e.g., compound
symmetric, AR(1), etc.) to determine the best model.

I'm having trouble figuring out how to do a similar analysis in R. While
'lme' will let you choose the class of correlation structure to use, it
seems to require that you specify this structure rather than using the
data to estimate the covariance matrix. For example, it seems that to
specify 'corAR1' as the correlation structure, you have to pick a value
for rho, the autoregressive parameter.

So, my question: is there a way to tell 'lme' what sort of covariance
structure you'd like to model, and then let the function estimate the
covariances? Or, alternatively, is there a better way to go about this
sort of repeated measures analysis in R? I've exhausted my available R
resources and done a pretty good search of the help archives without
finding a clear answer.

Thanks much!
Chris



*******
Chris Solomon
Center for Limnology
Univ. of Wisconsin
Phone: (608) 263-2465

______________________________________________
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




More information about the R-help mailing list