" Exercise 8.4 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 P. Lutman, Rothamsted Research Version 1, 26/06/2015 " " Set working directory - change to location of your data file " \SET [WORKINGDIRECTORY='d:/stats4biol/data/'] " Read data from working directory " FILEREAD [NAME='WEEDCOMPETITION.DAT'; IMETHOD=read] FGROUPS=no,3(yes),no,no " Plot data, by species and labelled by species " DGRAPH Y=Yield; X=Density; PEN=Weed " Investigate density levels per species " RESTRICT Density; Weed.in.'BG' PRINT SORT(UNIQUE(Density)) RESTRICT Density; Weed.in.'CL' PRINT SORT(UNIQUE(Density)) RESTRICT Density; Weed.in.'CW' PRINT SORT(UNIQUE(Density)) RESTRICT Density "Remove restriction" " Create density levels 1-6 for each weed species separately (1=control) plus category for other species" FACTOR [LEVELS=7; LABELS=!T('Control','19.9','28.8','57.7','92.8','183.0','not BG')] BG CALC BG = (Weed.in.'BG')*(position(Density;!(0,19.9,28.8,57.7,92.8,183.0))) + (Weed.ni.'BG')*7 FACTOR [LEVELS=7; LABELS=!T('Control','2.1','3.8','4.1','9.6','24.9','not CL')] CL CALC CL = (Weed.in.'CL')*(position(Density;!(0,2.1,3.8,4.1,9.6,24.9))) + (Weed.ni.'CL')*7 FACTOR [LEVELS=7; LABELS=!T('Control','3.8','10.9','29.8','90.3','130.0','not CW')] CW CALC CW = (Weed.in.'CW')*(position(Density;!(0,3.8,10.9,29.8,90.3,130.0))) + (Weed.ni.'CW')*7 " Create combined factor of density levels " FACTOR [LEVELS=6; LABELS=!T('Control','Density 1','Density 2','Density 3','Density 4','Density 5')] fDensity CALC fDensity = (Weed.in.'BG')*BG + (Weed.in.'CL')*CL + (Weed.in.'CW')*CW " Check factor allocation " TABULATE [PRINT=count; CLASS=Weed,fDensity] " Multi-stratum ANOVA with nested structure " BLOCKSTRUCTURE Block/Plot TREATMENTSTRUCTURE Weed/fDensity ANOVA [FPROBABILITY=yes; PSE=diff,lsd] Y=Yield " Residual plots based on standardized residuals " APLOT [RMETHOD=standardized] METHOD=fittedvalues,normal,histogram,absresidual " Plot treatment means " AGRAPH [PSE=LSD] X=fDensity; GROUPS=Weed " Separate out nested comparisons for each species " BLOCKSTRUCTURE Block/Plot TREATMENTSTRUCTURE Weed/(BG+CL+CW) ANOVA [FPROBABILITY=yes; PSE=means,differences,lsd] Y=Yield " Use Dunnett's test to find differences from control within each set " AMDUNNETT Weed,BG; CONTROL='BG','Control' AMDUNNETT Weed,CW; CONTROL='CW','Control' " End of file "