*options nodate ps =65 ls=65; *The following program uses proc iml to test contrasts for designs with between-subjects factors, within-subjects factors, or both. Cell pairwise comparisons for the between-subjects factor are illustrated. The boldface code would be the same in other programs; proc iml; /* set up a 1xG vector of cell frequencies*/ N={6 6 6}; /* set up the Gxp mean matrix*/ barX ={2.516667 3.2333333 4.15500000, 7.666667 6.7500000 4.65000000, 9.400000 5.7166667 5.4333333}; /* set up the pxp pooled dispersion matrix*/ Sp={3.920111111 3.205777778 3.787000000, 3.205777778 4.258444444 2.627444444, 3.787000000 2.627444444 5.272222222}; G=ncol(N); TN=0; do i=1 to G; TN=TN+N[1,i]; end; N=diag(N); print N, barX, Sp, G, TN; START contrast; df=TN-G; c=cprime`; t=(c`*barX*a)/sqrt(((a`*Sp*a)*(c`*(inv(N))*c))); tt=abs(t); prt=2*(1-probt(tt,df)); aprime=a`; print cprime, aprime; print df t prt; FINISH; Print 'The following compares method a and b for fill defects' ; cprime = {1 -1 0}; a= {1, 0, 0}; run contrast; Print 'The following compares method a and c for fill defects'; cprime = {1 0 -1}; a= {1, 0, 0}; run contrast; Print 'The following compares method b and c for fill defects'; cprime = {0 1 -1}; a= {1, 0, 0}; run contrast; Print 'The following compares method a and b for gap defects' ; cprime = {1 -1 0}; a= {0, 1, 0}; run contrast; Print 'The following compares method a and c for gap defects'; cprime = {1 0 -1}; a= {0, 1, 0}; run contrast; Print 'The following compares method b and c for gap defects'; cprime = {0 1 -1}; a= {0, 1, 0}; run contrast; Print 'The following compares method a and b for short defects' ; cprime = {1 -1 0}; a= {0, 0, 1}; run contrast; Print 'The following compares method a and c for short defects'; cprime = {1 0 -1}; a= {0, 0, 1}; run contrast; Print 'The following compares method b and c for short defects'; cprime = {0 1 -1}; a= {0, 0, 1}; run contrast; quit;