You are on page 1of 1

data power1;

c=1;
/* control:case ratio is set to 1 */
p0=.20;
/* proportion of exposure among controls=.20 */
do n=100 to 400 by 100;
/* range of sample size */
do or=1.0 to 3.0 by 0.5;
/* range of odds ratio */
q0=1-p0;
p1=(p0*or)/(1+p0*(or-1));
q1=1-p1;
pbar=(p1+c*p0)/(1+c);
qbar=1-pbar;
zbeta=(sqrt(n*(p1-p0)**2)-1.96*sqrt((1+1/c)*pbar*qbar))/sqrt((p1*q1)+p0*q0/c);
power=probnorm(zbeta);
put power;
output;
end;
end;

You might also like