Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Re: sample size for performance goal single proportion

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 06-01-2016 07:01 PM
(3689 views)

SAS v9.4. Can I use proc power - onesamplefreq to calculate sample size for a single proportion performance goal hypothesis? I want to show success rate is at least 81%. I expect the sample to show 90% success and want sample size to ensure the lower limit of the one-sided 95% confidence interval is at least 81% (alpha=5%, power=80%). Help! Is this correct?

proc power ;

onesamplefreq

sides=1

alpha=0.05

nullproportion=0.81 /*Performance Goal-PG*/

proportion= 0.90 /*must be slightly higher then PG*/

ntotal= .

power= .8 ;

run;

4 REPLIES 4

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

In my version of SAS (9.4 TS l 1M1) only the normal approximation to the binomial distribution is available.

You must add options

**method=normal****test=adjz**

to get *ntotal*.

PG

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thank you very much! So the rest of the code is set up accurately for the study objective?

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

I think so!

PG

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@msecic: I think you should first decide which confidence interval you want to compute. Your code uses the default, which is the exact binomial test, corresponding to the exact Clopper-Pearson confidence interval.

If you want this, PROC POWER doesn't give you the option to calculate NTOTAL for a given power. I guess the reason is that the results could be easily misinterpreted: Due to discreteness effects, the power does not increase monotonically with sample size (the corresponding graph has a sawtooth shape).

But PROC POWER lets you calculate the power for a range of sample sizes:

```
ntotal= 90 to 120
power= .;
```

In the results you see that the power of 80% is achieved with n=99 and n=100, but then drops below 80% as n further increases up to n=104 (power 76.1%). Only after another rise and fall it finally crosses the 80% mark for n>=112.

If you know the formula for the lower confidence limit of your choice, it's not difficult to compute the power even without PROC POWER. Here's the code using the lower limit of the one-sided Clopper-Pearson CI (replicating the results of PROC POWER):

```
%let alpha=0.05;
%let p0=0.81;
%let p =0.90;
data want;
do n=90 to 120;
do k=0 to n;
if k>0 then pL=k/(k+(n-k+1)*quantile('F',1-&alpha,2*(n-k+1),2*k)); else pL=0;
if pL>=&p0 then leave;
end;
power=1-cdf('binom',k-1,&p,n);
output;
end;
keep n power;
run;
proc print data=want noobs;
format power 5.3;
run;
```

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. **Registration is now open through August 30th**. Visit the SAS Hackathon homepage.

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.