Skip to content

Relative Risk Calculator

Relative risk (RR), also called the risk ratio, compares the probability of an outcome in an exposed or treated group with the probability in an unexposed or control group: RR = risk in exposed ÷ risk in unexposed. This relative risk calculator takes the four numbers from a 2×2 table and gives the relative risk with a 95% confidence interval, the absolute risk difference, relative risk reduction, number needed to treat (or harm) and the odds ratio.

  • RR = risk exposed ÷ unexposed
  • CI, RRR, NNT and odds ratio
  • 0.5 continuity correction

Your 2 × 2 table

An RR of 1 means no difference; above 1 means higher risk in the exposed group; below 1 means lower risk.

Exposed / treated
Unexposed / control
Confidence

Confidence level

Risks
— relative risk

    Use the calculator above for your own numbers. Below, we explain how the Relative Risk calculator works, with worked examples and sources.

    Setting up the 2×2 table

    OutcomeNo outcomeTotal
    Exposed / treatedaba + b
    Unexposed / controlcdc + d

    Put the group you are interested in – people exposed to a risk factor, or patients receiving a new treatment – in the first row. Getting the rows and columns the right way round matters: swapping them gives the reciprocal of the relative risk.

    Worked example

    In a cohort study, 30 of 100 exposed people develop a condition, compared with 10 of 100 unexposed people. Risk exposed = 30 ÷ 100 = 0.30; risk unexposed = 10 ÷ 100 = 0.10. Relative risk = 0.30 ÷ 0.10 = 3.0 – exposed people were three times as likely to develop the condition. The standard error of ln(RR) is √(1/30 − 1/100 + 1/10 − 1/100) ≈ 0.337, giving a 95% confidence interval of 1.55 to 5.80. Because the interval does not include 1, the difference is statistically significant at the 5% level.

    Relative risk reduction, absolute risk and NNT

    For treatments, the useful numbers are how much the treatment lowers risk in relative and absolute terms. Suppose 12% of patients on placebo have a heart attack over five years, compared with 8% on a new drug.

    • Relative risk = 0.08 ÷ 0.12 = 0.67.
    • Relative risk reduction (RRR) = 1 − 0.67 = 33% – the headline figure.
    • Absolute risk reduction (ARR) = 12% − 8% = 4 percentage points.
    • Number needed to treat (NNT) = 1 ÷ 0.04 = 25 – on average, 25 people must take the drug for five years to prevent one heart attack.

    When the exposure increases risk, the same calculation gives the number needed to harm (NNH). In the cohort example, the risk difference is 0.20, so for every 5 people exposed, one extra person develops the condition.

    Why absolute risk matters in headlines

    A '50% higher risk' can mean a change from 2 in 10,000 to 3 in 10,000 – a relative risk of 1.5 but an absolute increase of just 1 in 10,000. Or it can mean 20% to 30%, a huge difference. Always look for the baseline risk and the absolute difference before deciding how worried to be. The calculator shows both side by side.

    Relative risk vs odds ratio

    The odds ratio (OR) compares odds rather than probabilities. In the cohort example, the odds of the condition are 30 ÷ 70 = 0.43 in the exposed group and 10 ÷ 90 = 0.11 in the unexposed group, so OR = 3.86 – noticeably larger than the RR of 3.0. When the outcome is rare (under about 10%), the two are close; when it is common, the OR exaggerates the RR. Case-control studies, which select people by outcome, cannot estimate risk directly and report odds ratios; cohort studies and randomised trials can report relative risk.

    Attributable risk

    Attributable risk percent asks how much of the risk in the exposed group is due to the exposure: (RR − 1) ÷ RR × 100. With RR = 3, about 67% of cases among exposed people would not have happened without the exposure – assuming the relationship is causal. That assumption is the big one: observational studies can show association, but confounding factors (age, smoking, income and so on) may explain part of it. Randomised trials, or studies that adjust for confounders, give stronger evidence.

    When a cell is zero

    If no one in one group had the outcome, the relative risk is 0 or infinite and the usual standard error formula breaks down. A common fix is to add 0.5 to every cell (the Haldane–Anscombe correction) before calculating. The calculator does this automatically and labels the result, but very small counts give wide, unstable intervals – treat them with caution and consider an exact method.

    Sources

    1. Altman D.G. – Practical Statistics for Medical Research (risk ratio and confidence interval methods) – textbook
    2. CDC – Principles of Epidemiology, Lesson 3: Measures of Risk — cdc.gov

    Results are estimates for information only. Last reviewed: .

    Written & built by

    Zeeshan Nawaz

    Calculator Developer · Tuff Search

    Builds and tests Tuff Search calculators, turning official tax tables and published formulas into tools anyone can check.

    FAQ

    Frequently asked questions

    Quick answers about the Relative Risk calculator.

    The ratio of the probability of an outcome in an exposed group to the probability in an unexposed group.

    Still have a question? Email support@tuffsearch.com