Relative Risk Calculator

Calculate relative risk, odds ratio, absolute risk difference, and NNT from a 2×2 contingency table. Includes 95% confidence intervals and chi-squared test.

2\u00D72 Contingency Table

Outcome (+)No Outcome (\u2212)Total
Exposed40.00
Unexposed160.00
Relative Risk (RR)
1.7143
95% CI: (1.3341, 2.2029)
Odds Ratio (OR)
3.8571
95% CI: (1.7666, 8.4217)
Risk (Exposed)
75.00%
30.00 / 40.00 = 0.7500
Risk (Unexposed)
43.75%
70.00 / 160.00 = 0.4375
Absolute Risk Diff
31.25%
Risk difference: 75.00% − 43.75%
NNT / NNH
3.2
Number Needed to Harm
Chi-Squared
12.5000
Statistically significant (p < 0.05)
Interpretation
Exposure increases risk by 71.4%
Association is statistically significant

Risk Comparison

Exposed
75.0%
Unexposed
43.8%

Measures of Association

MeasureValue95% CIInterpretation
Relative Risk1.7143(1.334, 2.203)Increased risk
Odds Ratio3.8571(1.767, 8.422)Increased odds
Risk Difference0.312531.3% absolute difference
AF (exposed)0.416741.7% of exposed cases attributable
NNT/NNH3.2Treat 3 to cause 1 harm
Planning notes, formulas, and examples

About the Relative Risk Calculator

The Relative Risk Calculator computes the relative risk (RR), odds ratio (OR), absolute risk difference, number needed to treat (NNT), and attributable fractions from a 2×2 contingency table. It includes 95% confidence intervals for RR and OR, plus a chi-squared significance test.

Relative risk is the ratio of the probability of an outcome in the exposed group versus the unexposed group. It's the primary measure of association in cohort studies, clinical trials, and epidemiological research. An RR of 2.0 means the exposed group has twice the risk of the outcome; an RR of 0.5 means half the risk.

This calculator brings the main epidemiology outputs together on one page: relative risk for the headline association, odds ratio for comparison, and absolute measures like risk difference and NNT/NNH for clinical context. That makes it easier to move from a raw 2×2 table to an interpretation you can actually report.

When This Page Helps

Use this calculator when a study gives you exposed and unexposed outcome counts and you need both the size of the association and the practical impact. It helps separate a dramatic-looking ratio from the underlying absolute risk change, which is usually what clinicians and public-health readers care about.

How to Use the Inputs

  1. Enter the four cells of the 2×2 table: (a) exposed with outcome, (b) exposed without, (c) unexposed with outcome, (d) unexposed without.
  2. Use presets for common study scenarios like drug trials or smoking studies.
  3. Review relative risk and odds ratio with their 95% confidence intervals.
  4. Check the absolute risk difference and NNT for clinical significance.
  5. View the risk comparison bars to visualize the difference between groups.
  6. Examine the chi-squared statistic for statistical significance.
  7. Review the comprehensive measures of association table.
Formula used
RR = [a/(a+b)] / [c/(c+d)]. OR = (a×d) / (b×c). ARD = Risk(exposed) - Risk(unexposed). NNT = 1 / |ARD|. χ² = Σ[(O-E)²/E].

Example Calculation

Result: RR = 1.714, OR = 3.857, ARD = 31.25%

Risk(exposed) = 30/40 = 75%. Risk(unexposed) = 70/160 = 43.75%. RR = 75/43.75 = 1.714 — exposed group has 71.4% higher risk. OR = (30×90)/(10×70) = 3.857.

Tips & Best Practices

  • Always report the confidence interval alongside the point estimate.
  • Check if the CI for RR includes 1.0 to assess statistical significance.
  • NNT is more clinically meaningful than RR for treatment decisions.
  • For case-control studies, use odds ratio (RR cannot be computed directly).
  • Low event rates make RR and OR approximately equal.
  • The chi-squared test has limited accuracy when expected cell counts are below 5.

Cohort Studies vs Case-Control Studies

In cohort studies, you follow exposed and unexposed groups forward and observe outcomes, allowing direct calculation of relative risk. In case-control studies, you start with cases (outcomes) and controls, then look back at exposure — here, only the odds ratio can be calculated directly. The rare disease assumption lets us approximate RR from OR when the outcome is rare.

Clinical Significance vs Statistical Significance

A large study might find a statistically significant RR of 1.02 — the CI excludes 1.0, but the 2% increase in risk has negligible clinical impact. Conversely, a small study might find RR = 3.0 with a wide CI that includes 1.0 — clinically important but statistically uncertain. The NNT helps bridge this gap by expressing results in practical, patient-level terms.

Confounding and Adjustment

Raw relative risk from a 2×2 table doesn't account for confounders. In practice, researchers use stratified analysis (Mantel-Haenszel method) or regression (Cox, logistic) to adjust for age, sex, and other variables. It gives the unadjusted (crude) estimates, which should be interpreted alongside adjusted analyses.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • Relative risk compares probabilities (risks) between groups. Odds ratio compares odds. In rare outcomes (<10%), they are approximately equal. For common outcomes, the OR overestimates the RR. RR is preferred in cohort studies; OR is used in case-control studies.