" Exercise 12.6
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 V. Buchanan-Wollaston (PRESTA), University of Warwick
Version 1, 15/08/2015 "
" Set working directory - change to location of your data file "
\SET [WORKINGDIRECTORY='d:/stats4biol/data/']
" Read data from working directory "
FILEREAD [NAME='SENESCENCE.DAT'; IMETHOD=read] FGROUPS=2(no),yes,3(no)
" Plot data "
DGRAPH Y=CATMA3A13560; X=Day
" Fit SLR "
MODEL Y=CATMA3A13560
FIT [FPROBABILITY=yes; TPROBABILITY=yes] Day
" Save fitted values and standardized residuals from SLR model "
RKEEP FITTEDVALUES=fitSLR; RESIDUALS=res
" Residual plots based on standardized residuals "
DRESIDUALS [RESIDUALS=res; FITTEDVALUES=fval] METHOD=fittedvalues,normal,histogram,absresidual
" Plot fitted model "
RGRAPH
" Create grouping factor for Day "
GROUPS VECTOR=Day; FACTOR=fDay
" Fit SLR plus lack-of-fit term "
MODEL Y=CATMA3A13560
FIT [PRINT=#,accumulated; FPROBABILITY=yes; TPROBABILITY=yes] Day+fDay
" Save fitted values from SLR model with LOF "
RKEEP FITTEDVALUES=fitLOF
" Compare fitted values from the two models graphically "
PEN NUMBER=2,3; METHOD=line,point; SYMBOLS=0,2; LINESTYLE=1,0; COLOUR='red','orange'; \
CFILL=*,'orange'
DGRAPH Y=CATMA3A13560,fitSLR,fitLOF; X=Day; PEN=1...3
" End of File "