options linesize=80; filename paintdat 'H:/HAL/Courses/Stat210/rndmblockdata.txt'; data paint; infile paintdat firstobs=2; input score block treat; ** **; ** plot score vs treatment (with block identified for each observation) **; proc gplot; symbol1 c=black i=join f=greek v=1; symbol2 c=black i=join f=greek v=2; symbol3 c=black i=join f=greek v=3; symbol4 c=black i=join f=greek v=4; symbol5 c=black i=join f=greek v=5; symbol6 c=black i=join f=greek v=6; symbol7 c=black i=join f=greek v=7; symbol8 c=black i=join f=greek v=8; axis1 order=0 to 60 by 5; plot score*treat=block ; ** **; ** fit anova model with multiple contrasts, save output **; proc glm order=data; class block treat; model score = block treat; means treat / bon tukey; contrast 'color' treat -2 3 -2 3 -2; contrast 'yell' treat 0 1 0 -1 0; contrast 'white1' treat 2 0 -1 0 -1; contrast 'newwht' treat 0 0 1 0 -1; output out=resids p=yhat r=resid; ** **; ** create normal scores for residuals **; proc rank normal=blom out=residnrm data=resids; var resid; ranks residnrm; ** **; ** residual plots for randomized block analysis **; proc gplot data=residnrm; symbol i=none; plot resid*residnrm resid*treat resid*block; run;