# the example from section 6.7 data <- scan(what = list(a=0,b=0,y=0), multi.line=F) 1 1 2.1 1 2 6.8 1 3 8.4 1 4 1.4 1 5 14.6 1 6 7.9 1 7 4.8 2 1 1.7 2 2 8.1 2 3 8.4 2 4 1.4 2 5 12.0 2 6 3.7 2 7 4.5 3 1 14.4 3 2 14.8 3 3 27.0 3 4 30.9 3 5 36.5 3 6 36.4 3 7 31.4 4 1 57.4 4 2 62.4 4 3 37.4 4 4 63.3 4 5 65.5 4 6 65.6 4 7 59.8 5 1 66.2 5 2 81.7 5 3 53.3 5 4 80.7 5 5 79.7 5 6 80.8 5 7 82.4 6 1 75.2 6 2 94.0 6 3 74.3 6 4 87.9 6 5 93.3 6 6 87.8 6 7 80.5 7 1 4.1 7 2 10.2 7 3 10.7 7 4 5.5 7 5 18.1 7 6 11.4 7 7 6.1 data table617 <- data.frame(data) rm(data) table617$a <- as.factor(table617$a) table617$b <- as.factor(table617$b) table617.fit <- lm(y ~ a +b +a:b, data=table617) anova(table617.fit) install.packages("additivityTests") library(additivityTests) # apparently the functions in the additivityTests package require # input in the form of a matrix table617mat <- matrix(table617$y, nrow=7, ncol=7, byrow=T) tukey.test(table617mat,alpha=.05) # their test statistic is a bit different than in the text