Learn R Programming

agridat (version 1.12)

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

Format

A data frame with 108 observations on the following 5 variables.

loc

Location factor, 3 levels

nitro

Nitrogen in kg/ha

rep

Rep factor, 3 levels

gen

Genotype factor, 2 levels

yield

Yield in kg/ha

Examples

Run this code
# NOT RUN {
data(gomez.multilocsplitplot)
dat <- gomez.multilocsplitplot
dat$nf <- factor(dat$nitro)

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

# AOV
# Be careful to use the right stratum, 'nf' appears in both strata.
# Still not quite the same as Gomez table 8.21
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
if(require(lme4)){
m2 <- lmer(yield ~ loc*nf*gen + (1|loc/rep/nf), dat)
anova(m2)
## Analysis of Variance Table
##            Df   Sum Sq  Mean Sq F value
## loc         2   117942    58971  0.1525
## nf          5 72841432 14568286 37.6777
## gen         1  7557570  7557570 19.5460
## loc:nf     10 10137188  1013719  2.6218
## loc:gen     2  4270469  2135235  5.5223
## nf:gen      5  1501767   300353  0.7768
## loc:nf:gen 10  1502273   150227  0.3885
}

# }

Run the code above in your browser using DataLab