#R commands for ancova, data in Table 3.34 rm(list = ls()) # clear the memory starch = read.table("http://www.stat.ualberta.ca/~wiens/stat568/datasets/starch_table_3_34.dat", header = T, quote= "") type = as.factor(starch[,1]) strength = starch[,2] thick = starch[,3] fit1 = lm(strength ~ thick + type) summary(fit1) # thickness is very significant; types aren't # incorrect fit, ignoring the covariate: fitx = aov(strength ~ type) summary(fitx) # types now seem significant