# From Walpole, Myers, Myers, Ye, 9th ed., Table 13.9 # Is time for the assembling of a particular product different among # four machines (treatments)? Six operators (blocks). time <- c(42.5, 39.3, 39.6, 39.9, 42.9, 43.6, 39.8, 40.1, 40.5, 42.3, 42.5, 43.1, 40.2, 40.5, 41.3, 43.4, 44.9, 45.1, 41.3, 42.2, 43.5, 44.2, 45.9, 42.3) operator <- factor(rep(1:6, 4)) machine <- factor(rep(1:4, each=6)) fit1 <- aov(time~machine) summary(fit1) resid1=residuals(fit1) qqnorm(resid1) qqline(resid1) # doesn't look normally distributed library(nortest) ad.test(resid1) # Anderson-Darling test of normality fit2 <- aov(time~machine+operator) summary(fit2) resid2=residuals(fit2) qqnorm(resid2) qqline(resid2) # better ad.test(resid2)