# Data from a split plot experiment with completely randomized whole plot structure # from Roger Kirk 'Experimental Design: Procedures for the Behavioral Sciences' 3rd edition page 516 # Each observation has the block, factor a level, factor b level, then response listed data <- matrix(scan(),ncol=4,byrow=TRUE) 1 1 1 3 1 1 2 4 1 1 3 7 1 1 4 7 2 1 1 6 2 1 2 5 2 1 3 8 2 1 4 8 3 1 1 3 3 1 2 4 3 1 3 7 3 1 4 9 4 1 1 3 4 1 2 3 4 1 3 6 4 1 4 8 5 2 1 1 5 2 2 2 5 2 3 5 5 2 4 10 6 2 1 2 6 2 2 3 6 2 3 6 6 2 4 10 7 2 1 2 7 2 2 4 7 2 3 5 7 2 4 9 8 2 1 2 8 2 2 3 8 2 3 6 8 2 4 11 data KirkCh12SPF <- data.frame(data) colnames(KirkCh12SPF) <- c("block","a","b","y") KirkCh12SPF$block <- as.factor(KirkCh12SPF$block) KirkCh12SPF$a <- as.factor(KirkCh12SPF$a) KirkCh12SPF$b <- as.factor(KirkCh12SPF$b) rm(data) library(nlme) SPFKirk12SPF <- lme( y ~ a*b, data = KirkCh12SPF, random = ~ 1 | block) summary(SPFKirk12SPF) anova(SPFKirk12SPF)