The code for testing the risk difference is similar to the following program:
JingJu
- data x;
- z =quantile('normal', 1-0.05/2);
- grp=1;
- p=0.77;
- se =(0.82-0.71)/2/z;
- n=round(p*(1-P)/se**2);
- n1=round(n *p);
- y=1; output;
- y=0; n1=n-n1; output;
- grp =2;
- p=0.86;
- se =(0.90-0.82)/2/z;
- n=round(p*(1-P)/se**2);
- n1=round(n *p);
- y=1; output;
- y=0; n1=n-n1; output;
- run;
- proc freq data=x;
- tables grp *y/riskdiff(equal method=wald );
- weight n1;
- run;