Enter four counts and get relative risk, odds ratio, risk difference, number needed to treat and 95% intervals by the log method, with a worked example and a plain-language rule for when the odds ratio overstates the risk ratio.
Free sandbox · No credit card · 21 CFR Part 11 aligned
Relative risk (95% CI)
2.00 (1.15 to 3.48)
Odds ratio (95% CI)
2.43 (1.21 to 4.87)
Risk difference / NNT
15 pts / 7
30%
15%
The short answer
The 2x2 table
The event is "responder". The counts are demo data.
| Event (responder) | No event | Total | Risk | |
|---|---|---|---|---|
| Treatment | 30 (a) | 70 (b) | 100 | 0.30 |
| Control | 15 (c) | 85 (d) | 100 | 0.15 |
RR = 0.30 / 0.15 = 2.00. OR = (30 × 85) / (70 × 15) = 2550 / 1050 = 2.43. Risk difference = 0.15.
The calculation
The four measures answer different questions from the same table. Relative risk (risk ratio) asks "how many times as likely is the event in the treated group?": here 2.00. Odds ratio compares the odds of the event, odds being the event count over the non-event count, 30/70 against 15/85, which is 2.43. Risk difference (absolute risk reduction or increase) asks "how many more events per 100 people?": 15. Number needed to treat is its reciprocal, the number of people treated for one additional responder: 1 / 0.15 = 6.67, rounded up to 7 by convention (Laupacis, Sackett and Roberts, 1988). The number needed to treat calculator covers the interpretation and the interval in more detail.
For the intervals, take the natural log, add and subtract 1.96 standard errors, and exponentiate. For the RR, SE(ln RR) = √(1/30 − 1/100 + 1/15 − 1/100) = 0.283, so the interval is exp(0.693 ± 1.96 × 0.283) = 1.15 to 3.48. For the OR, SE(ln OR) = √(1/30 + 1/70 + 1/15 + 1/85) = 0.355, giving exp(0.887 ± 1.96 × 0.355) = 1.21 to 4.87. The risk difference uses a plain normal interval, SE = √[0.30 × 0.70/100 + 0.15 × 0.85/100] = 0.058, so 0.15 ± 0.114, or 0.036 to 0.264. The NNT interval is the reciprocal of those limits, 1/0.264 to 1/0.036, about 4 to 28. When the risk-difference interval would include zero, the NNT interval does not exist in the usual sense (it passes through infinity), which is why papers report it carefully.
These are Wald-type intervals, adequate with a reasonable number of events in every cell. With few events they can be too narrow or too wide, and a statistician may prefer Newcombe, exact or profile-likelihood methods. Take the same 100-per-arm design but with 8 responders versus 2: the RR is 4.00 (0.87 to 18.4) and the OR is 4.26 (0.88 to 20.6). The point estimates look dramatic, the intervals include 1, and a single patient moving from one cell to another would change the picture. Report intervals alongside the estimates, and read an estimate from a handful of events with suspicion.
When the OR overstates the RR
OR = RR × (1 − control risk) / (1 − RR × control risk). The table fixes RR at 1.5 and varies the risk in the control group.
| Control risk | Treated risk (RR 1.5) | Odds ratio | OR is higher than RR by |
|---|---|---|---|
| 1% | 1.5% | 1.51 | 0.5% |
| 5% | 7.5% | 1.54 | 3% |
| 10% | 15% | 1.59 | 6% |
| 20% | 30% | 1.71 | 14% |
| 40% | 60% | 2.25 | 50% |
Illustrative values from the identity above. The same pattern holds below 1: an RR of 0.5 corresponds to an OR of 0.497 at 1% control risk and 0.375 at 40%.
Choosing and reporting
The odds ratio is not wrong, but it is easy to misread. Readers interpret "OR 2.25" as "2.25 times as likely", which is true of the risk ratio, not the odds ratio. In the 40% control-risk row, an OR of 2.25 describes a risk that is only 1.5 times higher (60% against 40%). The gap is small below about 10% and large above 20%, so for common outcomes such as response, remission or retention, a trial that reports an odds ratio should also give the risks in each arm. Zhang and Yu (1998) showed how often OR-based text overstates the effect in cohort data with common outcomes.
Design determines what is estimable. A randomised trial or cohort study follows exposed and unexposed groups and can estimate the RR, the risk difference and the NNT directly. A case-control study samples by outcome, so risks are not available; the OR is estimable and approximates the RR only if the outcome is rare in the source population. Logistic regression returns adjusted odds ratios, and if the outcome is common you may want a log-binomial or modified Poisson model for an adjusted RR instead. Those choices belong in the statistical analysis plan, with a statistician.
A zero cell is a different problem. Suppose 0 of 50 patients on treatment and 5 of 50 on control have the event (a 2x2 table with a = 0). The odds ratio is zero, its standard error is infinite and the log method fails. Adding 0.5 to every cell gives an OR of 0.082 with a 95% interval of 0.004 to 1.52, and the risk difference is −0.10 (Wald −0.18 to −0.02, which is itself unreliable with a zero count). The correction changes the answer, and the choice of correction should be stated. With zeros present, exact tests and exact confidence intervals are the better route.
Three further points keep the 2x2 table honest. First, the table counts people with the event at a fixed time and ignores when events happened; if follow-up differs between arms or the endpoint is time to event, a hazard ratio from a survival analysis is the right measure, and the survival sample size calculator belongs to that design. Second, define who is in the denominator: the intention-to-treat population, with a rule for missing outcomes, gives a different table from a completers-only count, and the difference is exactly what the dropout discussion in the dropout-adjusted sample size calculator is about. Third, if randomisation was stratified or the data come from several centres, a single pooled table can mislead, and a stratified estimate such as Mantel–Haenszel is preferable. Reporting guidance for randomised trials (CONSORT) asks for the absolute and the relative effect for binary outcomes, which is why this page gives all four measures together.
Build the eCRFs, edit checks and visit schedule in the free sandbox with every feature. No credit card, no time limit. You pay only when you go live with real participants.
Getting the 2x2 table from the study
A ratio is only as reliable as the event definition behind the four counts. In Capture, the event is built as a field on an eCRF, often a single-choice responder flag or a derived value, and a calculated field can derive the classification (for example "percent change in score of at least 30%") from two entered values and show it read-only, so every site applies the same rule. Range and custom edit checks raise an auto-query when entries conflict, query management tracks them to resolution, and the field-level audit trail records the old value, new value and reason for any change, so the events counted at database lock can be traced.
Randomised allocation is recorded through randomization, blinded roles never receive treatment-arm values, and the export supplies the arm and the event flag in a wide CSV or Excel file with a data dictionary for tabulation, or as SDTM datasets (SAS XPT with Define-XML). For safety outcomes the same table applies to adverse-event incidence, and the adverse event reporting software page describes how events are captured. If the endpoint is a rate you must plan, the two-proportions sample size calculator sizes the study, and the Cohen’s kappa calculator checks whether two reviewers classify events consistently before you count them.
Decision rule
Report the risk in each arm, the RR with its interval and the risk difference. Add the NNT when the difference is clearly non-zero.
Report the OR with its interval; do not call it a risk ratio or compute risks from the sample.
Prefer RR and risk difference; if an OR is reported, show the arm risks beside it.
Treat Wald intervals with caution and ask for an exact or Newcombe interval.
State the correction used, or use an exact method; do not report the corrected OR as if it were observed.
Pre-specify the model (logistic, log-binomial, modified Poisson) in the SAP and confirm with a statistician.
Relative risk compares the probability of the event in two groups (30% against 15% gives 2.00). The odds ratio compares the odds (30/70 against 15/85 gives 2.43). They are close when the event is rare and diverge as it becomes common.
With a and b the event and non-event counts in the exposed or treated group and c and d in the comparison group: RR = [a/(a+b)] / [c/(c+d)]. In the worked example it is 0.30 / 0.15 = 2.00.
On the log scale: exp(ln RR ± 1.96 × SE), with SE(ln RR) = √[1/a − 1/(a+b) + 1/c − 1/(c+d)]. For the example, SE is 0.283 and the interval is 1.15 to 3.48. The odds ratio interval uses SE(ln OR) = √(1/a + 1/b + 1/c + 1/d).
When the outcome is common. At 1% control risk an RR of 1.5 corresponds to an OR of 1.51; at 40% control risk the same RR corresponds to an OR of 2.25. Below about 10% the two are close. Always give the risks in each arm.
NNT = 1 / absolute risk difference, rounded up. A 15-point difference gives 6.67, so 7. The interval is the reciprocal of the risk-difference limits (here about 4 to 28) and is only well defined if the risk-difference interval excludes zero.
The odds ratio is undefined with a zero cell. A 0.5 continuity correction (Haldane–Anscombe) gives a finite estimate, but it alters the result and should be disclosed. Exact methods are preferable when events are few; discuss with a statistician.
You can compute the OR and its interval, but risks, RR, risk difference and NNT are not estimable from a design that samples by outcome. The OR approximates the RR only when the outcome is rare in the source population.
No. The worked values were reproduced with an independent script, but this page is a reference aid, not validated software. A statistician should confirm the interval method and any adjusted analysis before results are reported.
Keep exploring
Number needed to treat calculator
NNT and its interval in detail.
Two-proportions sample size calculator
Size a study for a binary endpoint.
Cohen’s kappa calculator
Agreement on event classification.
Prevalence sample size calculator
Precision for a single proportion.
Adverse event reporting software
Capturing the events you count.
Randomization software
The allocation behind the two arms.
Build the eCRFs, edit checks and visit schedule in the free sandbox with every feature. No credit card, no time limit. You pay only when you go live with real participants.