" Exercise 8.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 R. Curtis, Rothamsted Research/Bionemax
Version 1, 25/08/2014 "
" Set working directory - change to location of your data file "
\SET [WORKINGDIRECTORY='d:/stats4biol/data/']
" Read data from working directory "
FILEREAD [NAME='NEMATODES.DAT'; IMETHOD=read] FGROUPS=no,yes,no
" Check replication and factor order "
TABULATE [PRINT=count; CLASS=Treatment]
" Plot data "
XAXIS WINDOW=1; MARKS=!(1,2,3); LABELS=!T(CONA,GNA,PBS)
DGRAPH Y=Distance; X=Treatment
" ANOVA "
BLOCKSTRUCTURE
TREATMENTSTRUCTURE Treatment
ANOVA [FPROBABILITY=yes; PSE=means,differences,lsd] Y=Distance
" Residual plots based on standardized residuals "
APLOT [RMETHOD=standardized] METHOD=fittedvalues,normal,histogram,absresidual
" Create matrix to define two contrasts for the three levels of Treatment factor "
MATRIX [ROWS=!T('Lectins vs PBS','CONA vs GNA'); COLUMNS=!T(CONA,GNA,PBS)] Contrasts
" a: PBS (level 3) vs CONA & GNA (levels 1 & 2) "
CALC Contrasts$[1;1,2,3] = 0.5,0.5,-1
" b: CONA (level 1) vs GNA (level 2) "
CALC Contrasts$[2;1,2,3] = 1,-1,0
" Check matrix "
PRINT Contrasts
" ANOVA with specified contrasts (standardized and orthogonalized) "
BLOCKSTRUCTURE
TREATMENTSTRUCTURE REG(Treatment; 2; Contrasts)
ANOVA [FPROBABILITY=yes; PSE=means,differences,lsd] Y=Distance
" Print standardized contrasts "
ADISPLAY [PRINT=contrasts]
" ANOVA with specified contrasts (not standardized) "
BLOCKSTRUCTURE
TREATMENTSTRUCTURE COMP(Treatment; 2; Contrasts)
ANOVA [FPROBABILITY=yes; PSE=means,differences,lsd] Y=Distance
" Print contrasts "
ADISPLAY [PRINT=contrasts]
" End of File "