Calculate relative risk, odds ratio, absolute risk difference, and NNT from a 2×2 contingency table. Includes 95% confidence intervals and chi-squared test.
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.
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.
RR = [a/(a+b)] / [c/(c+d)]. OR = (a×d) / (b×c). ARD = Risk(exposed) - Risk(unexposed). NNT = 1 / |ARD|. χ² = Σ[(O-E)²/E].
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.
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.
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.
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. This calculator provides the unadjusted (crude) estimates, which should be interpreted alongside adjusted analyses.
Last updated:
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.
An RR of 1.0 means no association — the exposure does not affect the outcome. RR > 1 indicates increased risk with exposure. RR < 1 indicates decreased risk (protective effect). The 95% CI tells you if the result is statistically significant (CI excludes 1.0).
Number Needed to Treat (NNT) is the number of patients who must be treated for one additional patient to benefit. It equals 1/|ARD|. Lower NNT means more effective treatment. NNH (Number Needed to Harm) uses the same formula when exposure increases risk.
Relative risk tells you the strength of association. Absolute risk difference tells you the actual impact. A treatment that reduces risk from 0.02% to 0.01% has RR = 0.5 (impressive sounding) but ARD = 0.01% (tiny real impact). Always report both.
If the 95% CI for RR includes 1.0, the result is not statistically significant at p = 0.05. The narrower the CI, the more precise the estimate. Wide CIs suggest small sample sizes or high variability.
The attributable fraction among the exposed (AFe) estimates what proportion of cases in exposed individuals can be attributed to the exposure. AFe = (RR-1)/RR. It's useful for public health planning.