- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Is this program right or not?
proc power;
twosamplefreq test=pchi
oddsratio=0.35
refproportion=0.15
ntotal=250
power=.;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much for your explanation. So could you please tell me how to write the commands for the post hoc power analysis?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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