* drill.sas, drill advance experiment, Table 7.11 (page 225); options ls=72; ; DATA DRILL; INPUT A B C D ADV; Y=LOG10(ADV); * log to base 10; LINES; 1 1 1 1 1.68 1 1 1 2 2.07 1 1 2 1 4.98 1 1 2 2 7.77 1 2 1 1 3.28 1 2 1 2 4.09 1 2 2 1 9.97 1 2 2 2 11.75 2 1 1 1 1.98 2 1 1 2 2.44 2 1 2 1 5.70 2 1 2 2 9.43 2 2 1 1 3.44 2 2 1 2 4.53 2 2 2 1 9.07 2 2 2 2 16.30 ; * Calculate contrast coefficients for m contrasts and print them; DATA DRILL2; SET DRILL; A=2*A-3; B=2*B-3; C=2*C-3; D=2*D-3; AB=A*B; AC=A*C; AD=A*D; BC=B*C; BD=B*D; CD=C*D; ABC=AB*C; ABD=AB*D; ACD=AC*D; BCD=BC*D; ABCD=ABC*D; PROC PRINT; VAR Y A B C D AB AC AD BC BD CD ABC ABD ACD BCD ABCD; ; * calculate 2*sum(c_iy_i)/v which gives the contrast least * squares estimates with divisor v/2. Then print these; * change the 2 to square root of v for normalized contrasts; DATA DRILL3; SET DRILL2; A=2*A*Y; B=2*B*Y; C=2*C*Y; D=2*D*Y; AB=2*AB*Y; AC=2*AC*Y; AD=2*AD*Y; BC=2*BC*Y; BD=2*BD*Y; CD=2*CD*Y; ABC=2*ABC*Y; ABD=2*ABD*Y; ACD=2*ACD*Y; BCD=2*BCD*Y; ABCD=2*ABCD*Y; PROC MEANS NOPRINT; VAR A B C D AB AC AD BC BD CD ABC ABD ACD BCD ABCD; OUTPUT OUT=ESTIMATS MEAN=A B C D AB AC AD BC BD CD ABC ABD ACD BCD ABCD; PROC PRINT; * At this point the data set has m least squares estimates * Turn the data set so that these form 2+m observations on a * single variable. The first 2 are merely headings. Remove them; PROC TRANSPOSE PREFIX=EST OUT=ESTS; DATA ESTS; SET ESTS; IF _N_>2; ; * Calculate the normal scores corresponding to the contrast estimates; PROC RANK NORMAL=BLOM OUT=PLT; VAR EST1; RANKS NSCORE; PROC PRINT; * Plot the contrast estimates against the normal scores; PROC PLOT; PLOT EST1*NSCORE / VPOS=19 HPOS=50;