Relative Risk Calculator
Our biostatistics calculator computes relative risk accurately. Enter measurements for results with formulas and error analysis.
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer
Relative Risk Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: RR = (a/b) / (c/d)
Worked example โ RR = 9.0 (95% CI: 3.63-22.30) | Smokers have 9x the lung cancer risk | NNT = 13
Formula
RR = (a/b) / (c/d)
Where a = events in exposed group, b = total in exposed group, c = events in unexposed group, d = total in unexposed group. The 95% confidence interval is calculated using the log transformation: CI = exp(ln(RR) +/- z * SE(ln(RR))), where SE(ln(RR)) = sqrt(1/a - 1/b + 1/c - 1/d).
Worked Examples
Example 1: Smoking and Lung Cancer Risk
Problem:In a cohort study, 45 out of 500 smokers developed lung cancer vs 5 out of 500 non-smokers. Calculate the relative risk.
Solution:Risk in exposed (smokers) = 45/500 = 0.09 (9%) Risk in unexposed (non-smokers) = 5/500 = 0.01 (1%) RR = 0.09 / 0.01 = 9.0 ln(RR) = 2.197, SE(ln RR) = sqrt(1/45 - 1/500 + 1/5 - 1/500) = 0.463 95% CI = exp(2.197 +/- 1.96 * 0.463) = (3.63, 22.30) ARD = 0.09 - 0.01 = 0.08, NNT = 1/0.08 = 13
Result:RR = 9.0 (95% CI: 3.63-22.30) | Smokers have 9x the lung cancer risk | NNT = 13
Example 2: Vaccine Efficacy Study
Problem:In a vaccine trial, 8 of 1000 vaccinated participants got infected vs 40 of 1000 in the placebo group. Calculate vaccine efficacy.
Solution:Risk in vaccinated = 8/1000 = 0.008 (0.8%) Risk in placebo = 40/1000 = 0.04 (4%) RR = 0.008 / 0.04 = 0.20 Vaccine Efficacy = (1 - RR) * 100 = 80% 95% CI for RR: (0.094, 0.426) ARD = 0.008 - 0.04 = -0.032, NNT = 1/0.032 = 32
Result:RR = 0.20 (80% vaccine efficacy) | 95% CI: 0.094-0.426 | NNT = 32 vaccinations to prevent 1 infection
Frequently Asked Questions
What is relative risk and how is it calculated?
Relative risk (RR), also called risk ratio, compares the probability of an event occurring in an exposed group versus an unexposed group. RR = (events in exposed / total exposed) / (events in unexposed / total unexposed). An RR of 2.0 means the exposed group has twice the risk of the outcome compared to the unexposed group. An RR of 0.5 means the exposed group has half the risk (protective effect). RR = 1.0 means no difference. Relative risk is used in cohort studies and randomized controlled trials where you can directly measure incidence rates in both groups.
What is the difference between relative risk and odds ratio?
Relative risk compares probabilities (risk in exposed / risk in unexposed), while odds ratio compares odds (odds in exposed / odds in unexposed). When the outcome is rare (< 10% incidence), RR and OR are approximately equal. As the outcome becomes more common, OR increasingly overestimates the RR. For example, if risk is 30% vs 10%, RR = 3.0 but OR = 3.86. RR is more intuitive and preferred when calculable (cohort studies, RCTs). OR is used in case-control studies where true incidence cannot be determined. Always specify which measure you are reporting.
How do I interpret the confidence interval for relative risk?
The confidence interval (CI) provides a range of plausible values for the true population RR. A 95% CI means we are 95% confident the true RR falls within this range. The key is whether the CI crosses 1.0: if entirely above 1.0 (e.g., 1.5-3.2), the increased risk is statistically significant. If entirely below 1.0 (e.g., 0.3-0.8), the protective effect is significant. If the CI includes 1.0 (e.g., 0.8-1.4), the result is not statistically significant. Narrower CIs indicate more precise estimates, typically from larger sample sizes.
What is Number Needed to Treat (NNT) and how does it relate to RR?
NNT is the number of patients who need to be treated to prevent one additional adverse event, calculated as 1 / absolute risk difference. It translates relative risk into a clinically meaningful metric. For example, if a drug reduces mortality from 10% to 7%, the absolute risk reduction is 3%, and NNT = 1/0.03 = 34. This means you need to treat 34 patients to prevent one death. NNT complements RR because a large RR can correspond to a small absolute benefit when the baseline risk is low. A drug cutting risk by 50% (RR=0.5) from 2% to 1% has NNT=100, while the same RR from 40% to 20% has NNT=5.
When should I use relative risk vs absolute risk reduction?
Both measures should be reported together as they provide complementary information. Relative risk is useful for understanding the strength of association between exposure and outcome across different populations. Absolute risk reduction (ARD) is better for clinical decision-making because it accounts for baseline risk. Drug advertisements often emphasize RR because it sounds more impressive: a drug that reduces heart attack risk by 50% (RR=0.5) sounds better than saying it reduces risk from 2% to 1% (ARD=1%). Health literacy research shows that patients make better decisions when given absolute risks rather than relative risks.
References
Background & Theory
History
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer ยท Editorial policy
Related Calculators
๐งฎAlpaca Gestation Calculator
Calculate alpaca gestation with inputs, formulas, and instant results.
๐งฎCat Pregnancy Calculator โ Due Date & Gestation
Calculate cat pregnancy with inputs, formulas, and instant results.
๐งฎCow Gestation Calculator
Calculate cow gestation with inputs, formulas, and instant results.
๐งฎDog Pregnancy Calculator: Due Date by Breed
Calculate dog pregnancy with inputs, formulas, and instant results.
๐งฎGoat Gestation Calculator
Calculate goat gestation with inputs, formulas, and instant results.
๐งฎGuinea Pig Pregnancy Calculator โ Due Date
Calculate guinea pig pregnancy with inputs, formulas, and instant results.
๐งฎLlama Gestation Calculator
Calculate llama gestation with inputs, formulas, and instant results.
๐งฎMare Gestation Calculator
Calculate mare gestation with inputs, formulas, and instant results.