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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 847 views
  • 0 likes
  • 3 in conversation