" 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, 20/08/2014 "
" Set working directory - change to location of your data file "
\set [workingdirectory='d:/stats4biol/data/']
" Read data from working directory "
FILEREAD [NAME='GRAINS.DAT'; IMETHOD=READ] FGROUPS=no,yes,no
" Reorder levels of factor Treatment so that Control is the 5th level "
FACAMEND FACTOR=Treatment; NEWLEVELS=!(1,2,3,5,4)
" One-way ANOVA, and save simple residuals "
TREATMENTSTRUCTURE Treatment
ANOVA [FPROBABILITY=yes; PSE=differences,lsd] Y=Grains; RESIDUALS=SimpleRes
" Save standardized residuals "
AKEEP [RMETHOD=standardized; RESIDUALS=StdRes]
" Print both sets of residuals with data "
PRINT DEar,Treatment,Grains,SimpleRes,StdRes; DECIMALS=3(0),2(*)
" Plot simple residuals against standardized residuals "
DGRAPH Y=SimpleRes; X=StdRes
" Histogram of distribution of standardized residuals "
DHISTOGRAM [NGROUPS=8] StdRes
"End of File"