if (FALSE) {
library(agridat)
data(gomez.fractionalfactorial)
dat <- gomez.fractionalfactorial
# trt abcdef has the highest yield
# Gomez, Figure 4.8
libs(desplot)
desplot(dat, yield~col*row,
# aspect unknown
text=trt, shorten="none", show.key=FALSE, cex=1,
main="gomez.fractionalfactorial - treatment & yield")
# Ensure factors
dat <- transform(dat,
a=factor(a), b=factor(b), c=factor(c),
d=factor(d), e=factor(e), f=factor(f) )
# Gomez table 4.24, trt SS totalled together.
# Why didn't Gomez nest block within rep?
m0 <- lm(yield ~ rep * block + trt, dat)
anova(m0)
# Gomez table 4.24, trt SS split apart
m1 <- lm(yield ~ rep * block + (a+b+c+d+e+f)^3, dat)
anova(m1)
libs(FrF2)
aliases(m1)
MEPlot(m1, select=3:8,
main="gomez.fractionalfactorial - main effects plot")
}
Run the code above in your browser using DataLab