I'm trying to look for difference in timing (ie. earlier/later) in a variable measured at regular intervals between two groups.
This seems like a simple experimental design, and working in R, I'm able to visualize the data in a way that makes sense to me, but somehow I'm getting confused when it comes to testing for significance.
The data consist of weekly measurements of number of flowers for each individual, within and outside of the greenhouse. To take a small example:
expand.grid(week=(1:6),treatment=c("greenhouse","outside"),individual=1:2)->df
c(0,3,10,2,0,0,0,0,0,2,18,0,0,1,19,0,0,0,0,0,1,2,15,1)->flowers
data.frame(cbind(df,flowers))->df
Visually,
qplot(week,flowers,data=df,facets=treatment~.)
If my interest is simply to determine whether there's a significant difference in the time of flowering between the treatments; should I be doing a repeated measures ANOVA and looking at the interaction?
Simplifying (?) the problem even further, what if I remove the quantity of flowers, and just consider how many individuals are flowering? So the summarized data would be
ddply(df, .(treatment,week), function(d) length(d[d$flowers>0,"flowers"]))->indiv
Which looks like this:
qplot(week,V1,data=indiv,facets=treatment~.)
Here, my first thought was that I can just think of these as two distributions, and compare with a t-test; however, only individuals and not individualsxweek are independent, so perhaps this should also be a repeated measures ANOVA? Or do I need to venture into the world of more complex time-series math?
Thanks for your help!
Edit As an update, I'm now also considering failure-time / survival analysis as a possible appropriate method.