*If using Minitab to generate the contour plot, remove the *'s from in front of the FILE and PUT statements, and remove the OUTPUT statement; data power; *file 'e:\stat 706\power.txt'; alpha=.05; a=5; ndf=a-1; do s02=1 to 5; do n=2 to 15; deltasq=n*s02; ddf=a*(n-1); fcrit=finv(1-alpha,ndf,ddf); power=1-probf(fcrit,ndf,ddf,deltasq); output; * put n s02 power; end; end; run; proc print data=power; run; *Use this statement if not generating the contour plots in Minitab; legend1 position=(right middle) label=(position=top) across=1; axis1 order=(0 to 15 by 5) minor=(number=4); proc gcontour data=power; label n="Sample size" s02="Scaling Factor" power="Power"; plot n*s02=power/levels=(.75 .8 .85 .9 .95) vaxis=axis1 legend=legend1; run; *Power code for a contrast. The coefficients will be c_1=1, c_2=-1, c_3=c_4=c_5=0; data cpower; *file 'e:\stat 706\cpower.txt'; alpha=.05; a=5; *This is a 1 df contrast, so the numerator has only 1 df; ndf=1; *Assume sigma-squared is 3 and save the sum of squared contrast coefficients; sigsq=3; sumcsqr=2; do L=1 to 5; do n=2 to 15; *The noncentrality parameter no longer has the cryptic s02 term; deltasq=(n*L**2)/(sigsq*sumcsqr); ddf=a*(n-1); fcrit=finv(1-alpha,ndf,ddf); power=1-probf(fcrit,ndf,ddf,deltasq); output; * put n L power; end; end; run; *Examination of this plot shows that L=1 cannot be readily detected given the ; *range of sample sizes provided; proc gcontour data=cpower; label n="Sample size" L="Alternative Contrast" power="Power"; plot n*L=power/levels=(.75 .8 .85 .9 .95) vaxis=axis1 legend=legend1; run;