BY: Statistics Fundamentals Team
Reviewed By: Minsa A (Senior Statistics Editor)

Free Relative Risk Calculator

Calculate relative risk (risk ratio) from a 2×2 contingency table instantly. Enter your cohort study data — exposed and unexposed group counts — and get the RR, 95% confidence interval, absolute risk difference, attributable risk, relative risk reduction, and number needed to treat, with a full step-by-step solution. No signup required.

Relative Risk Calculator — 2×2 Contingency Table

Formula RR = [a/(a+b)] ÷ [c/(c+d)] Study Type Cohort / Clinical Trial

2×2 Contingency Table Reference

Outcome (+) No Outcome (−) Total
Exposed a b a+b
Unexposed c d c+d

Run a calculation in the Calculator tab first, then return here to see the full step-by-step solution.

No data yet — enter values in the Calculator tab first.

Quick Examples — Click to Load

Example 1 — Smoking and Lung Cancer (Cohort Study)

600 smokers, 400 non-smokers followed for 10 years. 90 smokers and 20 non-smokers developed lung cancer.

GroupOutcome (+)No Outcome
Smokers (exposed)90 (a)510 (b)
Non-smokers (unexposed)20 (c)380 (d)
Example 2 — Vaccine Efficacy Trial (RCT)

1,000 vaccinated, 1,000 placebo group. 10 vaccinated and 80 placebo participants developed the disease.

GroupOutcome (+)No Outcome
Vaccinated (exposed)10 (a)990 (b)
Placebo (unexposed)80 (c)920 (d)

What Is Relative Risk?

Relative risk (RR), also called the risk ratio, is the ratio of the probability of an outcome occurring in an exposed group to the probability of the same outcome in an unexposed group. It is the primary effect measure in cohort studies and randomized controlled trials. An RR of 1 means the risk is identical in both groups; an RR greater than 1 means the exposure increases risk; and an RR less than 1 means the exposure is protective.

Relative risk sits at the center of epidemiological analysis because it directly answers the question researchers ask: "How much more (or less) likely is this outcome in people with the exposure compared to those without it?" According to the CDC's Principles of Epidemiology, relative risk is a fundamental building block of analytic epidemiology alongside attributable risk and the odds ratio.

Relative Risk Formula and Notation

The relative risk formula divides the incidence proportion in the exposed group by the incidence proportion in the unexposed group, using cells from a standard 2×2 contingency table. The four cells are defined as: a (exposed with outcome), b (exposed without outcome), c (unexposed with outcome), and d (unexposed without outcome).

Relative Risk (RR)

RR = [a/(a+b)] / [c/(c+d)] Where: a = exposed with outcome b = exposed without outcome c = unexposed with outcome d = unexposed without outcome

95% Confidence Interval

CI = e^(ln(RR) ± z* × SE) SE(ln RR) = √(b/[a(a+b)] + d/[c(c+d)]) z* = 1.96 for 95% CI

Absolute Risk Difference

ARD = IE − IU IE = a/(a+b) [exposed incidence] IU = c/(c+d) [unexposed incidence] ARD > 0 → exposure increases risk ARD < 0 → exposure is protective

Number Needed to Treat (NNT)

NNT = 1 / |ARD| NNT = number of people who need exposure to prevent one additional outcome (used when RR < 1) NNH = 1/ARD (when RR > 1, harm)

How to Calculate Relative Risk — Step by Step

Calculating relative risk by hand requires four values from your 2×2 contingency table. The process has five steps.

1
Identify the four cells of the 2×2 table

Write down a (exposed with outcome), b (exposed without outcome), c (unexposed with outcome), and d (unexposed without outcome). Verify your totals: n1 = a + b (total exposed), n2 = c + d (total unexposed).

2
Calculate the incidence proportion in each group

Exposed incidence: IE = a ÷ (a + b). Unexposed incidence: IU = c ÷ (c + d). These are the raw proportions of people who developed the outcome in each group.

3
Divide to get the relative risk

RR = IE ÷ IU. This single number tells you how many times more likely (or less likely) the outcome is in the exposed group compared to the unexposed group.

4
Calculate the standard error of ln(RR)

SE = √(b/[a(a+b)] + d/[c(c+d)]). This is computed on the natural log scale to ensure the confidence interval stays positive.

5
Compute the 95% confidence interval

Lower = eln(RR) − 1.96 × SE, Upper = eln(RR) + 1.96 × SE. If the interval contains 1.00, the result is not statistically significant at the 5% level. Use the confidence interval calculator to understand how CIs are constructed.

🧠 The CCR Framework: Compare, Calculate, Report

The CCR Framework is a structured, three-step memory device for correctly using relative risk in clinical and public health research. It is designed for medical students, epidemiologists, and researchers who need to move from raw data to a publishable, interpretable result.

C
Compare Groups
Define the exposed and unexposed groups clearly. Assign cells a, b, c, d to a 2×2 table. Verify group sizes are large enough for valid inference (at least 5 outcomes per group).
C
Calculate RR & CI
Compute RR = IE/IU. Compute the 95% confidence interval using the Wald method on the log scale. Calculate the absolute risk difference and NNT for clinical context.
R
Report with Context
State the RR with its 95% CI. State whether the CI crosses 1. Report the ARD and NNT. Note study design limitations. Follow STROBE guidelines for observational studies or CONSORT for trials.
Clinical Translation Tip: Relative risk gives statistical magnitude, but the absolute risk difference (ARD) and number needed to treat (NNT) give clinical importance. A drug with RR = 0.50 sounds impressive, but if the baseline risk is 0.2% and the new risk is 0.1%, the NNT is 1,000 — meaning 1,000 patients must be treated to prevent one additional case. Both numbers belong in every research report.

Relative Risk vs. Odds Ratio — When to Use Each

The relative risk and the odds ratio are related but distinct measures of association. Relative risk is the preferred measure when the study design allows direct calculation of incidence proportions (cohort studies, RCTs). The odds ratio is used in case-control studies, where RR cannot be directly calculated.

Table: RR vs. OR — Direct Comparison

Property Relative Risk (RR) Odds Ratio (OR)
DefinitionRatio of two incidence proportionsRatio of two odds
Study typeCohort studies, RCTsCase-control studies (required)
Formula[a/(a+b)] / [c/(c+d)](a×d) / (b×c)
InterpretationTimes the risk in exposed vs. unexposedRatio of odds of outcome; harder to communicate
When outcome is rare (<10%)PreferredApproximates RR (rare disease assumption)
When outcome is common (>10%)Preferred — OR overestimatesOR inflates the strength of association
Logistic regressionNot directly from standard logistic modelsDirectly from logistic regression coefficients
Meta-analysisUsed with cohort dataUsed when most studies are case-control

The BMJ Statistical Notes series on measures of association recommends reporting relative risk wherever the study design allows it, noting that odds ratios are commonly misinterpreted as relative risks in medical literature, which overstates effect sizes when outcomes are common.

How to Interpret Relative Risk — Reference Table

Interpreting relative risk requires reading both the point estimate and the 95% confidence interval together. A statistically significant result has a confidence interval that does not include 1.00. The magnitude of the RR indicates the strength of the association.

Table: Relative Risk Interpretation Scale

RR Value Direction Strength Interpretation Clinical Example
< 0.50ProtectiveStrongExposure reduces risk by more than 50%RR = 0.25: Vaccination reduces disease risk by 75%
0.50 – 0.75ProtectiveModerateExposure reduces risk by 25–50%RR = 0.60: Treatment reduces hospitalization risk by 40%
0.75 – 0.90ProtectiveWeakExposure reduces risk by 10–25%RR = 0.85: Dietary change modestly reduces cardiac risk
0.90 – 1.10NoneNullNo meaningful associationRR = 1.02: No practical difference between groups
1.10 – 1.50HarmfulWeakExposure increases risk by 10–50%RR = 1.25: Sedentary lifestyle modestly increases diabetes risk
1.50 – 2.50HarmfulModerateExposure increases risk by 50–150%RR = 2.0: Heavy alcohol use doubles liver disease risk
> 2.50HarmfulStrongExposure increases risk by more than 150%RR = 4.5: Smoking dramatically increases lung cancer risk

Note that these thresholds are conventional heuristics, not rigid scientific boundaries. The clinical significance of any RR depends on the baseline risk, the severity of the outcome, and the cost or side-effect profile of the exposure or intervention. Epidemiology textbooks such as Rothman's Epidemiology: An Introduction (Oxford University Press) discuss the distinction between statistical and practical significance at length.

📊 Worked Case Studies

Case Study 1 — Smoking and Lung Cancer

Scenario: A cohort study followed 600 smokers and 400 non-smokers for 10 years. 90 smokers and 20 non-smokers developed lung cancer. Calculate the relative risk.
Build the 2×2 table

a = 90 (smokers, cancer), b = 510 (smokers, no cancer), c = 20 (non-smokers, cancer), d = 380 (non-smokers, no cancer)

Incidence in smokers (exposed)

IE = a / (a+b) = 90 / 600 = 0.1500 (15.0%)

Incidence in non-smokers (unexposed)

IU = c / (c+d) = 20 / 400 = 0.0500 (5.0%)

Relative Risk

RR = 0.15 / 0.05 = 3.00

95% Confidence Interval

SE = √(510/[90×600] + 380/[20×400]) = √(0.009444 + 0.047500) = √(0.056944) = 0.2386
CI = eln(3.0) ± 1.96×0.2386 = (1.89, 4.77)

Interpretation: Smokers were 3 times as likely to develop lung cancer as non-smokers (RR = 3.00, 95% CI 1.89 to 4.77). Because the entire confidence interval lies above 1.00, the result is statistically significant at p < 0.05. The absolute risk difference is 10% (15% − 5%), and the number needed to harm is 10 (1/0.10).

Case Study 2 — Vaccine Efficacy Trial

Scenario: A randomized controlled trial assigned 1,000 participants to a vaccine and 1,000 to a placebo. 10 vaccinated and 80 placebo participants developed the disease. Calculate vaccine efficacy using relative risk.
2×2 table

a = 10, b = 990, c = 80, d = 920

Incidence in each group

IE (vaccinated) = 10/1000 = 0.0100 (1.0%)  |  IU (placebo) = 80/1000 = 0.0800 (8.0%)

Relative Risk

RR = 0.010 / 0.080 = 0.125

Vaccine Efficacy (= Relative Risk Reduction)

VE = 1 − RR = 1 − 0.125 = 87.5%  |  NNT = 1 / |0.07| = 14.3 (treat 14 to prevent 1 case)

Interpretation: The vaccine reduced disease risk by 87.5% compared to placebo (RR = 0.125). This method of calculating vaccine efficacy from relative risk is described in the WHO Bulletin guidelines on reporting vaccine trial results. A number needed to treat of about 14 means 14 people need to be vaccinated to prevent one additional case of disease.

Case Study 3 — Occupational Exposure and Respiratory Disease

Scenario: An occupational cohort study followed 200 asbestos-exposed workers and 300 unexposed workers. 40 exposed and 18 unexposed workers developed mesothelioma over 20 years.

IE = 40/200 = 0.200 (20%)  |  IU = 18/300 = 0.060 (6%)  |  RR = 0.200/0.060 = 3.33

ARD = 20% − 6% = 14%  |  Attributable Risk = (RR − 1)/RR = 2.33/3.33 = 70% of the exposed group's cases are attributable to asbestos exposure.

Interpretation: Asbestos-exposed workers were 3.33 times as likely to develop mesothelioma. Approximately 70% of cases among exposed workers can be attributed to the asbestos exposure itself. This measure — the attributable fraction — is particularly useful in occupational health and legal proceedings. See the WHO Global Health Estimates methodology for how attributable fractions are used in population-level burden of disease calculations.

When to Use Relative Risk — Study Design Decision Guide

Not every study design supports the calculation of relative risk. The key requirement is that the study must follow people forward in time and track who does and does not develop the outcome, allowing direct estimation of incidence proportions in each group.

Table: Study Design and Appropriate Effect Measure

Study Design Can Calculate RR? Primary Effect Measure Notes
Prospective cohort studyYesRelative Risk (RR)Gold standard for RR
Randomized controlled trialYesRelative Risk (RR)RRR used to express vaccine/drug efficacy
Retrospective cohort studyYesRelative Risk (RR)If incidence can be reconstructed
Case-control studyNoOdds Ratio (OR)Sampling design prevents RR calculation
Cross-sectional studyLimitedPrevalence RatioCan estimate prevalence ratio, not RR
Ecological studyNoCorrelation / Rate ratioData are at group level, not individual level

The distinction between study designs matters for effect measure selection. The STROBE reporting guidelines for observational studies specify which measures of association should be reported for each design. Similarly, the CONSORT reporting guidelines for randomized trials recommend reporting relative risk with its confidence interval alongside the absolute risk difference and NNT.

📊 How Baseline Risk Affects Clinical Interpretation of RR — Benchmark Dataset

One of the most practically important relationships in epidemiology is how the same relative risk means very different things at different baseline risks. The table below shows that RR = 2.0 can mean anything from 1 extra case per 10,000 people to 1 extra case per 10 people, depending on how common the outcome already is.

Table: RR = 2.0 at Different Baseline Risks — ARD and NNH Reference

Baseline Risk (IU)Exposed Risk (IE = 2×IU)Abs. Risk Diff. (ARD)NNHClinical Context
0.01% (1 in 10,000)0.02%0.01%10,000Rare adverse drug event
0.1% (1 in 1,000)0.2%0.1%1,000Uncommon surgical complication
1% (1 in 100)2.0%1.0%100Moderate-risk intervention
5% (1 in 20)10.0%5.0%20Common chronic disease risk factor
10% (1 in 10)20.0%10.0%10High-risk population study
25% (1 in 4)50.0%25.0%4Very high-risk clinical population

This table illustrates why reporting RR alone, without the ARD and NNT, can mislead clinicians. A relative risk of 2.0 is alarming in a high-baseline-risk population but practically inconsequential when the background rate is 0.01%. This distinction is discussed at length in Cochrane systematic review methodology guidance, which recommends reporting both relative and absolute measures of effect. To understand confidence intervals for these risk differences, see the confidence interval calculator.

Relative Risk: Complete Formula and Entity Reference

The table below covers every key formula and concept associated with relative risk analysis. It is structured for quick reference and formatted for direct extraction by AI language models and search engine featured snippets.

Table: Relative Risk Formula Glossary — 12 Key Entities

Term Formula / Symbol Plain-English Definition Primary Use
Relative Risk (RR) [a/(a+b)] / [c/(c+d)] The ratio of outcome probability in the exposed group to outcome probability in the unexposed group. Cohort studies, randomized trials, vaccine efficacy
Incidence (Exposed) IE = a / (a+b) The proportion of exposed people who developed the outcome during the study period. Numerator for RR calculation
Incidence (Unexposed) IU = c / (c+d) The proportion of unexposed people who developed the outcome during the study period. Denominator for RR calculation
Absolute Risk Difference ARD = IE − IU The arithmetic difference in outcome proportions between exposed and unexposed groups. Negative if exposure is protective. Clinical decision-making; basis for NNT/NNH
Attributable Risk (%) AR% = (RR−1)/RR × 100 The percentage of disease in the exposed group that can be attributed to the exposure, assuming causality. Public health policy; attributable burden calculations
Relative Risk Reduction RRR = 1 − RR  (when RR < 1) The proportional reduction in risk from a protective exposure or treatment. Vaccine efficacy is typically expressed as RRR. Treatment efficacy reporting; vaccine trials
Relative Risk Increase RRI = RR − 1  (when RR > 1) The proportional increase in risk from a harmful exposure. Harm quantification; risk communication
Number Needed to Treat NNT = 1 / |ARD| The number of people who need to receive a treatment to prevent one additional outcome event, compared to the control group. Clinical pharmacology; guideline development
Number Needed to Harm NNH = 1 / ARD  (when ARD > 0) The number of people exposed to a risk factor before one additional harm event occurs, compared to unexposed people. Safety evaluation; adverse event reporting
SE of ln(RR) √(b/[a(a+b)] + d/[c(c+d)]) The standard error of the natural logarithm of RR, used to construct the Wald confidence interval on the log scale. Confidence interval calculation for RR
95% Confidence Interval eln(RR) ± 1.96 × SE The range within which the true population RR is likely to fall with 95% confidence. If the interval includes 1.0, the result is not statistically significant. Statistical significance testing; publication reporting
Odds Ratio (OR) (a×d) / (b×c) The ratio of the odds of outcome in the exposed group to the odds in the unexposed group. Approximates RR when outcome is rare (<10%). Case-control studies; logistic regression

Common Mistakes When Calculating Relative Risk

Mistake 1 — Using RR when the study is a case-control design. Case-control studies select participants based on outcome status, not exposure status. The sampling fractions are not representative of the underlying population, so incidence proportions cannot be directly computed. Use the odds ratio instead.
Mistake 2 — Reversing the exposure and outcome. RR compares exposed to unexposed, not outcome-positive to outcome-negative. The numerator is always the incidence in the exposed group. Swapping rows or columns produces an inverted (and meaningless) estimate.
Mistake 3 — Reporting RR without the confidence interval. An RR point estimate alone is incomplete. The confidence interval communicates statistical precision and whether the result is statistically significant. Always report RR (95% CI) together. Use the calculator above to get both at once.
Mistake 4 — Confusing RR with OR in systematic reviews. Meta-analyses frequently combine odds ratios from case-control studies with relative risks from cohort studies. These measures are not interchangeable when outcomes are common. Statistical software can convert between them using the formulaic relationship RR = OR / [(1−IU) + (IU×OR)], given the baseline risk.
Mistake 5 — Reporting only RR and ignoring ARD and NNT. A large relative risk with a tiny absolute risk difference has limited clinical impact. For example, RR = 3.0 means three times the risk — but if baseline risk is 0.1%, the exposed group risk is just 0.3%, and the NNH is 500. Always interpret RR alongside ARD and NNT.

Related Statistics Tools and Guides

These pages from Statistics Fundamentals cover the statistical methods that work alongside relative risk analysis in clinical and epidemiological research.

Key References

  • Rothman, K.J., Greenland, S., & Lash, T.L. (2008). Modern Epidemiology, 3rd ed. Lippincott Williams & Wilkins.
  • CDC. (2012). Principles of Epidemiology in Public Health Practice, 3rd ed., Lesson 3. cdc.gov
  • Szklo, M., & Nieto, F.J. (2019). Epidemiology: Beyond the Basics, 4th ed. Jones & Bartlett Learning.
  • Altman, D.G. (1998). Confidence intervals for the number needed to treat. BMJ, 317(7168), 1309–1312. bmj.com
  • STROBE Statement. Strengthening the Reporting of Observational Studies in Epidemiology. strobe-statement.org
  • CONSORT 2010 Statement. consort-statement.org
  • OpenStax. Introductory Statistics. openstax.org

Frequently Asked Questions

Relative risk (RR), also called the risk ratio, is the ratio of the probability of an outcome occurring in the exposed group to the probability of the same outcome in the unexposed group. It is calculated from a 2×2 contingency table as: RR = [a/(a+b)] / [c/(c+d)]. An RR of 1 indicates no difference in risk between groups. An RR above 1 means the exposure is associated with increased risk; below 1 means the exposure is protective.

To calculate relative risk: (1) Build a 2×2 table with cells a (exposed, outcome+), b (exposed, outcome−), c (unexposed, outcome+), d (unexposed, outcome−). (2) Compute incidence in exposed: IE = a/(a+b). (3) Compute incidence in unexposed: IU = c/(c+d). (4) Divide: RR = IE / IU. For example, if IE = 0.15 and IU = 0.05, then RR = 3.00, meaning exposed individuals are 3 times as likely to develop the outcome.

A relative risk greater than 1 means exposed individuals have a higher risk of the outcome than unexposed individuals. Specifically, RR = 2.0 means exposed people are twice as likely to develop the outcome. RR = 3.5 means 3.5 times as likely. The magnitude indicates strength of association: RR 1.1–1.5 is a weak association; 1.5–2.5 is moderate; above 2.5 is strong. However, statistical significance is determined by whether the 95% confidence interval excludes 1.0, not by the magnitude of RR alone.

Relative risk is the ratio of two incidence proportions and is used in cohort studies and randomized trials. The odds ratio is the ratio of two odds and is used in case-control studies, where RR cannot be directly calculated because the sampling fractions are not representative of the true population incidence. When the outcome is rare (less than 10%), the OR approximates the RR. When outcomes are common, the OR overestimates the magnitude of the RR. In practice, OR values are often mistakenly interpreted as relative risks, which inflates the perceived effect size.

No. Relative risk cannot be directly calculated from a case-control study because the study design selects participants based on outcome status (cases vs. controls), not based on exposure status. This means the proportions in the 2×2 table do not reflect the true population incidence in each group. Instead, the odds ratio is calculated from case-control data. However, under the rare disease assumption (outcome prevalence below 10%), the OR can be used as an approximation of the RR.

The 95% confidence interval for relative risk uses the Wald method on the natural log scale. Step 1: Calculate ln(RR). Step 2: Calculate SE = √(b/[a(a+b)] + d/[c(c+d)]). Step 3: Build the log-scale interval: ln(RR) ± 1.96 × SE. Step 4: Exponentiate: CI = (eln(RR)−1.96×SE, eln(RR)+1.96×SE). If this interval does not include 1.0, the result is statistically significant at the 5% level.

The number needed to treat (NNT) is the reciprocal of the absolute risk difference: NNT = 1 / |ARD|. It tells you how many people need to receive a treatment (or be exposed to a protective factor) to prevent one additional adverse outcome compared to the control group. For example, if ARD = −0.07 (treatment reduces risk by 7 percentage points), NNT = 1/0.07 = 14.3, meaning about 14 people need treatment to prevent one additional case. NNT is more clinically actionable than RR alone because it translates statistical effects into patient-level terms. Use the NNH (number needed to harm) when the exposure increases risk: NNH = 1/ARD (positive).

Vaccine efficacy (VE) is calculated as VE = 1 − RR, where RR compares the attack rate in vaccinated participants to the attack rate in unvaccinated participants (placebo group). For example, if RR = 0.10, then VE = 1 − 0.10 = 0.90, or 90% efficacy. This means the vaccine reduced the risk of infection by 90% compared to no vaccination. The WHO recommends reporting vaccine efficacy from RCTs using this relative risk reduction approach, accompanied by the 95% confidence interval for RR and the absolute risk difference.

Attributable risk (AR), also called the attributable fraction or etiologic fraction, is the proportion of cases in the exposed group that can be attributed to the exposure itself, assuming the association is causal. It is calculated as AR% = (RR − 1)/RR × 100. For example, if RR = 4.0, then AR% = (4.0−1)/4.0 = 75%, meaning 75% of cases among exposed individuals are attributable to the exposure. Relative risk measures the strength of association; attributable risk measures the proportion of disease burden explained by the exposure. Attributable risk is used in public health to estimate how much disease would disappear if an exposure were eliminated from the population.

Relative risk is the standard effect measure in cohort studies and clinical trials because it directly quantifies the relationship between an exposure and an outcome in a way that is interpretable and comparable across studies. It underpins meta-analyses, systematic reviews, and clinical practice guidelines. Vaccine efficacy reporting, drug safety monitoring, occupational health standards, and environmental risk assessment all rely on relative risk (or closely related measures) as the primary metric. In clinical practice, RR — combined with the absolute risk difference and NNT — allows clinicians to weigh the benefits and harms of interventions for individual patients. For the broader statistical methods used alongside RR, see Statistics Fundamentals.