[R] repeated measures with random effects

Manuel A. Morales Manuel.A.Morales at williams.edu
Mon Dec 22 18:11:00 CET 2003


I am trying to analyze data from an experiment where subjects were assigned
each of two treatment manipulations (t1 and t2) crossed in a factorial
design. Sets of the four possible treatment combinations were grouped
together (block) with no replication within blocks (i.e. I can't test for a
t1*t2*block effect). Finally, measurements were taken over three time
intervals (time).

Converting variables to factors, I think I can fit this as a repeated
measures design with block as a fixed effect as follows:

results.fixed <- lme(measurements ~ block+block:time+t1*t2*time, data=test,
random=~1|subject)

Or, using block as a random effect:

results.random <- lme(measurements ~ t1*t2*time, data=test,
random=~1|block/subject)

Is this is the correct syntax, especially for the random effects version?

Thanks!

Manuel




More information about the R-help mailing list