Learn R Programming

agridat (version 1.8.1)

kempton.rowcol: Wheat row-column experiment

Description

Wheat yields of 35 genotypes, 2 reps, planted in a row-column design. Two plots are missing.

Arguments

source

R A Kempton and P N Fox, Statistical Methods for Plant Variety Evaluation, Chapman and Hall, 1997.

Details

Included to illustrate REML analysis of a row-column design.

Examples

Run this code
dat <- kempton.rowcol

desplot(yield~col*row|rep, dat, num=gen, out1=rep,
        main="kempton.rowcol")

dat <- transform(dat, row=factor(row), col=factor(col))
# Model with rep, row, col as random.  Kempton, page 62.
# Use "-1" so that the vcov matrix doesn't include intercept
if(require(lme4)){
m1 <- lmer(yield ~ -1 + gen + rep + (1|rep:row) + (1|rep:col), data=dat)

# Variance components match Kempton.
print(m1, corr=FALSE)

# Standard error of difference for genotypes.  Kempton page 62, bottom.
covs <- as.matrix(vcov(m1)[1:35, 1:35])
vars <- diag(covs)
vdiff <- outer(vars, vars, "+") - 2 * covs
sed <- sqrt(vdiff[upper.tri(vdiff)])
min(sed) # Minimum SED
mean(sed) # Average SED
max(sed) # Maximum SED
}

Run the code above in your browser using DataLab