dat <- ryder.groundnut
# RCB model
m1 <- lm(dry~block+gen,dat)
dat$res1 <- resid(m1)
# Table 3 of Ryder. Scale up from kg/plot to kg/ha
round(dat$res1 * 596.6,0)
# Visually. Note largest positive/negative residuals are adjacent
desplot(res1 ~ col + row, dat, text=gen)
# Swap the dry yields for the plots and re-analyze
dat[dat$block=="B3" & dat$gen=="A", "dry"] <- 2.8
dat[dat$block=="B3" & dat$gen=="B", "dry"] <- 1.4
m2 <- lm(dry~block+gen, dat)
dat$res2 <- resid(m2)
desplot(res2 ~ col+row, dat, text=gen)Run the code above in your browser using DataLab