Section 1: A Summary of ODS, TABULATE, and GPLOT statements to produce summary tables and graphs from power results This section introduces you to the basic steps needed to produce tables or plots with the power calculations from PROC POWER or PROC GLMPOWER. It assumes you are already familiar with the basics of PROC TABULATE (Chapter 8), the Output Delivery System (Chapter 11), and PROC GPLOT (Chapter 12). You can read the fundamentals of each procedure in these chapters. * Identify the output table which contains the power calculations and enter a SAS dataset name to store them; ODS OUTPUT OUTPUT=_pwr ; NOTE: you may limit the variables in the output dataset by adding DROP= or KEEP= option and variable names as follows: ODS OUTPUT OUTPUT=_pwr(DROP=Analysis error index nulldiff Weight1 Weight2); * the ODS EXCLUDE statement prevents the calculations from appearing in the output window; ODS EXCLUDE OUTPUT; < Enter the desired PROC POWER or PROC GLMPOWER step > * PROC CONTENTS will assist you to identify what is contained in the output dataset; PROC CONTENTS DATA=_pwr short ; run; * a very short summary of the dataset names is produced with "short" ; PROC CONTENTS DATA=_pwr short; run; * modify power calculations or select observations to plot, as needed; DATA _pwr; SET _pwr; n_per_group = ntotal/2; * compute total in each group for two sample t-test; IF info eq ' '; * output only records with no footnotes attached; run; * print the first 10 records; PROC PRINT DATA=_pwr(OBS=10) NOobs; run; * make a table of results (e.g., the two-sample t-test); PROC TABULATE DATA=_pwr NOseps; CLASS Alpha MeanDiff n Sides ; VAR Power pwr; TABLE n, sides*alpha="Alpha: Type I Error"* meandiff='Difference in means'*pwr=' '*sum=' '*f=3.0 / rts=12 Box='Power of T-test for HO: muA=muB'; RUN; * make plot of power calculations for two values of alpha (entered in optional choices when computing power); * add a horizontal line to help you find sample size for power=.8 and power=.9; GOPTIONS reset=all cback=white; SYMBOL1 i=join value=none color=blue line=1; SYMBOL2 i=join value=none color=red line=1; PROC GPLOT DATA=_pwr; PLOT pwr * n =alpha / NOframe vref=(.8 .9) lvref=33 vaxis= 0 to 1 by .1 vm=1 haxis= 0 to 100 by 10 hm=1 ; FORMAT pwr 5.2; RUN; QUIT;