[R-sig-ME] help with repeated measures on a split-plot experiment
hadley wickham
h.wickham at gmail.com
Tue Jun 10 06:41:48 CEST 2008
>> If you can make do with time as a linear function then I think that's OK. I've still got a a feeling that if you have time as a factor then you run out of dfs. If you can post a self-contained example with model and data then others can probably comment if this is the case (I received some great help from the list on this topic about a year ago.
>>
>
> Here is my script with data below (including time as a linear function
> rather than a factor):
> library(nlme)
> dataset<-as.data.frame(read.csv("dshrubs.csv", header=TRUE))
> attach(dataset)
> names(dataset)
> model1<-lme(response~date*snow*warm, random =~ 1|plot, data=dataset)
> anova(model1)
> plot(model1,resid(.)~plot,abline=0)
> qqnorm(model1)
I'd suggest you start with some good explanatory plots:
install.packages("ggplot2")
library(ggplot2)
qplot(date, response, data=shrubs, colour = warm, group=plot,
geom=c("line", "point"), facets = snow ~ .)
This seems revealing to me: not much going on, with the possible
exception of snow = "R", which has a lower variance and a slight
upward trend, particularly for warm = P. Group-wise linear models
support this interpretation:
qplot(date, response, data=shrubs, colour = warm, geom="point", facets
= snow ~ .) +
geom_smooth(method=lm)
Although if the group-level variances truly are equal, you will get
more power from the mixed effects model.
Hadley
--
http://had.co.nz/
More information about the R-sig-mixed-models
mailing list