How do we Calculate a Confidence Interval for an Odds Ratio?

A confidence interval for an odds ratio is calculated by first taking the natural log of the odds ratio, adding and subtracting a margin of error based on the level of confidence desired, and then converting the result back into odds ratios. This gives an estimate of the range of values that the true odds ratio is likely to be within the specified level of confidence.


We often calculate an odds ratio when analyzing a 2×2 table, which takes on the following format:

The odds ratio tells us the ratio of the odds of an event occurring in a treatment group to the odds of an event occurring in a control group. It is calculated as:

  • Odds ratio = (A*D) / (B*C)

We can then use the following formula to calculate a confidence interval for the odds ratio:

  • Lower 95% CI = eln(OR) – 1.96√(1/a + 1/b + 1/c + 1/d)
  • Upper 95% CI = eln(OR) + 1.96√(1/a + 1/b + 1/c + 1/d)

The following example shows how to calculate an odds ratio and a corresponding confidence interval in practice.

Example: Calculating a Confidence Interval for an Odds Ratio

Suppose a basketball coach uses a new training program to see if it increases the number of players who are able to pass a certain skills test, compared to an old training program.

The coach recruits 50 players to use each program. The following table shows the number of players who passed and failed the skills test, based on the program they used:

We can calculate the odds ratio as (34*11) / (16*39) = 0.599

We would interpret this to mean that the odds that a player passes the test by using the new program are just 0.599 times the odds that a player passes the test by using the old program.

In other words, the odds that a player passes the test are actually lowered by 40.1% by using the new program.

We can then use the following formulas to calculate the 95% confidence interval for the odds ratio:

  • Lower 95% CI = eln(.599) – 1.96√(1/34 + 1/16 + 1/39 + 1/11) = 0.245
  • Upper 95% CI = eln(.599) + 1.96√(1/34 + 1/16 + 1/39 + 1/11) = 1.467

Thus, the 95% confidence interval for the odds ratio is [0.245, 1.467].

Since this confidence interval contains the value 1, it is not statistically significant.

This should make sense if we consider the following:

  • An odds ratio greater than 1 would mean that the odds that a player passes the test by using the new program are higher than the odds that a player passes the test by using the old program.
  • An odds ratio less than 1 would mean that the odds that a player passes the test by using the new program are lower than the odds that a player passes the test by using the old program.

So, since our 95% confidence interval for the odds ratio contains the value 1, it means the odds of a player passing the skills test using the new program may or may not be higher than the odds of the same player passing the test using the old program.

The following tutorials provide more information on interpreting odds ratios:

x