Welcome to the first lesson of our module on confounding and effect modification. In our previous lesson, we explored how systematic errors—selection and information bias—can distort a study's findings by corrupting the inputs. We established that these biases represent flaws in who is studied or how data is collected. Now, we turn our attention to the third major threat to a study's validity: confounding.
This lesson addresses the learning outcome: Define confounding and state the criteria for a variable to be a confounder. While bias deals with errors in participant selection and data collection, confounding deals with a different problem: the mixing of effects. We will unpack what this means, establish the formal rules for identifying a potential confounder, and see how these concepts are visualized using causal diagrams, a tool that should be conceptually familiar from your background in computer information systems.
The Illusion of Causality
Imagine a study conducted in an elementary school that finds a strong association between a child's foot size and their reading ability. The data shows that children with larger feet are much better readers. Should we conclude that big feet cause good reading skills? Or, more absurdly, should we try to increase children's foot size to improve literacy?
Of course not. Common sense tells us there must be another factor at play. In this case, that factor is the child's age or grade level. Older children have bigger feet and are more advanced readers. Age is associated with both foot size (the "exposure") and reading ability (the "outcome"), creating a spurious, or false, association between them.
This "mixing" of effects is the essence of confounding. The effect of age is tangled up with the effect of foot size, leading to a misleading conclusion.
Confounding – Foundations of Epidemiology
This chapter from an Oregon State University textbook provides an excellent introduction to confounding using the very example we just discussed.
Read the first part of the chapter, up to the section "Criteria for Confounders." Pay attention to the author's reasoning after calculating a large odds ratio. This highlights how a statistically strong association can be entirely misleading if confounding is not considered. The causal diagram showing the relationships between foot size, reading ability, and grade level is the key visual to understand.
Defining Confounding
Confounding occurs when a third variable, the confounder, is associated with both the exposure and the outcome, distorting the true relationship between them. It creates a "backdoor" path of association that can make it seem like there's a direct link between the exposure and outcome when one doesn't exist, or it can hide a true association, or even reverse its direction.
From a systems perspective, if your study is a function Y = f(X) where you're trying to measure the effect of an input X on an output Y, a confounder Z is a hidden variable that influences both X and Y simultaneously, corrupting your measurement of f.
Causal diagrams, which are essentially Directed Acyclic Graphs (DAGs), are the standard way epidemiologists visualize these relationships.

As shown in the "Confounder" diagram above, the variable is a common cause of both the exposure and the outcome . The observed association between and is a mix of the true causal effect (the direct arrow from to ) and the spurious association created by the backdoor path through . Our goal is to isolate the direct effect of on .
The Three Criteria for a Confounder
For a variable to be considered a potential confounder, it must satisfy three specific criteria. It's crucial to understand these rules, as they form the theoretical foundation for identifying and addressing confounding.
The following video and reading lay out these three criteria clearly.
This short video from Cochrane Austria succinctly lists the three properties of a confounder.
Watch the section that outlines the three properties of a confounder, using the classic example of coffee (exposure), heart disease (outcome), and smoking (confounder).
Now, let's explore these criteria in more detail.
Confounding – Foundations of Epidemiology
Let's return to the Oregon State University chapter for a formal breakdown of the three criteria.
Please read the section titled "Criteria for Confounders". As you read, focus on understanding the specific logic for each of the three rules: Associated with the Exposure: Why does the confounder need to be unevenly distributed between the exposed and unexposed groups? Causes the Outcome: The variable must be an independent risk factor for the outcome. Not on the Causal Pathway: This is a critical distinction. The reading explains why a variable that is an intermediate step between the exposure and outcome is a mediator, not a confounder.
To summarize, a variable is a potential confounder of the relationship between an exposure and an outcome if:
- is associated with the exposure . (Among people with the outcome, the confounder is more/less common in the exposed group vs. the unexposed group).
- is an independent cause or risk factor for the outcome . (The confounder must affect the outcome, even in people who are not exposed).
- is not on the causal pathway between and . (The exposure does not cause the confounder, which then causes the outcome).
Let's use the classic example from the video: studying the link between coffee drinking () and coronary heart disease (). Smoking () is a potential confounder because:
- It is associated with the exposure: People who drink a lot of coffee also tend to smoke more.
- It is a cause of the outcome: Smoking is a well-established risk factor for heart disease, regardless of coffee consumption.
- It is not on the causal pathway: Drinking coffee does not cause a person to start smoking.
If we fail to account for smoking, we might wrongly attribute the heart disease risk from smoking to coffee drinking instead.
Applying the Criteria: A Practical Check
The three criteria provide a formal definition. The first two can often be checked using data from your study, while the third relies on biological or subject-matter knowledge. Let's see how this works in practice.
The following video demonstrates how to assess whether a variable (age) meets the criteria for being a confounder in a hypothetical study of smoking and heart disease.
Week 9 : CONFOUNDING: DEFINITION
This video from "Data Learner" provides a clear definition and then applies it to a numerical example.
First, watch the segment that provides a working definition of confounding using a causal diagram. This will reinforce what we've just covered. Next, watch the detailed example of how to check for confounding in the data. The speaker walks through a dataset and explicitly tests the first two criteria: Is age associated with smoking? He compares the proportion of older individuals in the smoking group versus the non-smoking group. Is age an independent risk factor for heart disease? He examines the risk of heart disease in older versus younger people only among the non-smokers to isolate the effect of age.
As the video highlights, you can empirically check for the first two conditions. You can look at your data and see if the potential confounder is more common in your exposed group. You can also see if it's associated with the outcome in your unexposed group. The third condition—not being on the causal pathway—is a logical determination based on your understanding of the world, not something you can test with the data in the same way.
Conclusion
In this lesson, we have moved from the concept of bias to the equally important concept of confounding. You have learned that confounding is not an error in measurement or selection, but a mixing of effects that can lead to incorrect conclusions about causality.
Here are the essential takeaways:
- Confounding is the distortion of an exposure-outcome association by a third variable (the confounder) that is associated with both the exposure and the outcome.
- A variable is a potential confounder if it meets three criteria:
- It is associated with the exposure.
- It is an independent cause or risk factor for the outcome.
- It is not an intermediate step on the causal pathway from the exposure to the outcome.
- Causal diagrams (DAGs) are a powerful tool for visualizing and understanding confounding relationships.
Now that we can define and identify a potential confounder, the next logical question is: what do we do about it? Our next lesson will address this by exploring methods to control for confounding, both at the design stage of a study (e.g., restriction and matching) and during the analysis stage.