" Exercise 18.9 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 S. Foster, Rothamsted Research Version 1, 30/08/2015 " " Set working directory - change to location of your data file " \SET [WORKINGDIRECTORY='d:/stats4biol/data/'] " Read data from working directory " FILEREAD [NAME='CLONE.DAT'; IMETHOD=read] FGROUPS=no,2(yes),3(no) " Plot the data " CALCULATE Propn=Moving/Total TRELLIS [GROUPS=Clone; PENGROUP=Marker] Y=Propn; X=LogDose " Proportion data: use binomial distribution with logit link " " Fit full model allowing different slopes for log dose for each treatment group " " Check summary for indication of over-dispersion" MODEL [DISTRIBUTION=binomial] Y=Moving; NBINOMIAL=Total FIT [PRINT=model,summary; FPROBABILITY=yes] LogDose*Clone*Marker " Save residual deviance and df " RKEEP DEVIANCE=ResDev; DF=ResDF " Test for over-dispersion " PRINT STRUCTURE=CUCHI(ResDev;ResDF); DECIMALS=4 " Re-fit full model allowing for over-dispersion " MODEL [DISTRIBUTION=binomial; DISPERSION=*] Y=Moving; NBINOMIAL=Total FITINDIVIDUALLY [PRINT=#,accumulated; FPROBABILITY=yes; TPROBABILITY=yes] LogDose*Clone*Marker " Check residuals: residual plots based on standardized deviance residuals " RKEEP RESIDUALS=res; FITTEDVALUES=fval DRESIDUALS [RESIDUALS=res; FITTEDVALUES=fval] METHOD=fittedvalues,normal,histogram,absresidual " Backwards selection - refitting residual term each time a term is dropped " " Omit different slopes for Clone.Marker combinations " FITINDIV [PRINT=accumulated; FPROBABILITY=yes] LogDose*Clone*Marker - LogDose.Clone.Marker " Test terms with 2 components " TRY [PRINT=accumulated; FPROBABILITY=yes] LogDose.Clone TRY [PRINT=accumulated; FPROBABILITY=yes] LogDose.Marker TRY [PRINT=accumulated; FPROBABILITY=yes] Clone.Marker " Drop LogDose.Clone - separate slopes for clones " FITINDIV [PRINT=accumulated; FPROBABILITY=yes] LogDose*Marker + Clone/Marker " Test remaining 2-component terms " TRY [PRINT=accumulated; FPROBABILITY=yes] LogDose.Marker TRY [PRINT=accumulated; FPROBABILITY=yes] Clone.Marker " Drop Logdose.Marker " FITINDIV [PRINT=accumulated; FPROBABILITY=yes] Clone*Marker + LogDose " Test LogDose and Clone.Marker " TRY [PRINT=accumulated; FPROBABILITY=yes] LogDose TRY [PRINT=accumulated; FPROBABILITY=yes] Clone.Marker " Drop Clone.Marker " FITINDIV [PRINT=accumulated; FPROBABILITY=yes] Clone + Marker + LogDose " Test single-component terms " TRY [PRINT=accumulated; FPROBABILITY=yes] LogDose TRY [PRINT=accumulated; FPROBABILITY=yes] Clone TRY [PRINT=accumulated; FPROBABILITY=yes] Marker " Drop Marker " FITINDIV [PRINT=accumulated; FPROBABILITY=yes] Clone + LogDose " Test remaining terms " TRY [PRINT=accumulated; FPROBABILITY=yes] LogDose TRY [PRINT=accumulated; FPROBABILITY=yes] Clone " Cannot simplify further " " Fit final predictive model " MODEL [DISTRIBUTION=binomial; DISPERSION=*] Y=Moving; NBINOMIAL=Total FITINDIVIDUALLY [PRINT=#,accumulated; FPROBABILITY=yes; TPROBABILITY=yes] Clone+LogDose " Residual plots based on standardized deviance residuals " RKEEP RESIDUALS=res; FITTEDVALUES=fval DRESIDUALS [RESIDUALS=res; FITTEDVALUES=fval] METHOD=fittedvalues,normal,histogram,absresidual " Plot fitted model on linear predictor scale " RGRAPH [BACKTRANSFORM=none] " Plot fitted model on natural scale " RGRAPH " End of File "