pdf("woolfrict.pdf") wf1 <- read.fwf("http://www.stat.ufl.edu/~winner/data/woolfrict1.dat", width=c(8,8,8,8), col.names=c("runnum", "trt", "revs", "shrink")) attach(wf1) trt <- factor(trt, levels=1:4, labels=c("Untreated", "AC15sec", "AC4min", "AC15min")) runnum <- factor(runnum, levels=1:4) revs <- factor(revs,levels=seq(200,1400,200),ordered=TRUE) # Fit full ANOVA with all terms, F-test for trt is inappropriate woolfrict.sp1 <- aov(shrink ~ trt + runnum + trt:runnum + revs + revs:trt) summary(woolfrict.sp1) # This model uses correct error terms for trt and revs and interaction woolfrict.sp2 <- aov(shrink ~ trt*revs + Error(runnum/trt)) summary(woolfrict.sp2) # Partitions the Revs SS into orthogonal polynomials summary(woolfrict.sp2,split=list(revs=list(linear=1, quadratic=2, cubic=3, quartic=4, quintic=5, sextic=6))) dev.off()