Learn R Programming

agridat (version 1.5)

cox.stripsplit: Strip-split plot of barley with fertilizer, calcium, and soil factors.

Description

Strip-split plot of barley with fertilizer, calcium, and soil factors.

Usage

data(cox.stripsplit)

Arguments

source

Comes from the notes of Gertrude Cox and A. Rotti.

Details

Four different fertilizer treatments are laid out in vertical strips, which are then split into subplots with different levels of calcium. Soil type is stripped across the split-plot experiment, and the entire experiment is then replicated three times.

References

http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_anova_sect030.htm

Examples

Run this code
dat <- cox.stripsplit

# Raw means
aggregate(yield ~ calcium, data=dat, mean)
aggregate(yield ~ soil, data=dat, mean)
aggregate(yield ~ calcium, data=dat, mean)

# AOV
m1 <- aov(yield~ fert*calcium*soil +
          Error(rep/(fert+soil+calcium:fert+soil:fert)),
          data=dat)
summary(m1)

# With balanced data, the following are all basically identical
require('lme4')
m2 <- lmer(yield ~ fert*soil*calcium + (1|rep) + (1|rep:fert) +
(1|rep:soil) + (1|rep:fert:calcium) + (1|rep:soil:fert), data=dat)

# afex uses Kenword-Rogers approach for denominator d.f.
require('afex')
mixed(yield ~ fert*soil*calcium + (1|rep) + (1|rep:fert) +
(1|rep:soil) + (1|rep:fert:calcium) + (1|rep:soil:fert), data=dat)

# MixMod uses Satterthwaite approximation for deg of freedom
require('MixMod') 
totalAnalysis(m2, data=dat)

Run the code above in your browser using DataLab