data(fan.stability)
dat <- fan.stability
dat$env <- factor(paste(dat$loc, dat$year, sep=""))
require('reshape2')
dm <- acast(dat, gen~env, value.var="yield")
require('agricolae')
# Use 0.464 as pooled error from ANOVA. Calculate yield mean/stability.
stability.par(dm, rep=3, MSerror=0.464) # Table 5 of Fan et al.Run the code above in your browser using DataLab