Learn R Programming

agridat (version 1.12)

brandle.rape: Three-way table of rape seed yields

Description

Rape seed yields for 5 genotypes, 3 years, 9 locations.

Arguments

Format

A data frame with 135 observations on the following 4 variables.

gen

genotype factor, 5 levels

year

year, numeric

loc

loc factor, 9 levels

yield

yield, kg/ha

Details

The yields are the mean of 4 reps.

Note, in table 2 of Brandle, the value of Triton in 1985 at Bagot is shown as 2355, but should be 2555 to match the means reported in the paper.

Examples

Run this code
# NOT RUN {
data(brandle.rape)
dat <- brandle.rape

require(lattice)
dotplot(gen~yield|loc, dat, group=year, auto.key=TRUE,
        main="brandle.rape, yields per location", ylab="Genotype")

# Matches table 4 of Brandle
round(tapply(dat$yield, dat$gen, mean),0)

# Brandle reports variance components:
# sigma^2_gl: 9369  gy: 14027 g: 72632 resid: 150000
# Brandle analyzed rep-level data, so the residual variance is different.
# The other components are matched by the following analysis.

if(require(lme4) & require(lucid)){
  dat$year <- factor(dat$year)
  m1 <- lmer(yield ~ year + loc + year:loc + (1|gen) +
               (1|gen:loc) + (1|gen:year), data=dat)
  vc(m1)
##      grp        var1 var2  vcov  sdcor
##  gen:loc (Intercept) <NA>  9363  96.76
## gen:year (Intercept) <NA> 14030 118.4
##      gen (Intercept) <NA> 72630 269.5
## Residual        <NA> <NA> 75010 273.9

}

# }

Run the code above in your browser using DataLab