[R] treatment effect at specific time point within mixed effects model

From: Afshartous, David <afshart_at_exchange.sba.miami.edu>
Date: Tue 26 Sep 2006 - 15:13:01 GMT



The code below is for a pseudo dataset of repeated measures on patients where there is also a treatment factor called "drug". Time is treated as categorical.

What code is necessary to test for a treatment effect at a single time point,
e.g., time = 3? Does the answer matter if the design is a crossover design,
i.e, each patient received drug and placebo?

Finally, what would be a good response to someone that suggests to do a simple t-test (paired in crossover case) instead of the test above within a mixed model?


z = rnorm(24, mean=0, sd=1)
time = rep(1:6, 4)

Patient = rep(1:4, each = 6)
drug = factor(rep(c("I", "P"), each = 6, times = 2)) ## P = placebo, I = Ibuprofen
dat.new = data.frame(time, drug, z, Patient) data.grp = groupedData(z ~ time | Patient, data = dat.new) fm1 = lme(z ~ factor(time) + drug + factor(time):drug, data = data.grp, random = list(Patient = ~ 1) )

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 and provide commented, minimal, self-contained, reproducible code. Received on Wed Sep 27 01:14:29 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 04 Oct 2006 - 23:30:08 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.