Wednesday, August 4, 2010

PROC Power in SAS

Most of us use PASS for sample size calculations, but because PASS is menu-driven, calculations cannot be reproduced without typing in all the parameters from scratch. PROC POWER in SAS is now available and can do many sample size calculations that we commonly use PASS for.  There is also a menu-driven GUI similar to PASS that creates SAS code for later use (just go to Start->Programs->SAS-> SAS Power and Sample Size).

Here is a code snippet for a two-sample t-test and a paired t-test. 

proc power;
   TwoSampleMeans test=diff_satt
      Alpha = 0.05
      Sides = 2
      GroupMeans = (73 -85)    (30 -30)
      GroupStdDevs = (58 70.5) (55.8 68.3) (53.4 66)
      Power = 0.8 0.9
      NPerGroup = .
   ;
run;

proc power;
   PairedMeans test = diff
      Alpha = 0.05
      Sides = 2
      PairedMeans = (161.6 106)
      PairedStdDevs = (10.6 73)
      Corr = 0.1 0.3 0.5 0.7
      Power = 0.8 0.9
      NPairs = .
   ;
run;

MK

No comments:

Post a Comment

Subscribe via email

Enter your email address:

Delivered by FeedBurner

Followers

google analytics