# # Exercise 5.2a - continues on from Exercise 4.2 & 5.1a # # Statistical Methods in Biology: Design and Analysis of Experiments and Regression # by S.J. Welham, S.A. Gezan, S.J. Clark & A. Mead (2014) # Chapman & Hall/CRC Press, Boca Raton, Florida. ISBN: 978-1-4398-0878-8 # Data from K. Hammond-Kosack, Rothamsted Research # Version 1, 26/09/2014 # Set working directory - use setwd() function or from Session menu in RStudio # e.g. setwd("d:/stats4biol/data) # Read data grains <- read.table("grains.dat",sep="",header=T) summary(grains) # One-way ANOVA grains.aov <- aov(Grains~Treatment, data=grains) summary(grains.aov) # default set of residual plots plot(grains.aov, ask=FALSE) # add histogram of standardized residuals std.res <- rstandard(grains.aov) hist(std.res) # End of file