[Data] AspirinHeartMI : X = Group (Placebo/Aspirin) and Y = MI cases (Yes/No).
[Specification]
The option riskdiff
tells SAS to provide estimate and CI for difference of proportions. It will output the differences by columns. For exmaple,
The option relrisk
tells SAS to provide estimate and CI for relative risk and odds ratio.
[Code and Output]
data AspirinHeartMI;
input MI $ Group $ Count;
datalines;
Yes Placebo 189
No Placebo 10845
Yes Aspirin 104
No Aspirin 10933
;
proc freq order=data data=AspirinHeartMI;
weight Count;
tables Group*MI / riskdiff relrisk;
run;
The FREQ Procedure
Table of Group by MI
Group MI
Frequency|
Percent |
Row Pct |
Col Pct |Yes |No | Total
---------+--------+--------+
Placebo | 189 | 10845 | 11034
| 0.86 | 49.14 | 49.99
| 1.71 | 98.29 |
| 64.51 | 49.80 |
---------+--------+--------+
Aspirin | 104 | 10933 | 11037
| 0.47 | 49.54 | 50.01
| 0.94 | 99.06 |
| 35.49 | 50.20 |
---------+--------+--------+
Total 293 21778 22071
1.33 98.67 100.00
Statistics for Table of Group by MI
Column 1 Risk Estimates
(Asymptotic) 95% (Exact) 95%
Risk ASE Confidence Limits Confidence Limits
-------------------------------------------------------------------------
Row 1 0.0171 0.0012 0.0147 0.0195 0.0148 0.0197
Row 2 0.0094 0.0009 0.0076 0.0112 0.0077 0.0114
Total 0.0133 0.0008 0.0118 0.0148 0.0118 0.0149
Difference 0.0077 0.0015 0.0047 0.0107
Difference is (Row 1 - Row 2)
Column 2 Risk Estimates
(Asymptotic) 95% (Exact) 95%
Risk ASE Confidence Limits Confidence Limits
-------------------------------------------------------------------------
Row 1 0.9829 0.0012 0.9805 0.9853 0.9803 0.9852
Row 2 0.9906 0.0009 0.9888 0.9924 0.9886 0.9923
Total 0.9867 0.0008 0.9852 0.9882 0.9851 0.9882
Difference -0.0077 0.0015 -0.0107 -0.0047
Difference is (Row 1 - Row 2)
Odds Ratio and Relative Risks
Statistic Value 95% Confidence Limits
------------------------------------------------------------------
Odds Ratio 1.8321 1.4400 2.3308
Relative Risk (Column 1) 1.8178 1.4330 2.3059
Relative Risk (Column 2) 0.9922 0.9892 0.9953
Sample Size = 22071
[Result]
Column 1 Risk Estimates
estimates the (probability of getting MI in Placebo group - probability of getting MI in Treatment group)
Column 2 Risk Estimates
esimates (probability of no MI in Placebo group - probability of no MI in Treatment group).
ASE = Asymptotic Standard Error (for large sample)