if (FALSE) {
library(agridat)
data(gilmour.slatehall)
dat <- gilmour.slatehall
libs(desplot)
desplot(dat, yield ~ col * row,
aspect=22.5/40, num=gen, out1=rep, cex=1,
main="gilmour.slatehall")
if(require("asreml", quietly=TRUE)) {
libs(asreml,lucid)
# Model 4 of Gilmour et al 1997
dat <- transform(dat, xf=factor(col), yf=factor(row))
dat <- dat[order(dat$xf, dat$yf), ]
m4 <- asreml(yield ~ gen + lin(row), data=dat,
random = ~ dev(row) + dev(col),
resid = ~ ar1(xf):ar1(yf))
# coef(m4)$fixed[1] # linear row
# [1] 31.72252 # (sign switch due to row ordering)
lucid::vc(m4)
## effect component std.error z.ratio bound
## dev(col) 2519 1959 1.3 P 0
## dev(row) 20290 10260 2 P 0
## xf:yf(R) 23950 4616 5.2 P 0
## xf:yf!xf!cor 0.439 0.113 3.9 U 0
## xf:yf!yf!cor 0.125 0.117 1.1 U 0
plot(varioGram(m4), main="gilmour.slatehall")
}
}
Run the code above in your browser using DataLab