Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 7

Odds Ratios in 2x2 Tables

Recommended resources

Introduction

In our last lesson, we explored the relative risk (RR), a powerful measure for comparing the risk of an outcome between two groups. You learned that it answers the question, "How many times more likely is the outcome in the exposed group?" However, we also identified a critical limitation: the relative risk can only be calculated in studies where we can measure incidence directly, such as cohort studies. This leaves a major gap for other common study designs, like case-control studies.

Today, we will introduce the third and arguably most versatile measure of association for 2x2 tables: the odds ratio (OR). This measure is fundamental to categorical data analysis and forms the bedrock of logistic regression, a model you will encounter later in your program.

By the end of this lesson, you will be able to define, compute, and interpret the odds ratio, and most importantly, understand its key properties that make it so indispensable in data science and epidemiology.


1. The Building Block: Understanding "Odds"

Before we can tackle the odds ratio, we must be clear on what "odds" are. While used interchangeably with "probability" in casual language, in statistics, they are different concepts.

  • Probability is the ratio of an event happening to all possible outcomes.
  • Odds are the ratio of an event happening to the event not happening.

To see this distinction clearly, let's start with a simple, intuitive example.

A Guide To Odds Ratios: What They Are and How To Communicate Them Clearly

The video 'A Guide To Odds Ratios' from The Winton Centre begins with an excellent explanation of odds versus probability using a simple dice roll.

Please watch the first minute of the video, from 00:11 to 01:24. Focus on how the probability of rolling a six is calculated differently from the odds of rolling a six.

As the video showed, for rolling a six:

  • The probability is , or "one favorable outcome out of six total outcomes."
  • The odds are , or "one favorable outcome for every five unfavorable outcomes."

This distinction is the first crucial step to mastering the odds ratio.


2. From Odds to the Odds Ratio

Now that we understand odds, the odds ratio is a straightforward extension: it's simply the ratio of the odds in one group compared to the odds in another.

For a standard 2x2 table:

Event (e.g., Disease) No Event
Exposed a b
Unexposed c d
  1. Odds of the event in the exposed group:
  2. Odds of the event in the unexposed group:

The Odds Ratio (OR) is the ratio of these two odds:

This final simplified formula, , is known as the cross-product ratio. It provides a very simple way to calculate the odds ratio directly from the cell counts of a 2x2 table.

Odds Ratio Calculation and Confidence Interval
This image shows the standard 2x2 table layout and the formula for calculating the odds ratio and its confidence interval. Focus on the 'Odds Ratio Calculation' part for now.

Now, let's see a worked example.

A Guide To Odds Ratios: What They Are and How To Communicate Them Clearly

Let's return to the video 'A Guide To Odds Ratios'. The next section applies this calculation to a real-world study on cannabis use and depression.

Please watch from 01:36 to 04:04. Pay attention to how the odds are calculated for the 'depressed' and 'non-depressed' groups separately, and then divided to find the odds ratio.


3. Interpreting the Odds Ratio

The interpretation of the odds ratio is similar to that of the relative risk, with the null value being 1.

  • OR = 1: The odds of the event are the same in both groups. There is no association.
  • OR > 1: The odds of the event are higher in the exposed group. The exposure is a risk factor. For example, an OR of 3 means the odds of the outcome in the exposed group are 3 times the odds in the unexposed group.
  • OR < 1: The odds of the event are lower in the exposed group. The exposure is a protective factor.

A practical tip for interpretation: an OR of 0.25 can be tricky to phrase. It does not mean the odds are "0.25 times lower." It's often clearer to invert the ratio and switch the reference group. An OR of 0.25 for the exposed group is equivalent to an OR of for the unexposed group. You could then say: "The odds of the outcome were 4 times higher for the unexposed group compared to the exposed group."


4. Key Properties and Why the Odds Ratio is So Important

Your goal is to understand how these methods work in practice, and the properties of the odds ratio are central to its utility. To explore these, we'll use a detailed online resource.

3 Two-Way Tables: Independence and Association – STAT 504

The STAT 504 course notes from Penn State provide a comprehensive overview of the odds ratio's definition, calculation, and essential properties. We will break this down into a few key parts.

Please read the following sections from this webpage: Start at section 3.6 Odds Ratio. Read down to the paragraph that begins 'For the Vitamin C example...'. This covers the formal definition, the cross-product formula, and the method for calculating a confidence interval using the natural log. Next, read the subsection Properties of Odds Ratios. This explains how to interpret the OR and its relationship to independence. Finally, read section 3.7 Prospective and Retrospective Studies. This is the most critical part, as it explains the invariance property of the odds ratio.

Let's summarize the crucial takeaways from that reading.

a) The Invariance Property: The OR's Superpower

This is the single most important property to understand. As discussed in section 3.7 of the reading, the odds ratio value remains the same regardless of whether the study is prospective (like a cohort study, sampling on exposure) or retrospective (like a case-control study, sampling on the outcome).

  • In a cohort study, we can calculate both the RR and the OR.
  • In a case-control study, we cannot calculate the RR, but we can calculate the OR. Because of the invariance property, the OR we calculate from a case-control study provides a valid estimate of the association, which we couldn't get otherwise.

This makes the odds ratio the essential measure of association for case-control studies.

b) Relationship with Relative Risk

For a rare event (e.g., a rare disease), the odds ratio provides a good approximation of the relative risk. This is because if the probability of the event, , is small, then , which means:

Therefore, for rare events, . As the event becomes more common, the OR will increasingly overestimate the RR (i.e., the OR value will be further from 1.0 than the RR).

c) Mathematical Properties

  • Confidence Intervals: As the reading describes, the sampling distribution of the OR is skewed. We solve this by taking the natural logarithm, calculating a symmetric confidence interval for the , and then exponentiating the endpoints to transform it back to the OR scale.
  • Symmetry and Visualization: An OR of 2 represents an effect of the same magnitude as an OR of 0.5 (which is 1/2), just in the opposite direction. The log-transform makes this explicit: and . This is why statistical models like logistic regression work with log-odds, and why plots of odds ratios should use a logarithmic scale.
Visualizing Ratios: Correct vs. Incorrect Representations
This image illustrates why a logarithmic scale (implied in panel C) is the correct way to visualize ratios like the odds ratio. An OR of 2 (doubling of odds) and 0.5 (halving of odds) are effects of equal magnitude and should be depicted symmetrically around the null value of 1.0.

d) Handling Zeros

One practical failure point for the odds ratio is when any of the cell counts are zero. This will cause the formula to result in zero or infinity. A common solution, as mentioned in the STAT 504 reading, is to add a small value (typically 0.5) to every cell in the table before calculating the OR. This is known as the Haldane-Anscombe correction.


Conclusion

Today we've unpacked the odds ratio, a cornerstone of categorical data analysis. It is more than just another measure; its unique properties make it essential for certain study designs and foundational for advanced statistical models.

Key Takeaways:

  • Definition: The odds ratio is the ratio of the odds of an event in one group to the odds of the event in another group. It is calculated as the cross-product ratio .
  • Interpretation: An OR of 1 means no association, >1 indicates increased odds, and <1 indicates decreased odds.
  • Invariance Property: The OR gives a valid measure of association regardless of the study design (cohort or case-control), making it essential for retrospective studies where relative risk cannot be calculated.
  • Approximation: For rare events, the odds ratio closely approximates the relative risk.
  • Foundation for GLMs: The mathematical properties of the log-odds ratio make it the natural parameter for logistic regression, a type of Generalized Linear Model you will study in detail later.

Preview of the Next Lesson:

We have now learned three different ways to measure association in a 2x2 table: difference in proportions, relative risk, and odds ratio. Each tells a slightly different story. In our next lesson, we will directly compare the odds ratio and relative risk to answer a critical practical question: when should you use one over the other?