Relative Risk Calculator

StatisticsLast updated: August 22, 2026

The relative risk (risk ratio, RR) is the event risk of the exposed or treated group divided by the risk of the control group. It answers the question "by what factor does this change the risk?" directly, which makes it far easier to interpret than the odds ratio; it can, however, only be used in designs where the risks are genuinely estimable — cohort studies, randomized controlled trials, and cross-sectional research.

Alongside the RR, this calculator returns the absolute risk difference, its Newcombe hybrid score confidence interval, and the NNT/NNH, the most practical measure for a clinical decision. The relative risk describes the size of the effect proportionally; the absolute risk difference shows how many people the effect actually corresponds to in real life. When the two are not reported together, small absolute differences can be exaggerated by dramatic percentages.

Number of people in the treated or exposed group in whom the event occurred.
Number of people in the same group in whom the event did not occur.
Number of people in the control group in whom the event occurred.
Number of people in the control group in whom the event did not occur.
Sets the direction of the NNT and NNH interpretation.
In a case-control design the risks cannot be estimated; the odds ratio must be used there.
The probability that the interval covers the true parameter.
Sets the false-positive risk. The common choice in the social sciences is 5%.

Relative Risk, Risk Difference, and NNT Formulas

Table:             [a  b; c  d],  n₁ = a + b,  n₂ = c + d
Risks:             Risk₁ = a / n₁,   Risk₂ = c / n₂
Relative risk:     RR = Risk₁ / Risk₂
SE[ln(RR)]:        √(1/a − 1/n₁ + 1/c − 1/n₂)
RR interval:       exp( ln(RR) ± z_{1−α/2} · SE )
Risk difference:   RD = Risk₁ − Risk₂
RD (Wald) SE:      √( p₁(1−p₁)/n₁ + p₂(1−p₂)/n₂ )
RD interval:       Newcombe hybrid score (square-and-add) method
NNT / NNH:         1 / |RD|
Relative change:   (RR − 1) × 100

The confidence interval for the risk difference is produced with Newcombe's square-and-add method; because it is derived from the Wilson interval of each proportion, it never crosses the [−1, 1] bounds and gives markedly better coverage than the Wald interval in small samples. The Wald interval is shown as well for comparison.

How to Calculate

  1. Enter the event-yes and event-no counts of the treated/exposed group and the control group in the four boxes.
  2. Choose whether the event is undesirable (death, relapse) or desirable (recovery, response); the NNT/NNH wording follows this choice.
  3. Mark the study design; if you select case-control, the calculator reports that the relative risk is invalid.
  4. Read the relative risk and its confidence interval: if the interval contains 1, the effect is not statistically significant.
  5. Always assess the absolute risk difference and the NNT together with the RR; the relative risk alone does not show the real size of the effect.
  6. You can copy the rows of the risk comparison table into your report as they are.

Worked Examples

Protective effect in a randomized controlled trial

The treatment group had 15 events among 100 people and the control group 30 events among 100. The risks are 15.00% and 30.00%; RR = 0.500 (95% CI: 0.287 – 0.870) with p = 0.014, so the effect is significant. The absolute risk reduction is 15.00 percentage points and NNT = 6.67: treating about 7 patients prevents one event.

Relative risk (RR): 0.5000 · 95% confidence interval for RR: 0.2872 – 0.8704 · p-value (H₀: RR = 1): p = 0.014

Harmful exposure (NNH)

The risk is 25.00% in the exposed group and 15.00% in the control group. RR = 1.667 (95% CI: 0.936 – 2.968) with p = 0.083, so the difference is not significant at α = 0.05. Since the absolute risk increase is 10.00 percentage points, NNH = 10.00; because the risk-difference interval contains zero, however, no single finite interval can be given for the NNH.

Relative risk (RR): 1.6667 · 95% confidence interval for RR: 0.9360 – 2.9678 · p-value (H₀: RR = 1): p = 0.083

A small, non-significant difference

The risks in the two groups are 20.00% and 18.00%. RR = 1.111 (95% CI: 0.626 – 1.971) with p = 0.719, so the effect is not significant. The absolute difference is only 2.00 percentage points and the Newcombe interval contains zero; a sample of this size cannot detect differences that small.

Relative risk (RR): 1.1111 · 95% confidence interval for RR: 0.6263 – 1.9712 · p-value (H₀: RR = 1): p = 0.719

Frequently Asked Questions

What is the difference between relative risk and the odds ratio?
The relative risk is the ratio of two probabilities and means directly "by what factor the risk changes". The odds ratio is the ratio of the event/non-event odds. When the event is rare the two are close; as the event becomes more common the odds ratio always falls further from 1 and overstates the effect. For cohort and RCT data the easier-to-interpret RR is preferred.
Why can't relative risk be computed in a case-control study?
In a case-control design the researcher decides how many cases and how many controls to recruit. The event rate in the sample depends entirely on that decision, so the risks computed from the rows do not reflect the true population risk. The only valid effect measure in that design is the odds ratio; when the event is rare, the OR is already a good approximation to the RR.
What exactly does the NNT express?
The NNT (number needed to treat) shows how many patients must be treated to prevent one extra adverse event, and it is the reciprocal of the absolute risk difference. An NNT of 7 means that treating seven patients rather than leaving them in the control condition prevents, on average, one event. A small NNT means a strong effect; the NNH is the same calculation on the harm side.
Why can the NNT confidence interval sometimes not be given?
The NNT is the reciprocal of the risk difference. If the confidence interval of the risk difference contains zero, taking the reciprocal produces an interval that passes through infinity: the result splits into one part on the NNT side and one on the NNH side. As Altman showed in 1998, writing a single finite interval in that situation is mathematically wrong, so the calculator suppresses the interval and issues a warning.
How is the relative risk reduction percentage computed?
The relative risk reduction (RRR) is found with (1 − RR) × 100. With RR = 0.50 the risk is said to have fallen by 50%. That percentage alone is deceptive, however: the RRR is the same whether the absolute risk falls from 40% to 20% or from 0.002% to 0.001%. It must therefore be reported together with the absolute risk reduction (ARR).
What is done when a group has zero events?
When a cell is zero, ln(RR) becomes undefined. The standard remedy is the Haldane-Anscombe correction: 0.5 is added to all four cells and the calculator tells you so. The corrected estimate is biased and pulls the effect toward 1; for significance it is better to look at Fisher's exact test and, where possible, to use exact likelihood methods.
How do I get the same result in R and SPSS?
In SPSS, Crosstabs > Statistics > Risk gives the relative risk and its 95% confidence interval in the "For cohort ..." rows. In R, riskratio(x, method = "wald") from the epitools package or riskratio() from fmsb produces the same Katz interval. You may see small differences in the risk-difference interval: this calculator uses the Newcombe hybrid score method, while some software reports the classical Wald interval.