Learn R Programming

agridat (version 1.5)

besag.met: Multi-environment trial of corn laid out in incomplete-blocks

Description

Multi-environment trial of corn laid out in incomplete-blocks

Usage

data(besag.met)

Arguments

source

Julian Besag and D Higdon, 1999. Bayesian Analysis of Agricultural Field Experiments, Journal of the Royal Statistical Society: Series B (Statistical Methodology),61, 691--746. Table 1. Retrieved from http://web.archive.org/web/19990505223413/www.stat.duke.edu/~higdon/trials/nc.dat. Used with permission of David Higdon.

Details

Multi-environment trial of 64 corn hybrids in six counties in North Carolina. Each location had 3 replicates in in incomplete-block design.

Examples

Run this code
dat <- besag.met

desplot(yield ~ col*row|county, out1=rep, dat)

# Heteroskedastic variance model (separate variance for each variety)
# asreml takes 1 second, lme 73 seconds, SAS 30 minutes

# Average reps
datm <- aggregate(yield ~ county + gen, data=dat, FUN=mean)

# asreml Using 'rcov' ALWAYS requires sorting the data
require(asreml)
datm <- datm[order(datm$gen),]
m1a <- asreml(yield ~ gen, data=datm,
              random = ~ county,
              rcov = ~ at(gen):units,
              predict=asreml:::predict.asreml(classify="gen"))
summary(m1a)$varcomp

# lme
require(nlme)
m1l <- lme(yield ~ -1 + gen, data=datm, random=~1|county,
               weights = varIdent(form=~ 1|gen))
m1l$sigma^2 * c(1, coef(m1l$modelStruct$varStruct, unc = F))^2

# We get the same results from asreml & lme
plot(m1a$gammas[-1],
     m1l$sigma^2 * c(1, coef(m1l$modelStruct$varStruct, unc = F))^2)

Run the code above in your browser using DataLab