Relative Risk Calculator - Risk Ratio, Odds Ratio, Risk Difference and NNT with Confidence Intervals
Relative Risk Calculator
Compare the risk in two groups from a 2 by 2 table
One Table, Four Measures
Relative risk, odds ratio, risk difference and number needed to treat from the same four counts.
Confidence Intervals
Each measure comes with an interval, so you can see how precise the estimate is.
Zero Cells Handled
If any count is zero the Haldane-Anscombe correction is applied and the result says so.
Private
Your numbers are not stored.
Risk Ratio or Odds Ratio
Studies often compare two groups, such as people exposed to something and people who are not, and count how many in each group had an outcome. The risk is the share of a group with the outcome. The relative risk (risk ratio) divides the exposed group’s risk by the unexposed group’s risk: 2.0 means twice the risk, 1.0 means no difference. The risk difference subtracts the two and the number needed to treat is its reciprocal: how many people need the exposure, or the treatment, for one extra outcome to occur or be prevented.
The odds ratio uses odds, the ratio of those with the outcome to those without, instead of risks. It is similar to the relative risk when the outcome is rare, but it overstates the effect when the outcome is common, so it should not be read as "times more likely" in that case. If the confidence interval of a ratio includes 1, or the interval of the risk difference includes 0, the data are compatible with no effect.
Key Takeaways
- Checked against SciPy: Risk ratio and odds ratio intervals match scipy.stats.contingency.
- Rare outcomes: Odds ratio and relative risk are close only when the outcome is uncommon.
- Related calculators: See also the Chi-Square Test Calculator and the Confidence Interval Calculator.