if (FALSE) {
libs(agridat)
data(chakravertti.factorial)
dat <- chakravertti.factorial
# Simple means for each factor. Same as Chakravertti Table 3
group_by(dat, gen)
group_by(dat, date)
group_by(dat, spacing)
group_by(dat, seeds)
libs(HH)
interaction2wt(yield ~ gen + date + spacing + seeds, data=dat, main="chakravertti.factorial")
# ANOVA matches Chakravertti table 2
# This has a very interesting error structure.
# block:date is error term for date
# block:date:gen is error term for gen and date:gen
# Residual is error term for all other tests (not needed inside Error())
dat <- transform(dat,spacing=factor(spacing))
m2 <- aov(yield ~ block + date +
gen + date:gen +
spacing + seeds +
seeds:spacing + date:seeds + date:spacing + gen:seeds + gen:spacing +
date:gen:seeds + date:gen:spacing + date:seeds:spacing + gen:seeds:spacing +
date:gen:seeds:spacing + Error(block/(date + date:gen)),
data=dat)
summary(m2)
}
Run the code above in your browser using DataLab