[R] Repeated measures

Spencer Graves spencer.graves at pdf.com
Sun Jun 6 18:21:49 CEST 2004


      1.  You didn't say which "manual" you were reading on "lme", if 
you have not consulted Pinheiro and Bates (2000) Mixed-Effects Models in 
S and S-Plus (Springer), I suggest you do so.  The issues are discussed 
in greater depth with many examples.  I found this book well worth the 
time and money I invested in it. 

      2.  Have you considered the following: 

      lme(milk yield = cow + treatment + time + treatment*time, random = 
~time|cow ... )

      This will NOT have the ARCH(1) R RCORR error structure;  "lme" can 
handle certain types of autocorrelated error structures, but I don't 
remember the details at the moment.  Pinheiro and Bates discuss some 
capabilities of this nature. 

      hope this helps. 
      spencer graves

Alex Bach wrote:

> Dear R-gurus,
>
> I am pretty much new on R.
> I am trying to to do a repeated analysis of a linear mixed model with 
> R, and I consistently fail...
>
> The problem is: Cow is the random factor, treatment is the fixed 
> factor. The dependent variable is milk yield, which is measured 
> several times (repeatedly over time), thus there is another variable 
> which is time (i.e. week).
>
> The model would be something like this: milk yield = cow + treatment + 
> time + treatment*time
>
> With time as a repeated measure.
>
> Would some one be kind enough to guide on how could I set up the 
> statement in R?
> I imagine I have to use LME but I have not been smart enough to figure 
> out how to do it by just reading its manual. Also, with SAS there is a 
> nice contrast, called SLICE that allows you to test when in time there 
> is difference between treatments. I do not know if there is something 
> like this is R.
>
> Thank you very much!
>
> PD. For SAS users, what I am using in SAS to perform this analysis 
> (with an Autoregressive covariance structure) the program would read 
> like this:
>
> proc MIXED covtest;
> CLASS cow treat time;
> MODEL yield=  treat time treat*time;
> REPEATED time/SUB=cow(treat) TYPE=ARH(1) R RCORR;
> RANDOM cow;
> LSMEANS treat time treat*time/SLICE = time;
> RUN;
>
>
> Thank you very much,
>
> Sincerely,
>
> Alex
>
> ______________________________________________
> 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