c_e_cressler
2013-Nov-06 20:46 UTC
[R] Treatment effects on measurements through time: how to tell when (in time) treatment has a significant effect?
Hi, The data (attached) I am looking at consists of measurements of growth rate at different ages, for individuals in two treatments (control and infected). What I want to know is whether and when (what age) the growth rate of infected individuals is higher than the growth rate for control individuals. The simplest way to approach this question is to just do a t-test at each age, but because the growth rates at a given age depend on the growth rates at previous ages before, that seems statistically invalid. I have looked at some of the time series literature, but most of that seems more complicated than what I am trying to do. What I would like to be able to say is something like, "The growth rate of infected individuals is higher than control individuals for ages 18-30." Any help or insight would be greatly appreciated. Thanks! Clay P.S. The data is provided as two matrices: the first column are the ages at which data was collected, and subsequent columns are the growth rate trajectories for different individuals. cntl.grates.rda <http://r.789695.n4.nabble.com/file/n4679911/cntl.grates.rda> inf.grates.rda <http://r.789695.n4.nabble.com/file/n4679911/inf.grates.rda> -- View this message in context: http://r.789695.n4.nabble.com/Treatment-effects-on-measurements-through-time-how-to-tell-when-in-time-treatment-has-a-significant--tp4679911.html Sent from the R help mailing list archive at Nabble.com.
Jim Lemon
2013-Nov-07 00:18 UTC
[R] Treatment effects on measurements through time: how to tell when (in time) treatment has a significant effect?
On 11/07/2013 07:46 AM, c_e_cressler wrote:> Hi, > > The data (attached) I am looking at consists of measurements of growth rate > at different ages, for individuals in two treatments (control and infected). > What I want to know is whether and when (what age) the growth rate of > infected individuals is higher than the growth rate for control individuals. > > The simplest way to approach this question is to just do a t-test at each > age, but because the growth rates at a given age depend on the growth rates > at previous ages before, that seems statistically invalid. I have looked at > some of the time series literature, but most of that seems more complicated > than what I am trying to do. What I would like to be able to say is > something like, "The growth rate of infected individuals is higher than > control individuals for ages 18-30." >Hi Clay, If you calculate the mean growth rates: inf_mean<-apply(as.matrix(inf.grates),1, mean,na.rm=TRUE) cntl_mean<-apply(as.matrix(cntl.grates),1, mean,na.rm=TRUE) and plot them: plot(cntl_mean,col=3) points(inf_mean,col=2) It looks like the growth rate in the infected group is consistently greater. Testing the linear models: summary(lm(cntl_mean~I(1:length(cnf_mean)))) summary(lm(inf_mean~I(1:length(inf_mean)))) looks like there is a significant effect. The proper comparison would be a mixed model with the individual scores, I think. Jim
Apparently Analagous Threads
- Model within subjects treatment variable and multiple measurements per treatment: is this the correct model?
- treatment effects with lme (repeated measurements)
- C6: latest util-linux-ng dependency on kernel?
- C6: latest util-linux-ng dependency on kernel?
- Getting printer into w2k