SAS day 8: Proc Freq Risk Difference
Goal :
- What is Risk Difference?
- How to interpret Risk Difference Confidence Interval.
Background:
Risk Difference is used to compare the proportions of successes between two independent groups with respect to a binary outcome. (cancer remission).
If the outcome is continuous, we compare the difference in means instead.
Risk Difference:
where (
is the successes in group 1) ,
(
is the successes in group 2).

ColiN00B / Pixabay
Example:
H0 (Null Hypotheses) : : there is no difference in outcomes between Treatment A and Placebo.
Outcome:
Treatment A | Treatment B | Placebo | |
---|---|---|---|
n(%) | 21(29.3) | 25(25.1) | 6(9.1) |
Difference From Placebo | 18 | 11.3 | |
p-value for difference | 0.0004 | 0.067 | |
97.5% CI for Difference | (9.2,35,6) | (-2.2,22.3) |
Interpretation:
We are 95% confident that the difference in proportion in Treatment A and Placebo is (9.2, 35.6), therefore we conclude the treatment outcome difference in success is significant.
Note: If we use the WALD option, we might get negative values for CI, which means, the difference is not significant.
SAS Code:
PROC FREQ DATA=adtte;
where (trt01pn in (1 2 ));
BY avisitn ;
TABLES trt01pn*aval / riskdiff(cl=wald) alpha=0.025;
exact riskdiff;
RUN;
data riskci;
set riskci;
col1 = put(-riskdifference*100, 4.1);
keep avisitn col1;
run;
Happy SAS Coding 😍!
Thanks very much to Renee 5, Shared the Risk Diff knowledge with me ! 🍉