BookmarkSubscribeRSS Feed
abdullala
Calcite | Level 5
what is the correct method and SAS procedure to calculate the 95% confidence interval of the difference of rates in 2 groups?

For example, group A has 28 subjects and 20 improved, group B has 14 subjects and 8 improved. So the improvement rate for group A is 20/28=71.4%, improvement rate for group B is 8/14=57.1%. The difference of rates is 0.14. what is the right way to calculate 95% CI for that?
1 REPLY 1
StatDave
SAS Super FREQ
Set it up as a 2 x 2 table in PROC FREQ and use the RISKDIFF option:

data a;
do group='A','B';
do response='Improved','Unimproved';
input f @@;
output;
end;
end;
datalines;
20 8
8 6
;
proc freq;
weight f;
table group*response / riskdiff;
run;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!

Register now

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 2153 views
  • 0 likes
  • 2 in conversation