Risk Ratio Calculator

Input










four-field table

A B r1
C D r2
k1 k2 n
139 239 378
10898 10795 21693
11037 11034 22071
\[RR = \frac{(A \times D- B \times C)^{2}}{(A+ B)\times (C + D) \times (A + C) \times (B + D)} \] \[RR = \frac{( 139 \times 10795 - 239 \times 10898 )^{2}}{( 139 + 239 )\times ( 10898 + 10795) \times ( 139 + 10898 ) \times ( 239 + 10795 )} \] \[RR = 0.58143\]
\[SE(lnRR) = \sqrt{\frac{1}{a}-\frac{1}{a+c}+\frac{1}{b} -\frac{1}{b+d}}\] \[\sqrt{\frac{1}{ 139 }-\frac{1}{ 139 + 10898}+\frac{1}{ 239 } -\frac{1}{ 239 + 10795 }} = 0.10582\] \[lnRR = ln 0.58143 = -0.54226\]
\[ConfidenceInterval = lnRR \pm 1.96 \times SE(lnRR)\] \[ -0.54226 \pm (1.96 \times 0.10582)\] \[ -0.74966 \leq lnRR \leq -0.33486\] \[ e^{ -0.74966 } \leq RR \leq e^{ -0.33486 }\] \[ 0.47253 \leq RR \leq 0.71544\]

What is a risk ratio?

Risk ratio is a measure of the risk of a certain event happening in one group compared to the risk of the same event happening to another group. A risk ratio of 1 (or close to 1) means there is no difference between two groups in terms of their risk.

A confidence interval is used in risk ratio to see if the difference between the groups are significant. If the confidence interval for RR (risk ratio) covers 1 then the difference is not significant.
Since risk ratio is not normally distributed and a confidence interval requires normally distributed variables you need to take the natural log (ln) for RR and its standard error SE(RR) which is SE(lnRR). Formulas to find the natural log of the risk ratio and the standard error easily is provided in the calculation.
Since we are using normally distributed variables (after log transform) we can now use a Z-value to find the confidence interval, Z = 1.96 for a 5% confidence interval.

Example, The physicians' health study. To see if acetylsalicylic acid (aspirin) has a preventive effect against a myocardial infarction (heart attack). A study was conducted on 22071 healthy men where 10898 got aspirin and 11034 of them got a placebo (no treatment).

Heart Attack Aspirin Placebo Sum
Yes 139 239 378
No 10898 10795 21693
Sum 11037 11034 22071

A = 139
B = 239
C = 10898
D = 10795

The risk ratio (RR) is 0.5814 and the natural log (ln) of 0.5814 is -0.5422. The standard error for lnRR is 0.1058 and we would like to find a 95% confidence interval thus we use Z = 1.96.

The confidence interval for lnRR is -0.7496 ≤ lnRR < -0.3348
However you can't interpretet the natural log of risk, in order to get rid of the natural log we take the antilog which is e^(lower interval lnRR) & e^(upper interval lnRR).

The confidence interval after taking the antilog is 0.472 ≤ RR ≤ 0.715 which means the risk a heart attack given you took aspirin is between 47.2% and 71.5% of the risk that you would get if you did not take aspirin. In other words your risk of getting a heart attack given you take aspirin is 100-47.2 = 52.75% & 100-71.5 = 28.5% lower than if you did not take aspirin.