**
;
Notes: Data is input after
the cards
statement. ;
Sd is the pooled
standard deviation derived from
both ;
samples.
**;
*****;
data a;
input power alpha diff sd n;
cards;
−9 0.001 0.6 3.676 828
0.80 0.05 0.8 20.715 − 9
;
data a; set a;
pza=abs(probit
(alpha/2)); /
pza=significance level as
a /
/ z score i.e.
5%=1.96 /
if n=−9 then
do; / Find
n /
flag=1;
pz=probit
(power); /
pz=cumulative z value
for /
/ given
power /
function= (pz +
pza)2; / function=power
function /
n=ceil((function(sd2
))/(diff2)) ;
end;
else if power=−9 then
do; / Find
power /
flag=2;
function=(n(diff2))/
(sd**2);
Appendix 359