# NOT RUN {
data(cochran.bib)
dat <- cochran.bib
# Show the incomplete-block structure
require(lattice)
levelplot(yield~loc*gen, dat,
col.regions=RedGrayBlue,
xlab="loc (block)", main="cochran.bib - incomplete blocks")
with(dat, table(gen,loc))
rowSums(as.matrix(with(dat, table(gen,loc))))
colSums(as.matrix(with(dat, table(gen,loc))))
m1 = aov(yield ~ gen + Error(loc), data=dat)
summary(m1)
require(nlme)
m2 = lme(yield ~ -1 + gen, data=dat, random=~1|loc)
if(require(agricolae)){
BIB.test(dat$loc, dat$gen, y=dat$yield)
}
# }
Run the code above in your browser using DataLab