Programming the statistical procedures from SAS

sample size for performance goal single proportion

Reply
Contributor
Posts: 30

sample size for performance goal single proportion

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;

Respected Advisor
Posts: 4,753

Re: sample size for performance goal single proportion

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
Contributor
Posts: 30

Re: sample size for performance goal single proportion

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

Respected Advisor
Posts: 4,753

Re: sample size for performance goal single proportion

I think so!

PG
Trusted Advisor
Posts: 1,115

Re: sample size for performance goal single proportion

@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;
Ask a Question
Discussion stats
  • 4 replies
  • 270 views
  • 0 likes
  • 3 in conversation