What Is a Confounder? Choose Variables to Adjust for in Causal Analysis
A confounder is a factor that distorts the relationship between a treatment and an outcome, making an observed difference look like a treatment effect or hiding a real one. The goal is not to adjust mechanically for every variable related to treatment and outcome. Use the research question and causal structure to choose a suitable adjustment set that blocks noncausal paths; a poor choice can leave confounding or introduce new bias.
How does confounding arise?
In an observational study, treatment is often not assigned at random. If a pre-treatment characteristic influences both who receives treatment and the outcome risk, its effect gets mixed with the treatment effect. For example, customers who already have a stronger intention to buy may be more likely to turn on a new notification feature and more likely to buy even without the notification. Comparing users with nonusers without accounting for prior intention cannot separate the notification’s effect from that pre-existing difference.
A causal diagram represents assumptions about variables and causal directions with arrows. In the diagram below, L is purchase intention before treatment, A is notification use, and Y is purchase.
L → A → Y
L → YL is a common cause of A and Y, creating the backdoor path A ← L → Y. That path also connects A and Y, so their observed association mixes the treatment effect with the influence of purchase intention. In a causal diagram, a noncausal path that enters treatment without following its outgoing arrows is commonly called a backdoor path. Hernán and Robins explain confounding through this structure of noncausal association created by common causes.
Which variables are candidates for confounding?
Do not select candidates only by checking which variables become statistically significant after seeing the results. Use subject knowledge and timing to ask which factors could influence both treatment choice and the outcome, then check whether they were measured. In disease studies, known risk factors may be candidates; in other settings, consider common causes that precede treatment selection and the outcome. CDC epidemiology guidance recommends first looking for possible confounding, then controlling its distortion with an appropriate method.
A causal diagram is a tool for examining assumptions, not a picture that proves the arrows from data alone. Each arrow depends on knowledge of the subject or time order. If a shared cause was not measured, adjusting only for observed variables can leave residual confounding. Record the candidate set, the diagram, excluded factors, and remaining uncertainty.
How do confounders differ from mediators and colliders?
Not every variable associated with other variables should be adjusted for. The effect of adjustment depends on the variable’s causal position and whether the target is a total or direct effect.
| Role | Simple diagram | What adjustment can do |
|---|---|---|
| Confounder candidate | L → A, L → Y | A suitable pre-treatment variable can block a noncausal path and improve comparability. Whether a set is sufficient depends on the full causal structure and measurement. |
| Mediator | A → M → Y | Adjusting for post-treatment M removes part of the effect transmitted through M. If the question concerns the total effect, do not adjust for it casually. A direct effect requires a separate definition and added assumptions. |
| Collider | A → C ← U → Y | Conditioning on the common effect C or its descendant can open a previously blocked path and create a spurious association between treatment and outcome. |
For example, whether a customer opens an app after a notification may lie on the pathway by which the notification affects purchasing. Restricting analysis to customers who opened the app can mix the total notification effect with later behavior and introduce selection bias based on who opened it. A collider is instead a shared consequence of two causes. Conditioning on it can make the causes appear related, creating selection bias. Thus “include every available variable” is not a safe rule.
How should you find and review candidates?
Follow these steps to reduce choices made after looking at the results:
**Fix the causal question.** Specify the target population, treatment strategies, outcome, and time period. A different question may need a different adjustment set.
**Mark the time order.** Separate factors measured before treatment from factors arising after it. A variable measured earlier is not automatically a confounder, but post-treatment variables may be mediators or colliders.
**Draw arrows using subject knowledge.** Mark common causes of treatment and outcome, proxy measures for common causes, selection processes, and missingness. Do not infer arrow direction from observed correlation alone.
**Review the adjustment set.** Ask whether the selected variables block plausible backdoor paths and whether adjustment conditions on treatment descendants or colliders. State the limitation if no sufficient set can be defended.
**Check measurement and overlap.** Review definitions and missingness, and confirm that both treatment strategies appear within each important covariate stratum. If a stratum contains only one strategy, the data do not directly compare its alternative outcome.
**Document the plan before analysis.** Record candidate variables, reasons for inclusion or exclusion, and the target effect. If the set changes after seeing results, identify that selection as exploratory.
How can you control confounding?
Once the target and adjustment set are justified, options include stratification, standardization, regression adjustment, matching, and inverse probability weighting. Stratification, for example, groups people with similar values of L and compares treatment and control within each stratum. Standardization averages stratum-specific outcomes using the distribution of L in a stated target population, so the strategies are compared against the same reference mix. CDC guidance describes stratified comparisons, Mantel–Haenszel summaries, and regression as ways to control confounding.
For an adjusted estimate to represent a causal effect, it is not enough to measure plausible confounders. The treatment and outcome must be defined and measured consistently, and within the relevant covariate strata there must be a chance of observing each treatment strategy. These conditions cannot be fully checked from the data alone. A good-looking model fit or precise estimate cannot repair incorrect causal assumptions.
Hypothetical example: Why can groups with different risk profiles lead to opposite conclusions?
The figures below are a hypothetical teaching example, not results from an actual study. We compare the 7-day event rate in a treated group and a comparison group. Assume people at high baseline risk are more likely to receive treatment and also have a higher event rate regardless of treatment.
| Baseline risk stratum | Event rate, treated | Event rate, comparison | Share of treated group | Share of comparison group |
|---|---|---|---|---|
| High risk | 15% | 20% | 90% | 10% |
| Low risk | 2% | 5% | 10% | 90% |
Within each risk stratum, the event rate is lower in the treated group. But the crude totals retain the difference in group composition: treated is 13.7% (0.9×15% + 0.1×2%), while comparison is 6.5% (0.1×20% + 0.9×5%). If we standardize to a target population that is 50% high-risk and 50% low-risk, the rates are 8.5% and 12.5%. The overall comparison changes because the group mix and reference population change. This does not automatically make the standardized difference a causal effect: the risk strata must be a sufficient adjustment set, and treatment and measurement assumptions must also hold.
What mistakes are common?
**Adjusting only for statistically significant variables:** Statistical association does not establish causal position. A variable that looks related to treatment and outcome could be a collider or post-treatment variable.
**Assuming more variables are always better:** Inappropriate adjustment can create new bias and leave too few comparable observations within strata.
**Concluding there is no confounding because estimates barely changed:** Unmeasured factors or a misspecified diagram can remain even when the estimate changes little. A changed estimate does not prove that one variable alone was a confounder.
**Combining different effects into one “adjusted effect”:** If effects vary by stratum, stratum-specific and overall effects can differ. State which population distribution was used to compute the overall estimate.
**Treating adjustment as proof of causation:** Adjustment constructs a comparison under stated assumptions; it does not turn observational data into a randomized trial. Evaluate residual confounding, measurement error, and selection bias separately.
How should you report the result?
Report the causal effect being targeted, the variables used for adjustment and why, whether each was measured before or after treatment, the strata or standardization distribution, and the effect estimate with its uncertainty. Label the crude estimate as an unadjusted association, and explain that the adjusted estimate still depends on assumptions. Describe possible unmeasured or poorly measured confounding, lack of overlap in treatment choices within strata, and uncertainty from analytic choices.
The key is not to memorize a universal “confounder list” and adjust everything. First specify the causal structure that fits the question, then assess whether the data support the comparison that structure requires. For how confounding changes the distinction between association and cause, see the Causation article; for interpreting correlation coefficients, see the Correlation article.