coils=read.csv("https://webpages.uidaho.edu/~renaes/Data/coils.csv",header=T) View(coils) boxplot(selfind~temp,data=coils) boxplot(selfind~coil,data=coils) # temp and coils are numeric so we have to tell R that they are factors # or we get the wrong results (check df for treatment and block to see # dftrt = t-1 and dfblock = b-1 # without using factor() for the factors # results are incorrect fail=aov(selfind~temp+coil,data=coils) summary(fail) # this is THE good analysis :-) fit=aov(selfind~factor(temp)+factor(coil),data=coils) summary(fit) # analysis without block noblock=aov(selfind~factor(temp),data=coils) summary(noblock) trt.means=tapply(coils$selfind,coils$temp,mean,na.rm=T) blk.means=tapply(coils$selfind,coils$coil,mean,na.rm=T) res=rstudent(fit) yhat=fitted(fit) hist(res,main='Residuals') # with so few data points, a boxplot might be better boxplot(res,main='Residuals') plot(yhat,res,main='Predicted vs. Residuals') abline(0,0) qqnorm(res,xlim=c(-3,3),ylim=c(-3,3)); qqline(res)