Relative Risk Calculator
How it Works
01Enter 2×2 Table Data
Provide events and totals for both exposed and unexposed groups.
02Compute Group Risks
Risk in each group = events / total. Compared as a ratio.
03Get Relative Risk (RR)
RR = Risk(exposed) / Risk(unexposed). RR > 1 means increased risk.
04ARR & NNT
Absolute risk reduction and number needed to treat for clinical context.
Introduction
The relative risk calculator takes four inputs from a 2×2 contingency table: the number of events and non-events in both the exposed and unexposed groups. From these, it computes the risk in each group, the relative risk, the absolute risk reduction (ARR), the number needed to treat (NNT), and the attributable risk.
A relative risk of 1.0 means no difference between groups. RR > 1 indicates increased risk in the exposed group; RR < 1 indicates reduced risk (protective effect). For example, RR = 2.0 means the exposed group has twice the risk of the outcome compared to the unexposed group.
Relative risk is used in cohort studies and randomized controlled trials (RCTs), where participants are followed over time to observe who develops the outcome. It is distinct from the odds ratio (OR), which is used in case-control studies and logistic regression.
Understanding relative risk is essential for evaluating vaccine effectiveness, drug efficacy, occupational hazard exposure, lifestyle risk factors, and many other public health interventions. This calculator simplifies the 2×2 table calculations and provides all key epidemiological measures in one place.
The formula
RE = a / (a + b)
Risk in Unexposed Group:
RU = c / (c + d)
Relative Risk:
RR = RE / RU
Absolute Risk Reduction (ARR):
ARR = RU − RE (for protective exposures)
Number Needed to Treat (NNT):
NNT = 1 / ARR
2×2 Table:
| | Outcome+ | Outcome− |
|Exposed| a | b |
|Unexposed| c | d |
Calculation In Practice
Risk vaccinated = 10/500 = 0.02 (2%)
Risk unvaccinated = 80/500 = 0.16 (16%)
RR = 0.02 / 0.16 = 0.125
Interpretation: Vaccinated individuals have 87.5% lower risk.
ARR = 0.16 − 0.02 = 0.14 (14%)
NNT = 1 / 0.14 = 7.1 (vaccinate 7.1 people to prevent 1 case)
Typical Use Cases
Clinical Trials
Vaccine Studies
Occupational Health
Nutritional Epidemiology
Public Health Policy
Technical Reference
ln(RR) ± 1.96 × √(1/a − 1/(a+b) + 1/c − 1/(c+d))
CI = e^[ln(RR) ± margin]
Vaccine Efficacy:
VE = (1 − RR) × 100%
Attributable Risk (AR):
AR = RE − RU (excess risk due to exposure)
Population Attributable Risk (PAR):
PAR = (prevalence of exposure × AR) / overall risk
RR vs Odds Ratio:
Key Takeaways
For rare outcomes (<10% prevalence), odds ratios approximate relative risks. For common outcomes, relative risk is preferable because odds ratios tend to exaggerate effect sizes. The NNT derived from absolute risk reduction is particularly useful for clinical decision-making and policy evaluation.
Remember: relative risk is a ratio of probabilities, not a ratio of counts. Ensure your inputs correctly populate the 2×2 contingency table before interpreting results.