data _null_;
/* set up the width of the desired confidence interval */
ci_alph = .95;
obs_a1 = .96;
obs_a2 = .95;
k1 = 24;
k2 = k1;
n1 = 286;
n2 = 250;
if (obs_a1 > obs_a2) then do;
/* necessary to reverse everything */
tmp = obs_a1;
obs_a1 = obs_a2;
obs_a2 = tmp;
tmp = k1;
k1 = k2;
k2 = tmp;
tmp = n1;
n1 = n2;
n2 = tmp;
tmp = 1;
end;
else tmp = 0;
w = (1 - obs_a2)/(1 - obs_a1);
ci = 100*ci_alph;
format ci 2.;
df1 = n1 - 1;
df2 = n2 - 1;
p_null = probf(w,df2,df1);
if (tmp = 0) then do;
put;
put "Given:";
put " Observed alpha 1 = " obs_a1;
put " n1 = " n1;
put " Observed alpha 2 = " obs_a2;
put " n2 = " n2;
put " N(items) 1 = " k1;
put " N(items) 2 = " k2;
put "Probability of difference greater than observed on null";
put " hypothesis of no difference = " p_null;
end;
else do;
put;
put "Given:";
put " Observed alpha 1 = " obs_a2;
put " n1 = " n2;
put " Observed alpha 2 = " obs_a1;
put " n2 = " n1;
put " N(items) 1 = " k2;
put " N(items) 2 = " k1;
put "Probability of difference greater than observed on null";
put " hypothesis of no difference = " p_null;
end;
run;