/* Exercise 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 */ ods graphics on; * Read data - change directory to location of your data file; data GRAINS; infile 'C:\stats4biol\data\GRAINS.DAT' firstobs=2 expandtabs; input DEar Treatment $ Grains; run; proc print data=GRAINS;run; * One-way ANOVA and save simple (SimpleRes) and standardized (StdRes) residuals; proc glm data=Grains; class Treatment; model Grains = Treatment; output out=RESID r=SimpleRes student=StdRes; run; * Print both sets of residuals with data; proc print data=RESID;run; * Plot simple residuals against standardized residuals; proc gplot data=RESID; plot SimpleRes*StdRes=Treatment / vaxis=axis1 haxis=axis2; run;