if (FALSE) {
library(agridat)
data(stirret.borers)
dat <- stirret.borers
libs(lattice)
xyplot(count2~count1|trt,dat,
main="stirret.borers - by treatment",
xlab="Early count of borers", ylab="Late count")
# Even though the data are counts, Normal distribution seems okay
# qqmath(~count1|trt, dat, main="stirret.borers")
m1 <- lm(count1 ~ -1 + trt + block, dat)
anova(m1)
# predicted means = main effect + average of 15 block effects
# note block 1 effect is 0
# coef(m1)[1:4] + sum(coef(m1)[-c(1:4)])/15
## trtBoth trtEarly trtLate trtNone
## 47.86667 62.93333 40.93333 61.13333
}
Run the code above in your browser using DataLab