Skip to content

Calculators

Relative Risk Calculator

Compute relative risk from a 2×2 table with 95% confidence interval and p-value — the natural measure of association for cohort studies and randomized trials.

Relative risk
0.100
95% CI
0.040 – 0.250
p-value (two-sided)
< 0.0001
Risk exposed: 0.50% · Risk unexposed: 5.00%
Absolute risk difference: -4.50%
Number needed to treat (NNT): 23

The Formula Behind the Result

  1. Enter the four counts: events and non-events in the exposed group (a, b) and in the unexposed group (c, d).
  2. Risk in each group is computed as events ÷ total, and RR = risk exposed ÷ risk unexposed.
  3. The 95% confidence interval uses the standard log-scale (Katz) method, and a two-sided p-value is reported.
  4. Absolute risk difference and the number needed to treat (NNT) are included, because relative and absolute effects answer different questions.
Formula & Technical Standard
RR = [a/(a+b)] / [c/(c+d)] · SE(ln RR) = √(1/a − 1/(a+b) + 1/c − 1/(c+d)) · 95% CI = exp(ln RR ± 1.96·SE) · NNT = 1/|ARD|

Worked Example

Vaccine-style trial
Input: a=5, b=995, c=50, d=950
Output: RR = 0.10 (95% CI 0.040–0.250), NNT ≈ 23
Risk fell from 5% to 0.5%: a 90% relative reduction. Roughly 23 people need the intervention to prevent one event (NNT = 1/0.045 = 22.2, conventionally rounded up).
Harmful exposure
Input: a=40, b=160, c=20, d=180
Output: RR = 2.00 (95% CI 1.23–3.25), ARD = 12.5%
Exposed individuals have twice the risk; the absolute difference of 12.5 points shows what that means in practice.

Common Questions

How is relative risk different from odds ratio?

RR compares probabilities (risk ÷ risk); OR compares odds (odds ÷ odds). They agree when the outcome is rare (<10%) but diverge for common outcomes, where OR exaggerates the effect. Cohort designs can estimate RR directly; case-control designs cannot.

What is number needed to treat (NNT)?

NNT = 1 divided by the absolute risk difference. It answers the practical question: how many patients must receive the intervention for one additional event to be prevented? It only makes sense when the intervention reduces risk.

Can RR be negative or above 1 for a benefit?

RR ranges from 0 to infinity. An RR below 1 means the exposure reduces risk (a benefit); above 1 means it increases risk. The calculator labels the direction for you so a "protective" number is never misread as harm.

What if a group has zero events?

RR = 0 or infinity is not interpretable, and the log-scale interval fails. Standard practice adds 0.5 to all four cells (the Haldane correction) or reports an exact interval; the tool flags the situation instead of printing a misleading value.