Relative Risk Calculator

Relative Risk Calculator

Compare the risk of an outcome between an exposed or treated group and a comparison group: relative risk with a 95% confidence interval, absolute risk difference, number needed to treat and the odds ratio.

RR = (a ÷ n₁) ÷ (c ÷ n₀)

Enter events and group sizes for both groups

What Is Relative Risk?

Relative risk (the risk ratio) is the risk of an outcome in one group divided by the risk in another. An RR of 0.5 means half the risk; 2 means double; 1 means no difference.

It's the natural measure for cohort studies and trials, where you follow groups forward and count who has the outcome. Case-control studies can't estimate risks directly, so they report odds ratios instead.

Relative risk on its own can mislead. Halving a 6% risk and halving a 0.006% risk give the same RR of 0.5, but very different benefits. The absolute risk difference and number needed to treat show what the change means for real people.

Relative Risk Formula

As given in Altman, Practical Statistics for Medical Research, chapter 10, and Altman, BMJ (1998) on NNT intervals. See Sources.

1. Relative risk

RR = (a ÷ n₁) ÷ (c ÷ n₀)

2. 95% confidence interval (log method)

SE(ln RR) = √(1/a − 1/n₁ + 1/c − 1/n₀) · CI = exp(ln RR ± 1.96 × SE)

3. Absolute measures

risk difference = a/n₁ − c/n₀ · NNT = 1 ÷ |risk difference|, rounded up

Worked Example: A Trial That Halves the Risk

Given:
In a trial, 30 of 1,000 treated patients and 60 of 1,000 on placebo have a heart attack within five years.
Step 1:
Risks and ratio:
3% ÷ 6% = 0.5
Step 2:
Confidence interval:
SE = √(1/30 − 1/1000 + 1/60 − 1/1000) = 0.219 → 0.33 to 0.77
Step 3:
Absolute difference and NNT:
3% − 6% = −3 points · NNT = 1 ÷ 0.03 = 33.3 → 34
Result:
RR = 0.50; treat 34 people for five years to prevent one heart attack

"Halves the risk" and "3 in 100 fewer" describe the same result. Both belong in any honest summary.

Relative Risk vs Absolute Risk

The same 50% relative reduction at different baseline risks.

Absolute benefit and NNT for a relative risk of 0.5 at different baseline risks
Baseline riskTreated riskAbsolute reductionNNT
40%20%20 pts5
10%5%5 pts20
2%1%1 pts100
0.2%0.1%0.1 pts1,000

Common Relative Risk Mistakes

  • Quoting only the relative change. "Doubles your risk" sounds alarming even when the risk goes from 1 in 100,000 to 2 in 100,000.
  • Treating an odds ratio as a relative risk. When outcomes are common, the OR exaggerates: here OR = 0.485 against RR = 0.5, and the gap widens as risks grow.
  • Reading causation into observational RRs. Exposed groups often differ in other ways; only randomised trials justify "the treatment caused it".
  • Rounding NNT down. 33.3 means you need 34 people for one to benefit; always round up.

Relative Risk FAQs

What does a relative risk of 1 mean?

The outcome is equally likely in both groups. Below 1 means lower risk in the first group; above 1 means higher.

What is relative risk reduction?

1 − RR. An RR of 0.5 is a 50% relative risk reduction.

When is the result significant?

When the 95% confidence interval excludes 1, which matches a p-value below 0.05.

What is NNT?

Number needed to treat: how many people need the treatment for one extra person to benefit, over the study’s time frame.

What is NNH?

Number needed to harm: the same idea when the exposure increases risk.

Why can’t I have zero events in the comparison group?

The relative risk divides by that group’s risk, so it would be infinite. Report the absolute risks instead.

Should I use RR or OR?

RR for cohort studies and trials; OR for case-control studies or logistic regression. With rare outcomes they’re close.

Which group goes first?

The exposed or treated group, so RR compares it with the comparison group. Swapping them gives 1 ÷ RR.

Sources

  • D. G. Altman, Practical Statistics for Medical Research (Chapman & Hall, 1991), chapter 10.
  • D. G. Altman, "Confidence intervals for the number needed to treat", BMJ 317 (1998), doi:10.1136/bmj.317.7168.1309.

Related Tools