Odds ratio and risk ratio from a 2×2 table

Enter the four counts of a 2×2 table to get the odds ratio, risk ratio and risk difference with confidence intervals.

Your data does not go to our server. This tool runs in your browser; what you type or open never leaves your device.

This calculator needs JavaScript, because it calculates in your browser and sends nothing. Turn JavaScript on to use it. How it is calculated is explained below.

How it is calculated

The intervals are calculated on the logarithmic scale (Woolf for the odds ratio, Katz for the risk ratio) and converted back; the risk difference uses the usual normal approximation.

Counts must be whole numbers. If any cell is zero, 0.5 is added to all four cells and the tool says so.

  • OR = (a × d) / (b × c); SE(ln OR) = √(1/a + 1/b + 1/c + 1/d)
  • RR = [a / (a + b)] / [c / (c + d)]; SE(ln RR) = √(1/a − 1/(a + b) + 1/c − 1/(c + d))
  • RD = a / (a + b) − c / (c + d)

Worked example: Counts 20, 80, 10 and 90: odds ratio 2.25 (0.99 to 5.09), risk ratio 2.00 (0.99 to 4.05).

Sources

These calculators support research; they do not replace the advice of a statistician or a clinician.

Questions

Which of the three should I report?

In a case-control study only the odds ratio is valid. In a cohort study or a trial the risk ratio and the risk difference are also meaningful, and are easier to interpret.

All free tools

WhatsApp Tell the Editor
Submit manuscript Contact