Resource

Confounding in Observational Studies: How to Decide What to Adjust For

Learn how to decide which variables to adjust for in observational studies using causal reasoning, conditional exchangeability, causal diagrams, and principled covariate selection. The Resource explains why statistical significance and outcome prediction alone cannot identify an appropriate causal adjustment set.

Researchers often ask, “What variables should I adjust for?” A common response is to examine every available covariate, retain variables associated with the outcome, or use statistical significance to decide what belongs in the adjusted model.

For a causal analysis, that is the wrong starting point.

Confounding is fundamentally a causal problem, not simply a variable-selection problem. The appropriate adjustment set depends on the causal effect being estimated, the assumed relationships among exposure, outcome, and other variables, and whether conditioning on a variable removes bias or creates it. Hernán and Robins explicitly distinguish causal analyses from purely associational or predictive analyses: confounding is relevant when the target is a causal effect, whereas prediction has a different objective and therefore a different logic for choosing predictors (Hernán & Robins, 2020).

Core principle: Do not start confounder selection by asking which variables are statistically significant. Start by asking what causal effect you want to estimate and what causal structure would allow you to identify it.

First Decide: Are You Estimating an Association or a Causal Effect?

Before deciding what to adjust for, define the scientific question.

Objective What it asks Role of covariates
Association or prediction How does the observed distribution of an outcome differ across values of an exposure or predictor? A variable may be useful because it improves prediction or describes an observed association.
Causal inference How would outcomes differ under different exposure or treatment conditions? A variable should be selected according to whether conditioning on it contributes to identification of the causal effect without blocking part of that effect or opening a noncausal pathway.

Hernán and Robins emphasize that predictive or associational models do not require the same confounding framework because their parameters are not necessarily intended to have causal interpretations (Hernán & Robins, 2020).

This distinction changes the role of covariates.

If the objective is prediction, a variable may be useful because it improves prediction. If the objective is causal inference, a variable should not be selected merely because it predicts the outcome. The relevant question is whether conditioning on it contributes to identification of the causal effect without blocking part of that effect or opening a noncausal pathway.

“Which variables predict the outcome?” and “Which variables should I adjust for to estimate this causal effect?” are different questions.

Define the Causal Question Before Building the Adjusted Model

Covariate adjustment should follow the causal question, not define it retrospectively.

At minimum, specify:

  • the exposure or treatment;
  • the outcome;
  • the population to which the effect refers;
  • the treatment or exposure contrast of interest; and
  • the causal effect or estimand being targeted.

Hernán and Robins frame causal inference around well-defined counterfactual outcomes and identification conditions such as exchangeability, positivity, and consistency. In observational studies, these conditions cannot simply be assumed to arise because a multivariable regression has been fitted (Hernán & Robins, 2020).

Why the estimand matters: If the target is the total causal effect, conditioning on a mediator can remove part of the very effect the investigator intended to estimate. A different causal estimand may require a different strategy.

There is therefore no universally correct “adjusted model” independent of the causal question.

What Is Confounding?

A useful structural view begins with the causes of exposure and outcome.

Hernán and Robins describe a structural approach that explicitly identifies sources of confounding—particularly common causes of treatment and outcome—and then identifies a sufficient set of variables for adjustment. Importantly, whether a particular variable belongs in a sufficient adjustment set can depend on what other variables are already included (Hernán & Robins, 2020).

A variable is not automatically a confounder merely because it is associated with both the exposure and the outcome in the observed dataset.

Causal structure matters. Statistical associations alone do not determine whether conditioning on a variable removes confounding, is unnecessary, or introduces bias.

Modern Epidemiology similarly treats confounding within a causal framework and connects confounding bias to noncausal or “backdoor” pathways between exposure and outcome (Lash et al., 2021).

Conditional Exchangeability: What Adjustment Is Trying to Achieve

For an observational exposure, treatment groups generally cannot be assumed to be exchangeable simply because they were observed in the same dataset.

The central causal goal of confounding adjustment is to identify a set of measured variables such that, conditional on those variables, treatment assignment can be treated as exchangeable with respect to the relevant counterfactual outcomes. Hernán and Robins express this idea as conditional exchangeability (Hernán & Robins, 2020).

Conceptually, after sufficient adjustment, comparisons between exposure groups within the relevant covariate strata should no longer be distorted by the measured common causes that generated confounding.

Important limitation: Conditional exchangeability is an assumption about the causal data-generating process. A regression program cannot test whether every relevant common cause has been measured. If an important confounding pathway remains uncontrolled, residual confounding can remain even in a technically sophisticated model.

Adjustment therefore does not prove exchangeability. It implements an analysis under assumptions intended to make conditional exchangeability plausible.

Use Causal Structure, Not a List of Outcome Predictors

One of the most useful consequences of causal thinking is that covariates should be classified according to their role in the causal structure.

A simplified causal diagram might contain:

C → A → Y
C → Y

where:

  • A is the exposure,
  • Y is the outcome, and
  • C is a common cause of both.

The path:

A ← C → Y

is a noncausal backdoor path between exposure and outcome. Appropriate conditioning on C can block that path.

But not every variable associated with Y has this structure. Causal diagrams make those distinctions explicit. Hernán and Robins emphasize that a structural approach uses causal directed acyclic graphs (DAGs) to encode researchers' assumptions about the causal network and identify sufficient adjustment sets. They also stress that a DAG can be wrong: its value is that the assumptions guiding adjustment become explicit and therefore open to scientific criticism (Hernán & Robins, 2020).

A DAG is therefore not a device for mechanically discovering truth from the data. It is a structured representation of causal assumptions used to determine which conditioning decisions are compatible with those assumptions.

Confounders, Mediators, and Colliders Play Different Roles

Common cause / confounding structure

A ← C → Y

C is a common cause of exposure and outcome. Appropriate conditioning on C can block the noncausal backdoor path.

Decision: Consider whether the variable is needed as part of a sufficient adjustment set.

Mediator

A → M → Y

If M lies on a causal pathway through which exposure A affects outcome Y, then M is a mediator.

Decision: If the estimand is the total causal effect, adjusting for M blocks part of that effect and changes the causal contrast being estimated.

Collider

A → S ← U → Y

S is a common effect—a collider—of variables connected to exposure and outcome processes.

Decision: Conditioning on a collider can open a previously blocked noncausal path and create selection bias.

Confounders Are Not Mediators

A mediator occupies a different causal position.

Consider:

A → M → Y

If M lies on a causal pathway through which exposure A affects outcome Y, then M is a mediator.

If the estimand is the total causal effect of A on Y, adjusting for M blocks the component of the effect operating through that pathway. Hernán and Robins explicitly describe this as overadjustment for a mediator when the average total causal effect is the target (Hernán & Robins, 2020).

That is why the rule:

“Adjust for every variable associated with the outcome”

can fail badly.

A mediator may be strongly associated with the outcome precisely because it carries part of the exposure's causal effect. Conditioning on it does not merely “control noise”; it changes the causal contrast being estimated.

The correct decision therefore depends on the estimand. A variable inappropriate for estimating a total effect might play a role in a specifically defined mediation analysis, but those are different causal questions.

Adjustment Can Also Create Selection Bias

Inappropriate adjustment can do more than remove part of a causal effect. It can create an association that was not present before conditioning.

Consider the schematic structure:

A → S ← U → Y

Here S is a common effect—a collider—of variables connected to exposure and outcome processes. Conditioning on a collider can open a previously blocked noncausal path.

Modern Epidemiology describes selection bias in causal-diagram terms as bias arising when conditioning on a collider or a descendant of a collider opens a noncausal pathway between exposure and outcome (Lash et al., 2021).

Hernán and Robins likewise show that adjustment for colliders, their descendants, and certain variables affected by treatment can induce selection bias. Their treatment of inappropriate adjustment also demonstrates why a variable's being available, predictive, or statistically associated with the outcome is not sufficient justification for conditioning on it (Hernán & Robins, 2020).

More adjustment is not necessarily less bias. The effect of conditioning depends on where the variable lies in the causal system.

Why P-Value-Based Confounder Selection Is Not a Causal Strategy

A common workflow is:

  1. test candidate covariates;
  2. retain those with p < .05;
  3. call the retained variables “confounders”; and
  4. report the resulting exposure coefficient as adjusted.

This does not establish an appropriate causal adjustment set.

Harrell describes outcome-driven stepwise variable selection as a problematic modeling strategy. Among its problems, using the outcome to calculate p-values and then deciding which variables enter the model distorts standard inferential properties. He specifically notes that, in observational studies, variable selection used to determine confounders for adjustment can leave residual confounding (Harrell, 2015).

This problem is especially important for causal inference because the status of a variable as part of a sufficient adjustment set is not determined by whether its coefficient happens to cross a significance threshold in one sample.

A variable can be causally important for confounding control without producing a small p-value. Conversely, a highly significant outcome predictor can be a mediator, collider, or otherwise inappropriate adjustment variable.

Statistical significance answers a sampling-inference question under a fitted model. It does not identify causal structure.

Prespecification and Subject-Matter Knowledge Matter

Harrell contrasts prespecified modeling with variable-selection procedures used when analysts do not—or cannot—use adequate subject-matter knowledge to identify important variables in advance. He documents multiple problems with stepwise selection, including biased coefficient estimates, understated standard errors, misleading p-values, instability under collinearity, and residual confounding when the procedure is used for confounder selection in observational studies (Harrell, 2015).

For causal analyses, this reinforces a broader principle from Hernán and Robins: confounding control requires a priori causal knowledge about the data-generating structure (Hernán & Robins, 2020).

That knowledge may be imperfect. But making assumptions explicit is preferable to allowing sample-dependent p-values to determine the assumed causal structure implicitly.

Regression Adjustment: Useful, but Not Magical

Regression is one way to implement covariate adjustment. If an appropriate adjustment set has been identified, an outcome regression can estimate outcome contrasts conditional on those variables and can be used as part of causal effect estimation.

But the presence of the relevant variables in a regression formula is not sufficient by itself.

Regression-based adjustment remains dependent on the quality of measurement and on model specification. Modern Epidemiology notes that when statistical models are used for confounding adjustment, correct model specification is required; alternative weighting or semiparametric approaches can relax some modeling assumptions in particular settings (Lash et al., 2021).

Harrell's broader regression framework likewise emphasizes careful specification of predictor relationships rather than assuming that entering a variable into a model automatically represents its relationship with the outcome correctly (Harrell, 2015).

“Adjusted for age” means adjusted for age as it was actually represented in the fitted analysis—not adjusted for every possible age-related structure.

Potential problems include incorrect functional forms, omitted interactions, measurement error, unmeasured confounding, and inadequate representation of the covariates needed for exchangeability.

Regression is an estimation tool. It does not determine which variables are causally appropriate to adjust for.

A Practical Confounder-Selection Workflow

A defensible workflow for confounding in observational studies proceeds from the causal question to the statistical method.

  1. Define the target effect

    State the exposure, outcome, target population, intervention or exposure contrast, and causal effect of interest.

    Do this before choosing covariates.

  2. Separate causal inference from prediction

    If the goal is prediction, choose predictors according to the prediction problem. If the goal is a causal effect, use a causal adjustment strategy. Do not import prediction-variable selection rules into confounder selection (Hernán & Robins, 2020).

  3. Specify the assumed causal structure

    Using subject-matter knowledge, temporal information, and the study design, identify plausible relationships among exposure, outcome, and other variables.

    Where useful, represent those assumptions with a DAG.

  4. Identify sources of confounding

    Look for noncausal pathways that create association between exposure and outcome, including common causes that must be addressed to support conditional exchangeability (Hernán & Robins, 2020).

  5. Identify a sufficient adjustment set

    Ask which measured variables are needed to block the relevant confounding pathways.

    Do not assume that every measured baseline variable belongs in the set.

  6. Check whether proposed controls are downstream of exposure

    If a variable is caused by the exposure, determine its causal role before adjusting for it. If it mediates part of the total effect, conditioning on it changes the estimand (Hernán & Robins, 2020).

  7. Check for collider structures and selection processes

    Ask whether conditioning on the variable—or restricting the study population according to it—could open a noncausal pathway and induce selection bias (Lash et al., 2021; Hernán & Robins, 2020).

  8. Do not let p-values define the causal model

    Avoid deciding which confounders to retain solely according to statistical significance. Outcome-driven variable selection has serious inferential problems and can leave residual confounding (Harrell, 2015).

  9. Choose the adjustment method

    Once the causal structure and adjustment set are defined, choose an appropriate estimation approach. Regression adjustment is one option; other causal adjustment methods may be appropriate depending on the design, data structure, and estimand.

  10. Assess what assumptions remain

    An adjusted estimate can still be biased because of unmeasured confounding, selection processes, measurement problems, or model misspecification. “Adjusted” is not synonymous with “causal” or “unbiased.”

Before You Adjust for a Variable, Ask…

  • What causal effect am I trying to estimate? Have I defined the exposure, outcome, population, contrast, and estimand before choosing covariates?
  • Is my goal causal inference or prediction? Am I choosing this variable because it is needed for causal identification, or merely because it predicts the outcome?
  • Where does this variable sit in the causal structure? What causes it, and what does it cause?
  • Could it be a common cause of the exposure and outcome? Does it help block a relevant confounding pathway?
  • Is it part of a sufficient adjustment set? Is it still necessary given the other variables I plan to condition on?
  • Could the exposure cause this variable? If so, is it a mediator or another post-exposure variable?
  • Would conditioning on it block part of the causal effect I want? This is especially important when estimating a total effect.
  • Could it be a collider or descendant of a collider? Could conditioning on it open a noncausal pathway and create selection bias?
  • Am I including it only because it is associated with the outcome? Outcome association alone does not establish that a variable is an appropriate confounder.
  • Am I including or excluding it because of a p-value? Statistical significance is not a criterion for causal structure.
  • Was the adjustment set informed by substantive knowledge before examining the final exposure-effect estimate? Avoid allowing outcome-driven selection to substitute for causal reasoning.
  • Can the variable be measured adequately? Adjustment for a poorly measured variable may not accomplish the intended confounding control.
  • Can I model it adequately? If using regression, have I considered whether its functional form and relevant interactions are appropriately represented?
  • Does conditioning create a meaningful comparison with adequate data support? Adjustment cannot recover causal contrasts that the observed data cannot support.
  • What important confounding might remain unmeasured? Acknowledge residual confounding rather than treating the fitted model as proof that it has disappeared.
  • Can I explain why every adjustment variable is in the analysis? The explanation should be causal or design-based—not simply “it was available” or “it was significant.”

What Not to Use as a Universal Confounder-Selection Rule

Several shortcuts are attractive because they are easy to automate. None should be treated as a universal rule for causal adjustment.

“Adjust for every variable associated with the outcome.”

Outcome association does not determine causal role. The variable could be a confounder, mediator, collider, or simply a predictor.

“Adjust for everything measured at baseline.”

Pretreatment timing can be useful information, but it does not by itself prove that every baseline variable should be conditioned on.

“Keep variables with p < .05.”

Sample significance does not identify sufficient causal adjustment sets, and outcome-driven variable selection has additional inferential problems (Harrell, 2015).

“The adjusted estimate must be better than the crude estimate.”

Adjustment can reduce bias, leave bias unchanged, change the estimand, or introduce bias depending on the variable and causal structure.

“A large multivariable model controls for confounding.”

Model size is not evidence that the right pathways were blocked.

How to Report Covariate Adjustment More Transparently

Instead of writing only:

“We adjusted for age, sex, baseline severity, smoking, and comorbidity.”

a causal analysis should explain why those variables were selected.

Useful reporting elements include:

  • the target causal effect;
  • the assumed temporal and causal ordering;
  • the rationale for the adjustment set;
  • whether variables were selected before outcome modeling;
  • the estimation method; and
  • important sources of residual confounding or selection bias that cannot be excluded.

A DAG can be particularly useful when the adjustment logic is otherwise difficult to communicate. Its purpose is not to make the analysis automatically correct, but to expose the assumptions behind the analysis so that readers can evaluate them (Hernán & Robins, 2020).

Limitations and Cautions

No covariate-selection procedure can guarantee elimination of confounding in an observational study.

A sufficient adjustment set identified under one assumed DAG may fail if that causal structure is wrong. Relevant variables may be unmeasured or poorly measured. Conditioning decisions can introduce selection bias. Regression models can be misspecified. In some longitudinal settings, variables can simultaneously act as confounders for later exposures and consequences of earlier exposures, requiring methods beyond ordinary regression adjustment.

Most importantly, covariate adjustment cannot manufacture the information that the study design and measurements do not contain.

The appropriate conclusion is therefore not that causal adjustment is impossible, but that its validity rests on explicit causal assumptions rather than the number of variables entered into a regression model.

Bottom Line

For confounding in observational studies, the question is not:

“Which variables are statistically significant?”

It is:

“Given the causal effect I want to estimate and my assumptions about how these variables arise, which variables must I condition on to address confounding without blocking the target effect or creating new bias?”

Confounder selection should therefore begin with the causal question and causal structure. Conditional exchangeability provides the identification goal; causal diagrams can make the assumed pathways explicit; mediators and colliders illustrate why inappropriate adjustment can be harmful; and regression provides one way to implement an already justified adjustment strategy.

A statistically significant covariate is not automatically a confounder. A strong outcome predictor is not automatically an adjustment variable. And an “adjusted” regression coefficient is not automatically a causal effect.

FAQs

What variables should I adjust for in an observational study?

For a causal analysis, adjust for a sufficient set of measured variables needed to address confounding under a defensible causal model. Variable selection should be guided by the target causal effect, temporal ordering, subject-matter knowledge, and causal structure rather than by outcome association or p-values alone (Hernán & Robins, 2020; Harrell, 2015).

Should I adjust for every variable associated with the outcome?

No. Outcome association alone does not identify a confounder. An outcome-associated variable could be a confounder, mediator, collider, or other variable whose adjustment is unnecessary or harmful. Its causal role must be considered before conditioning on it (Hernán & Robins, 2020; Lash et al., 2021).

How do I identify a confounder?

Rather than relying solely on statistical associations, specify the assumed causal structure and determine which variables are needed to block confounding pathways between exposure and outcome. Whether a variable belongs in a sufficient adjustment set can depend on what other variables are already being controlled (Hernán & Robins, 2020).

Should confounders be statistically significant?

Statistical significance is not what makes a variable relevant for confounding control. Harrell specifically cautions against outcome-driven variable selection and notes that using variable selection to determine confounders in observational studies can result in residual confounding (Harrell, 2015).

Should I adjust for mediators?

Not automatically. If a mediator lies on a pathway from exposure to outcome and the target is the total causal effect, adjusting for the mediator blocks part of that effect and changes the target being estimated (Hernán & Robins, 2020).

Can adjusting for more variables increase bias?

Yes. Conditioning on a collider or its descendant can open a noncausal pathway and produce selection bias. Adjustment for post-exposure variables can also block components of the causal effect or otherwise change the estimand (Hernán & Robins, 2020; Lash et al., 2021).

Do causal diagrams prove which variables are confounders?

No. A causal diagram represents assumptions about the causal system. Its value is that those assumptions become explicit and can be used to identify adjustment sets and scrutinize conditioning decisions. If the assumed DAG is wrong, the resulting adjustment strategy can also be wrong (Hernán & Robins, 2020).

Does regression adjustment eliminate confounding?

Not necessarily. Regression can implement adjustment for measured variables, but causal validity still depends on an appropriate adjustment set, adequate measurement, identification assumptions, and suitable model specification. Unmeasured or inadequately controlled confounding can remain (Hernán & Robins, 2020; Lash et al., 2021).

References

Harrell, F. E., Jr. (2015). Regression modeling strategies: With applications to linear models, logistic and ordinal regression, and survival analysis (2nd ed.). Springer.

Hernán, M. A., & Robins, J. M. (2020). Causal inference: What if. Chapman & Hall/CRC.

Lash, T. L., VanderWeele, T. J., Haneuse, S., & Rothman, K. J. (2021). Modern epidemiology (4th ed.). Wolters Kluwer.

Need help with a similar research question?

Share a short, non-confidential summary of your study and the decision you need to make.

Send an enquiry