Statistical Procedures

Programming the statistical procedures from SAS
BookmarkSubscribeRSS Feed
Christina_fan
Calcite | Level 5

Is this program right or not?

proc power;

twosamplefreq test=pchi

oddsratio=0.35

refproportion=0.15

ntotal=250

power=.;

run;

 

3 REPLIES 3
ballardw
Super User

From the documentation for Proc Power in the Overview section:

Overview: POWER Procedure

Power and sample size analysis optimizes the resource usage and design of a study, improving chances of conclusive results with maximum efficiency. The POWER procedure performs prospective power and sample size analyses for a variety of goals, such as the following:

  • determining the sample size required to get a significant result with adequate probability (power)

  • characterizing the power of a study to detect a meaningful effect

  • conducting what-if analyses to assess sensitivity of the power or required sample size to other factors

Here prospective indicates that the analysis pertains to planning for a future study. This is in contrast to retrospective power analysis for a past study, which is not supported by the procedure.

Please note the highlighted text in magenta. So the answer to the "is this program correct" is "No".

 


@Christina_fan wrote:

Is this program right or not?

proc power;

twosamplefreq test=pchi

oddsratio=0.35

refproportion=0.15

ntotal=250

power=.;

run;

 


 

 

 

Christina_fan
Calcite | Level 5

Thank you so much for your explanation. So could you please tell me how to write the commands for the post hoc power analysis?

SteveDenham
Jade | Level 19

I am not quite sure I understand the question.  By "post hoc power", do you mean that you have run an analysis and now wish to calculate the power of that analysis?  The power in that case is either 0 or 1, depending on what cutoff is applied to your resultant p value - you either did not find a significant difference or you did find one.  With a sample of 1 (=number of analyses), the only possible values are 0 or 1.

 

However, a bootstrap approach may give you what you want.  Generate 5000 (or some other fairly large number) potential outcomes based on the results you currently have by sampling with replacement.  Then repeat the analysis for each of those potential outcomes, saving the p value of interest.  The proportion of samples which yield greater p values is a fairly good estimate of beta, so the power would be 1 - beta.

 

SteveDenham

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1225 views
  • 0 likes
  • 3 in conversation