if (FALSE) {
library(agridat)
data(chinloy.fractionalfactorial)
dat <- chinloy.fractionalfactorial
# Treatments are coded with levels 0,1,2. Make sure they are factors
dat <- transform(dat,
n=factor(n), p=factor(p), k=factor(k), b=factor(b), m=factor(m))
# Experiment layout
libs(desplot)
desplot(dat, yield ~ col*row,
out1=block, text=trt, shorten="no", cex=0.6,
aspect=178/86,
main="chinloy.fractionalfactorial")
# Main effect and some two-way interactions. These match Chinloy table 6.
# Not sure how to code terms like p^2k=b^2m
m1 <- aov(yield ~ block + n + p + k + b + m + n:p + n:k + n:b + n:m, dat)
anova(m1)
}
Run the code above in your browser using DataLab