# NOT RUN {
data(kempton.slatehall)
dat <- kempton.slatehall
# Besag 1993 figure 4.1 (left panel)
if(require(desplot)){
grays <- colorRampPalette(c("#d9d9d9","#252525"))
desplot(yield ~ col * row, dat,
aspect=40/22.5, # true aspect
num=gen, out1=rep, col.regions=grays, # unknown aspect
main="kempton.slatehall - spring wheat yields")
}
# ----------------------------------------------------------------------------
# }
# NOT RUN {
# Incomplete block model of Gilmour et al 1995
require(lme4)
require(lucid)
dat <- transform(dat, xf=factor(col), yf=factor(row))
m1 <- lmer(yield ~ gen + (1|rep) + (1|rep:yf) + (1|rep:xf), data=dat)
vc(m1)
## groups name variance stddev
## rep:xf (Intercept) 14810 121.7
## rep:yf (Intercept) 15600 124.9
## rep (Intercept) 4262 65.29
## Residual 8062 89.79
# }
# NOT RUN {
# ----------------------------------------------------------------------------
# }
# NOT RUN {
# Incomplete block model of Gilmour et al 1995
# asreml3
require(asreml)
m2 <- asreml(yield ~ gen, random = ~ rep/(xf+yf), data=dat)
vc(m2)
## effect component std.error z.ratio constr
## rep!rep.var 4262 6890 0.62 pos
## rep:xf!rep.var 14810 4865 3 pos
## rep:yf!rep.var 15600 5091 3.1 pos
## R!variance 8062 1340 6 pos
# Table 4
predict(m2, data=dat, classify="gen")$predictions$pvals
# }
# NOT RUN {
# ----------------------------------------------------------------------------
# }
# NOT RUN {
# Incomplete block model of Gilmour et al 1995
## require(asreml4)
## require(lucid)
## m2 <- asreml(yield ~ gen, random = ~ rep/(xf+yf), data=dat)
## vc(m2)
## ## effect component std.error z.ratio bound <!-- %ch -->
## ## rep 4262 6890 0.62 P 0
## ## rep:yf 15600 5091 3.1 P 0
## ## rep:xf 14810 4865 3 P 0
## ## units(R) 8062 1340 6 P 0
## # Table 4
## predict(m2, data=dat, classify="gen")$pvals
## ## gen predicted.value std.error status
## ## 1 G01 1280 60.2 Estimable
## ## 2 G02 1550 60.2 Estimable
## ## 3 G03 1420 60.2 Estimable
## ## 4 G04 1450 60.2 Estimable
## ## 5 G05 1530 60.2 Estimable
# }
# NOT RUN {
# ----------------------------------------------------------------------------
# }
Run the code above in your browser using DataLab