# NOT RUN {
data(cochran.eelworms)
dat <- cochran.eelworms
# Very strong spatial trends
desplot(initial ~ col*row, data=dat, flip=TRUE, main="cochran.eelworms")
# final counts are strongly related to initial counts
require(lattice)
xyplot(final~initial|dose, data=dat, group=fumigant,
main="cochran.eelworms", xlab="Initial worm count",
ylab="Final worm count", auto.key=list(columns=5))
# One approach...log transform, use 'initial' as covariate, create 9 treatments
dat <- transform(dat, trt=factor(paste0(fumigant, dose)))
m1 <- aov(log(final) ~ block + trt + log(initial), data=dat)
anova(m1)
# }
Run the code above in your browser using DataLab