Tutorials › Propensity Score Matching and Instrumental Variables › Avoiding Collider Adjustment During Feature Selection

Time-Varying and High-Dimensional Confounding · Tutorial 630 of 699

Avoiding Collider Adjustment During Feature Selection

Learn to identify collider structures in claims features, trace the bias created by conditioning on them, and use timing and causal diagrams to guide feature selection.

Advanced 12 min read

What You'll Learn

  • Identify colliders and the paths that conditioning on them can open.
  • Distinguish adjusting for a feature from selecting a study sample based on it.
  • Work out how collider conditioning can create a spurious treatment–outcome association.
  • Assess treatment timing and causal roles in automated claims-feature discovery.
  • Recognize positivity and overlap warnings that can accompany collider adjustment.
  • Apply practical safeguards when building a covariate set for causal analysis.

Why a Predictive Feature Can Be a Causal Problem

Automated feature discovery can surface thousands of claims variables associated with treatment, outcome, or both. But association alone does not establish that a feature is a suitable adjustment variable. A feature may be a collider: a common effect of two variables. Conditioning on a collider—by adjusting for it or selecting observations based on it—can create an association between its causes, even when they were independent before conditioning. In a causal analysis, that induced association can open a noncausal path between treatment and outcome.

This concern is especially important in claims data because a code recorded after treatment may describe a consequence of treatment, a consequence of underlying health, or a combination of both. An algorithm may rank such a code highly precisely because it is associated with treatment and outcome. The causal diagram, rather than the strength of those associations, determines whether adjustment is appropriate.

Definition: A collider on a path is a variable at which two arrows point inward, such as \(A \rightarrow C \leftarrow U\). The path through \(C\) is blocked when \(C\) is not conditioned on, but can be opened by conditioning on \(C\) or on a descendant of \(C\). Opening the path can associate its causes even if they were previously independent.

Use \(A\) for treatment, \(Y\) for the outcome, \(X\) for measured pretreatment covariates, and \(U\) for a possible unmeasured cause. The causal question is generally about the effect of \(A\) on \(Y\), not merely their observed association. A pretreatment common cause of \(A\) and \(Y\) may need adjustment to control confounding. A collider is different: it is caused by variables on the path, so conditioning on it can introduce rather than remove bias.

How Conditioning Opens a Path

In the diagram \(A \rightarrow C \leftarrow U \rightarrow Y\), the path from \(A\) to \(Y\) through \(C\) is blocked at the collider \(C\) if we do not condition on \(C\). Conditioning on \(C\) opens the path. The resulting association between \(A\) and \(U\) can then be carried to \(Y\), because \(U\) causes \(Y\). This is a noncausal route from treatment to outcome.

The same logic applies if the collider is a common effect of treatment and outcome, \(A \rightarrow C \leftarrow Y\). Conditioning on \(C\) can create an association between \(A\) and \(Y\) even when treatment has no causal effect. A feature need not be a direct cause of the outcome to induce this problem; its role as a common effect is enough.

The following calculation shows the mechanism directly. Suppose \(A\) and \(U\) are independent binary variables, each with probability \(0.5\) of being 1. Let \(C=1\) whenever either \(A=1\) or \(U=1\), so \(C=A\text{ OR }U\). Before conditioning, all four \((A,U)\) combinations have probability \(0.25\). After restricting to \(C=1\), only \((1,1)\), \((1,0)\), and \((0,1)\) remain, each with conditional probability \(1/3\). Thus, among those with \(A=1\), the probability that \(U=1\) is \(1/2\); among those with \(A=0\) and \(C=1\), it is 1. Conditioning has made \(A\) and \(U\) negatively associated.

$$ P(U=1\mid A=1,C=1)=\frac{1}{2}, \qquad P(U=1\mid A=0,C=1)=1 $$

If \(U\) also predicts \(Y\), that newly induced difference in \(U\) can make treatment groups look different in their outcomes, despite no causal treatment effect. This is why “include every predictive feature” is not a safe adjustment rule.

Worked Example: A Treatment-Related Claims Collider

Consider a hypothetical study of a treatment \(A\), a later outcome \(Y\), and a post-treatment diagnosis code \(C\). The code can be caused by treatment-related complications and by underlying severity \(U\), which also affects \(Y\): \(A \rightarrow C \leftarrow U \rightarrow Y\). Suppose \(A\) and \(U\) are independent, each with probability \(0.5\), \(C=1\) if either is 1, and \(Y=U\). Thus treatment has no causal effect on \(Y\).

In the full population, \(P(Y=1\mid A=1)=P(U=1)=0.5\), and \(P(Y=1\mid A=0)=P(U=1)=0.5\). The unadjusted outcome difference is \(0.5-0.5=0\), as expected under this setup.

Now restrict to records with \(C=1\). Among these records, \(A=1\) occurs in the \((A,U)\) cells \((1,1)\) and \((1,0)\), so the outcome risk is \(1/2\). When \(A=0\) and \(C=1\), only the \((0,1)\) cell is possible, so the outcome risk is 1. The selected-sample difference is therefore \(0.5-1=-0.5\), or a spurious apparent reduction of 50 percentage points.

Check of the causal structure. \(C\) is caused by both treatment and underlying severity, and \(U\) predicts the outcome. Conditioning on \(C\) opens the path \(A \rightarrow C \leftarrow U \rightarrow Y\). This explains the induced difference; the diagnosis code is not a baseline confounder to adjust for.

Adjustment, Feature Selection, and Sample Selection

Three operations are easy to conflate. Adjusting for a feature means including it as a covariate in an outcome model or in a procedure intended to control confounding. Selecting a feature means deciding that it enters that adjustment set. Selecting observations means restricting the analytic sample based on a feature or another selection variable. A collider can create bias through the first and third operations. Feature discovery itself is not automatically collider adjustment, but it can lead to it if the selected feature is then conditioned on in the causal analysis.

The timing of a claims variable is an important first screen. A code measured strictly before treatment cannot be caused by that treatment, which rules out some collider structures involving \(A \rightarrow C\). Timing alone does not prove that a code is safe: the code may still be a common effect of other causes, or its measurement and recording may be affected by selection. Conversely, a code associated with treatment is not automatically a collider. Its causal role must be considered.

A further warning sign is limited overlap within feature strata. In the OR example, \(C=0\) occurs only when \(A=0\) and \(U=0\); there are no treated observations in that stratum. An adjusted comparison that relies on treatment contrasts within each \(C\) stratum cannot obtain a treated-versus-untreated contrast in \(C=0\). This lack of overlap does not by itself prove collider bias, but it is a concrete diagnostic that the proposed adjustment may not support the intended comparison.

Worked Example: Selection on a Treatment-and-Outcome Feature

Suppose a hypothetical claims cohort is retained only if a post-index service-use indicator \(C\) is present. Treatment \(A\) can affect the chance of that service use, and an outcome-related clinical event \(Y\) can also affect it: \(A \rightarrow C \leftarrow Y\). For illustration, let \(A\) and \(Y\) be independent binary variables, each equally likely to be 0 or 1, and let \(C=1\) whenever either is 1.

In the full population, all four \((A,Y)\) pairs have probability \(0.25\), so \(P(Y=1\mid A=1)=P(Y=1\mid A=0)=0.5\). There is no treatment–outcome association in this setup.

After restricting to \(C=1\), the possible pairs are \((1,1)\), \((1,0)\), and \((0,1)\), each equally likely. For treated records, \(P(Y=1\mid A=1,C=1)=1/2\). For untreated records in the selected cohort, only \((0,1)\) is possible, so \(P(Y=1\mid A=0,C=1)=1\). The selected-sample risk difference is \(1/2-1=-1/2\), although the full-population risk difference is zero.

Conclusion. Defining eligibility by \(C=1\) has conditioned on a common effect of treatment and outcome. The resulting association is a selection artifact, not evidence of a treatment effect. The structure and arithmetic verify the problem; a large association between \(C\) and either variable would not, by itself, diagnose it.

Worked Claims-Data Example With Imperfect Selection

A deterministic example makes the path-opening mechanism clear, but claims-based selection is often probabilistic. The next hypothetical calculation shows that the bias does not require a feature to be a perfect logical combination of its causes.

Worked Example: A Noisy Post-Treatment Code

Suppose a cohort has two independent binary variables: treatment \(A\) and latent severity \(U\). Each of the four combinations occurs in 500 hypothetical records. The outcome is \(Y=U\), so treatment has no effect. A post-treatment code \(C\) is recorded with probabilities \(0.80\) for \((A,U)=(1,1)\), \(0.40\) for \((1,0)\), \(0.40\) for \((0,1)\), and \(0.05\) for \((0,0)\). Treatment and severity both affect the chance that the code appears, and severity determines the outcome.

The expected selected counts are \(500(0.80)=400\) for \((1,1)\), \(500(0.40)=200\) for \((1,0)\), \(500(0.40)=200\) for \((0,1)\), and \(500(0.05)=25\) for \((0,0)\). Among selected treated records, the outcome risk is \(400/(400+200)=0.667\). Among selected untreated records, it is \(200/(200+25)=0.889\).

$$ \widehat{P}(Y=1\mid A=1,C=1) - \widehat{P}(Y=1\mid A=0,C=1) = \frac{400}{600}-\frac{200}{225} = 0.6667-0.8889 = -0.2222 $$

The selected records show an apparent 22.22-percentage-point lower outcome risk in the treated group, despite the stipulated zero treatment effect. In the full cohort, \(A\) and \(U\) are independent, so both treatment groups have outcome risk \(0.5\). Conditioning on the code changes the composition of the groups with respect to \(U\). The expected-count calculation describes the stipulated selection probabilities; it is not an estimate from a real study.

Assumption check. This demonstration assumes equal initial cell sizes, the stated code probabilities, and \(Y=U\). Under those conditions, selection depends on both \(A\) and \(U\), and \(U\) determines \(Y\). Those assumptions give the collider path \(A \rightarrow C \leftarrow U \rightarrow Y\) and justify the comparison.

A Practical Review Before Including a Feature

When reviewing a candidate claims feature, ask what could cause the feature to be recorded, not only whether the feature predicts treatment or outcome. Write a small causal diagram for plausible causes. If treatment and an outcome cause both point into the feature, adjustment or cohort restriction based on that feature is a collider concern. If treatment and an unmeasured severity cause point into it, and severity affects the outcome, the path through severity may be opened.

1
Establish the time window.
Determine whether the feature is measured before treatment begins or can be affected by treatment, follow-up, or the outcome process.
2
List plausible causes.
For a diagnosis, procedure, or utilization code, consider treatment, baseline severity, outcome-related events, access to care, and coding or observation processes as possible causes.
3
Trace paths in a diagram.
Check whether conditioning on the feature would open a path from \(A\) to \(Y\), directly or through an unmeasured cause such as \(U\).
4
Separate adjustment from eligibility.
Check whether the feature is merely entered as a covariate or whether sample inclusion also depends on it. Both operations can condition on a collider.
5
Investigate overlap and sensitivity.
Look for treatment groups missing within feature-defined strata, and compare conclusions under defensible alternative adjustment sets. Such checks can reveal fragility but cannot prove a diagram correct.

Automated ranking is useful for organizing a large feature space, but it cannot infer causal direction from predictive strength alone. A sensible safeguard is to prioritize clearly pretreatment information, scrutinize post-treatment and follow-up variables, and document why each candidate is included or excluded. Restricting feature search to pretreatment measurements reduces some collider risks; it does not guarantee that all remaining features are valid adjustment variables.

A common mistake is: “The code predicts treatment and outcome, so adjusting for it must reduce confounding.” This reasoning confuses prediction with causal role. If both treatment and an unmeasured cause of outcome produce the code, conditioning on it can associate treatment with that cause. The correction is to identify the feature’s causes and timing in a causal diagram, then assess the paths opened by conditioning.

Collider review complements—not replaces—other checks of causal design. It cannot establish that all confounders have been measured, guarantee overlap, or resolve uncertainty about the diagram. When the causal role of a feature is uncertain, report that uncertainty and examine whether conclusions depend on its inclusion rather than presenting automated selection as a causal justification.

Check Your Understanding

Answer each question, then compare with the brief solutions.

  1. In \(A \rightarrow C \leftarrow U \rightarrow Y\), what is the collider, and what happens to the path through it when analysis conditions on \(C\)?
  2. Suppose \(A\) and \(Y\) are independent binary variables with probability \(0.5\) each, and \(C=1\) if either equals 1. Among records with \(C=1\), calculate \(P(Y=1\mid A=1,C=1)\) and \(P(Y=1\mid A=0,C=1)\).
  3. A claims code was recorded after treatment and predicts the outcome. Does that alone prove it is a collider? Give the next causal question to ask.
  4. Why can restricting a cohort to records with a treatment- and outcome-related eligibility feature create bias even if the feature is not included in a regression model?
  5. In the noisy-code example, what are the selected outcome risks for treated and untreated records, and what explains their difference?

Solutions. (1) \(C\) is the collider because arrows point into it from \(A\) and \(U\). Conditioning on \(C\) can open the path \(A \rightarrow C \leftarrow U \rightarrow Y\). (2) With \(C=1\), the possible pairs are \((1,1),(1,0),(0,1)\), each equally likely. The risks are \(1/2\) for \(A=1\) and 1 for \(A=0\). (3) No. Ask what causes the code and whether treatment and another cause of the outcome both point into it; also establish when it was measured. (4) Restriction conditions on the feature by selecting only \(C=1\) observations, which can open the collider path just as adjustment can. (5) The risks are \(400/600=0.667\) and \(200/225=0.889\). Selection changes the groups’ composition in latent severity \(U\), which determines the outcome.

Clinical Biostats