Relative Risk Calculator
Relative risk with confidence interval, risk difference, NNT and attributable risk from a 2×2 table.
Relative risk = risk in exposed ÷ risk in unexposed = [a/(a+b)] ÷ [c/(c+d)]. If 30 of 100 exposed and 10 of 100 unexposed people develop the outcome, RR = 0.30 ÷ 0.10 = 3.0 and the attributable risk is 0.20 (20 extra cases per 100 exposed).
Free, runs in your browser. Nothing you enter is uploaded.
How to use it
- Choose a clinical trial (treatment vs control) or a cohort (exposed vs unexposed).
- Enter the number with and without the outcome in each group.
- Read RR with its confidence interval, ARR, NNT and attributable risk.
What you enter
- Outcome and no-outcome counts in each group
What you get
- Relative risk with 95% CI
- ARR and RRR
- NNT
- Attributable risk and fractions
- Odds ratio
Formula
RR = [a/(a+b)] ÷ [c/(c+d)] | AR = a/(a+b) − c/(c+d) | NNT = 1 ÷ |ARR| | 95% CI = exp(ln RR ± 1.96 × SE)
Worked example
Input: Exposed 30/100, unexposed 10/100
Result: RR 3.0 (95% CI 1.55–5.80), AR 0.20, AF 66.7%
Exposure triples the risk; two thirds of cases among the exposed are attributable to exposure.
Questions
How do you calculate relative risk?
Divide the risk in the exposed group by the risk in the unexposed group. Risk is cases ÷ total in that group.
What does a relative risk of 1 mean?
The outcome is equally likely in both groups. Above 1 the exposure is linked to higher risk, below 1 to lower risk. A 95% CI that crosses 1 means the difference is not statistically significant.
What is the difference between ARR and RRR?
Absolute risk reduction is the plain difference in risk (control risk − treated risk). Relative risk reduction is that difference as a share of control risk. RRR can sound large when ARR is tiny.
How is NNT calculated?
NNT = 1 ÷ ARR, rounded up. An ARR of 0.05 means treating 20 people prevents one outcome.
When should I use odds ratio instead?
Use the odds ratio for case-control studies, where you cannot measure risk directly. RR needs cohort or trial data.
Limitations
- Assumes cohort or trial data; confidence intervals use the log (Katz) method and need non-zero cells.
References
- Altman DG, Andersen PK (1999) BMJ 319:1492-1495.
- Rothman KJ, Greenland S, Lash TL (2008), 3rd ed. Lippincott Williams & Wilkins.
Related reading
- Attributable Risk Formula: Definition and Worked Example
- Absolute Risk Reduction vs Relative Risk Reduction: Meaning, Formulas and Examples
More Statistics
- Standard Deviation Calculator
- Mean, Median & Mode Calculator
- Variance Calculator
- Z-Score Calculator
- P-Value Calculator
- Confidence Interval Calculator
- T-Test Calculator
- Chi-Square Test Calculator
- Correlation Coefficient Calculator
- Linear Regression Calculator
- Normal Distribution Calculator
- Probability Calculator
All free tools · By Dr. Zubair Khalid, DVM, MS, PhD.