library(agridat)
data(dasilva.maize)
dat <- dasilva.maize
# Try to match Table 1 of da Silva 2015.
# aggregate(yield ~ env, data=dat, FUN=mean)
## env yield
## 1 E1 6.211817 # match E2 in Table 1
## 2 E2 4.549104 # E3
## 3 E3 5.152254 # E4
## 4 E4 6.245904 # E5
## 5 E5 8.084609 # E6
## 6 E6 13.191890 # E7
## 7 E7 8.895721 # E8
## 8 E8 8.685448
## 9 E9 8.737089 # E9
# Unable to match CVs in Table 2, but who knows what they used
# for residual variance.
# aggregate(yield ~ env, data=dat, FUN=function(x) 100*sd(x)/mean(x))
# Match DaSilva supplement 2, ANOVA
# m1 <- aov(yield ~ env + gen + rep:env + gen:env, dat)
# anova(m1)
## Response: yield
## Df Sum Sq Mean Sq F value Pr(>F)
## env 8 8994.2 1124.28 964.1083 < 2.2e-16 ***
## gen 54 593.5 10.99 9.4247 < 2.2e-16 ***
## env:rep 18 57.5 3.19 2.7390 0.0001274 ***
## env:gen 432 938.1 2.17 1.8622 1.825e-15 ***
## Residuals 972 1133.5 1.17
Run the code above in your browser using DataLab