Learn R Programming

agridat (version 1.8.1)

gomez.multilocsplitplot: Rice multilocation Split-Plot

Description

Grain yield was measured at 3 locations with 3 reps per location. Within each rep, the main plot was 6 nitrogen fertilizer treatments and the sub plot was 2 rice varieties.

Arguments

source

Gomez, K.A. and Gomez, A.A.. 1984, Statistical Procedures for Agricultural Research. Wiley-Interscience. Page 339. Used with permission of Kwanchai Gomez.

Examples

Run this code
dat <- gomez.multilocsplitplot

# Gomez figure 8.3
xyplot(yield~nitro, dat, group=loc, type=c('p','smooth'), auto.key=TRUE)

# AOV
# Be careful to use the right stratum, 'nf' appears in both strata.
# Still not quite the same as Gomez table 8.21
dat$nf <- factor(dat$nitro)
t1 <- terms(yield ~ loc * nf * gen + Error(loc:rep:nf),
            "Error", keep.order=TRUE)
m1 <- aov(t1, data=dat)
summary(m1)

# F values are somewhat similar to Gomez Table 8.21
require(lme4)
m2 <- lmer(yield ~ loc*nf*gen + (1|loc/rep/nf), dat)
anova(m2)

Run the code above in your browser using DataLab