Compute the relative risk (risk ratio) from a 2x2 contingency table, events-and-totals, or convert a published odds ratio to a risk ratio using the Zhang-Yu (1998) adjustment. Returns the RR with a log-Wald confidence interval, p-value, absolute risk difference, and number needed to treat, with Haldane-Anscombe correction for zero cells. Copy R, Python, or APA output directly into your manuscript.
Enter the number of events (people with the outcome) and the total number of people in each arm. Standard layout for cohort studies and randomized trials.
Exposed / treatment group
People with the outcome
Unexposed / control group
People with the outcome
Relative risk is the most intuitive effect measure for prospective designs because it is a ratio of probabilities, not a ratio of odds. In a cohort study or a randomized controlled trial you can directly estimate the probability of the outcome in each group, so the question becomes how the risk in the exposed or treated group compares to the risk in the control group. Cummings (2009) and Greenland (1987) argue that the relative risk should be the default effect measure for these designs because it maps cleanly onto how clinicians and patients reason about treatment effects, while the odds ratio is more useful for case-control studies where direct risk estimation is impossible.
The arithmetic is straightforward. For a 2x2 table with cells a, b, c, d the risk in the exposed group is a divided by (a plus b) and the risk in the unexposed group is c divided by (c plus d); the relative risk is the first divided by the second. Katz et al. (1978) derived the closed-form log-Wald confidence interval that this calculator uses, which the Cochrane Handbook (Higgins et al. 2024) treats as the default for individual studies. For sparse data, alternative methods such as the inverse hyperbolic sine, Koopman score, or Miettinen score intervals can be more accurate, but they require iterative computation and are reserved for situations where Wald intervals misbehave.
Conversion between OR and RR is a common need because much of the published literature reports odds ratios from logistic regression even when the design is a cohort study or trial. Zhang and Yu (1998) gave the standard correction formula: RR equals OR divided by (1 minus p0 plus p0 multiplied by OR), where p0 is the baseline risk in the control group. This calculator implements that conversion in a dedicated tab and transforms the confidence interval bounds through the same function so the corrected RR has a usable interval. The conversion is most useful when p0 exceeds roughly 10 percent, because below that threshold the OR and RR are numerically close.
Three reporting reminders matter. First, always pair the RR with the absolute risks in each group so readers can judge clinical magnitude. A small RR can correspond to a large absolute benefit when baseline risk is high, and a large RR can be clinically trivial when baseline risk is low. Second, log(RR) and its standard error are the values you feed into a forest plot or meta-regression because they are approximately normally distributed across studies. Third, when several 2x2 tables share an exposure-outcome contrast, the Mantel-Haenszel calculator pools them while preserving the conditional structure that fixed-effect meta-analysis requires.
For clinical communication the most useful companions to the RR are the absolute risk reduction and the number needed to treat. The calculator reports both with their confidence intervals. For full systematic reviews and meta-analyses of binary outcomes, our meta-analysis service handles effect size extraction, pooling, heterogeneity, subgroup analysis, and publication-bias assessment to Cochrane and PRISMA 2020 standards, with reproducible code and a journal-ready manuscript delivered by a PhD statistician.
2x2 table for raw cell counts, events and totals for grouped data, or Convert OR to RR when you only have a published odds ratio and a baseline risk.
95 percent is the journal default. Leave Haldane-Anscombe on auto so the 0.5 correction activates only when a cell is zero.
Type the counts, the events-and-totals, or the OR with CI plus baseline risk. Results update live for RR, ARD, NNT, and the p-value.
The narrative panel translates the RR into plain English, flags whether the CI excludes 1, and shows absolute risks and NNT for clinical context.
Copy reproducible epitools or statsmodels code for your analysis script, or paste an APA-formatted results sentence into your manuscript.
Next step
A PhD statistician pools every 2x2 table on the risk-ratio scale, runs Mantel-Haenszel and random-effects, checks heterogeneity, and delivers a publication-ready forest plot, GRADE summary, and manuscript.
Our promise: Free re-run of the pooled analysis if reviewers question the estimate or model.
Starting from the research question, not just the data? We run the whole systematic review and meta-analysis end to end.
Quote my review + meta-analysisTimeline
Most projects deliver in under 2 weeks. We confirm an exact date in your quote.
If reviewers push back
If reviewers question the pooled estimate or model choice, we re-run and re-write the analysis free.
Confidentiality
NDA available on request before any project discussion. Your data, study design, and manuscript stay private either way.
Want a PhD methodologist to handle the whole project?
Get a complete cohort or trial meta-analysis with pooled RR, OR, ARD, and NNT delivered in a publication-ready manuscript by a PhD statistician. Free re-run of the pooled analysis if reviewers question the estimate or model. Pay only after you approve your quote.
An RR of 2 means very different things at baseline risks of 1 percent versus 30 percent. Reporting the absolute risks in each group lets readers translate the relative effect into clinical impact.
Use RR for cohort studies, randomized trials, and any design where you can estimate baseline risk directly. For case-control studies the odds ratio is the correct measure.
When the control-group baseline risk exceeds about 10 percent, the published OR overstates the RR. The Zhang-Yu (1998) conversion lets you report a corrected RR alongside the original OR.
Default to Haldane-Anscombe (+0.5 per cell) for standard analyses. For meta-analysis with zero events on one side, the calculator's adjusted counts feed directly into a Mantel-Haenszel pool.
Relative risk (RR), also called the risk ratio, is the probability of an outcome in an exposed or treated group divided by the probability in an unexposed or control group. For a 2x2 table with exposed events a, exposed non-events b, unexposed events c, and unexposed non-events d, RR equals (a divided by (a plus b)) divided by (c divided by (c plus d)). RR equals 1 means no difference in risk; RR above 1 means higher risk with exposure; RR below 1 means lower risk.
Relative risk is a ratio of probabilities, while the odds ratio is a ratio of odds. When the outcome is rare (baseline risk below about 10 percent) the two are numerically close, but as the outcome becomes common the OR diverges from the RR and exaggerates the apparent effect. Cummings (2009) showed that this divergence is the main reason readers misinterpret published ORs as if they were RRs. Use RR for cohort studies, randomized trials, and any prospective design where you can estimate baseline risk directly; use OR for case-control studies and logistic regression.
An RR of 1.5 means people in the exposed group are 1.5 times as likely to experience the outcome as people in the unexposed group, which is a 50 percent higher risk in relative terms. The absolute size of that increase depends on the baseline risk: an RR of 1.5 against a baseline of 4 percent moves risk to 6 percent (2 percentage points), while the same RR against a baseline of 40 percent moves risk to 60 percent (20 percentage points). Always report the RR together with the baseline risks in each group so readers can judge clinical importance.
The calculator uses the Katz et al. (1978) log-Wald interval. The standard error of log(RR) equals the square root of ((1 minus risk1) divided by (risk1 multiplied by n1) plus (1 minus risk2) divided by (risk2 multiplied by n2)). The 95 percent CI on the RR scale is exp(log(RR) plus or minus 1.96 multiplied by SE). This interval is the Cochrane Handbook default for risk ratios. For sparse data, exact methods such as the inverse hyperbolic sine or Koopman score interval are more accurate; our biostatistics service uses these when needed.
When any cell of the 2x2 table equals zero, the risk in that group is zero or undefined and the log-Wald standard error formula divides by zero. Haldane (1956) and Anscombe (1956) proposed adding 0.5 to every cell as a routine fix that produces a finite RR with a usable confidence interval. The correction introduces a small downward bias in the absolute RR magnitude but is the default in Cochrane and in major statistical packages. The calculator applies it automatically only when a zero cell appears; you can also force it on every table or turn it off entirely.
Yes. The Convert OR to RR tab implements the Zhang-Yu (1998) adjustment: RR equals OR divided by (1 minus p0 plus p0 multiplied by OR), where p0 is the baseline risk in the unexposed or control group. This is the formula recommended by the Cochrane Handbook for converting a published OR with a known control-group risk. The conversion also transforms the confidence interval bounds through the same function. When p0 is small (below about 5 percent) the OR and RR are nearly identical; when p0 is large the difference can be substantial, so always report p0 alongside the converted RR.
Report both. The relative risk summarises the proportional effect of an exposure or treatment, which is what generalises across populations with similar biology. The absolute risk reduction (ARR) and number needed to treat (NNT) summarise the local clinical impact, which is what individual patients and policymakers act on. A treatment with a large RR can have a trivial ARR when baseline risk is low, and a treatment with a modest RR can have a large ARR when baseline risk is high. The calculator reports both with their confidence intervals so your manuscript can speak to both audiences.
The p-value is a Wald z-test of the null hypothesis that log(RR) equals zero, equivalent to RR equals 1. The z statistic is log(RR) divided by SE(log RR), and the two-sided p-value is twice the upper tail of the standard normal. For 2x2 tables with cells of at least 5 this Wald p-value usually agrees with the chi-square test. For sparse tables, Fisher's exact test (available in our chi-square calculator) is preferred.
The 2x2 and events-and-totals modes assume cumulative incidence: each person is either an event or a non-event by the end of follow-up. For incidence rate data (events per person-time) the appropriate measure is the incidence rate ratio (IRR), which uses a different standard error formula based on person-time denominators. If your data are time-to-event with censoring, the hazard ratio from a Cox model is the right summary; for systematic reviews involving time-to-event outcomes, our meta-analysis service handles digitisation of published Kaplan-Meier curves and reconstruction of individual-patient data.
Report the RR with its confidence interval on the RR scale, because that is the format clinicians expect. The log(RR) and its standard error are needed only when you are pooling effect sizes into a meta-analysis, where the log scale is approximately normal and additive. The calculator exposes both so you can paste log(RR) and SE directly into a forest plot or meta-regression workflow.
For case-control studies and logistic regression, the odds ratio calculator handles the same 2x2 structure but returns OR with the log-Wald CI. To pool several 2x2 tables across studies, the Mantel-Haenszel calculator produces a stratified summary RR or OR. To plot every included study and the pooled effect, use the forest plot generator. To convert an RR into number needed to treat for a target baseline risk, the NNT calculator handles the back-and-forth. For a contingency-table test that does not assume large cells, see the chi-square calculator, which also runs Fisher's exact test for sparse data.
Reviewed by
Dr. Sarah Mitchell holds a PhD in Biostatistics from Johns Hopkins Bloomberg School of Public Health and has over 15 years of experience in systematic review methodology and meta-analysis. She has authored or co-authored 40+ peer-reviewed publications in journals including the Journal of Clinical Epidemiology, BMC Medical Research Methodology, and Research Synthesis Methods. A former Cochrane Review Group statistician and current editorial board member of Systematic Reviews, Dr. Mitchell has supervised 200+ evidence synthesis projects across clinical medicine, public health, and social sciences. She reviews all Research Gold tools to ensure statistical accuracy and compliance with Cochrane Handbook and PRISMA 2020 standards.
From data cleaning and assumption checks to the full analysis and a publication-ready results section, we handle the numbers so you can focus on the science.
Our promise: Free re-run and re-write if reviewers question the analysis or reporting.
Your project is led by a named PhD methodologist with real credentials and published work.
4.9 / 5 across 1,194+ delivered projects