Tutorials › Causal Inference › Classifying Covariates Across Multiple Treatment Waves

Time-Varying Treatments and Confounding · Tutorial 703 of 972

Classifying Covariates Across Multiple Treatment Waves

Use treatment timing and causal pathways to classify each repeated covariate for the treatment contrast under study.

Intermediate 10 min read

What You'll Learn

  • Place covariate measurements in the correct order relative to each treatment wave.
  • Distinguish pretreatment confounders from confounders affected by earlier treatment.
  • Recognize when one covariate mediates an earlier treatment effect and confounds a later one.
  • Separate outcome prediction from a causal confounding role.
  • Build a wave-by-wave classification and identify assumptions that need subject-matter support.

Why Covariate Classification Depends on Time

In a longitudinal study, a covariate’s role is not determined by its name alone. A disease-severity score, for example, could be measured before treatment begins, after an initial treatment, or just before a later treatment decision. Those measurements occupy different positions in the causal timeline. A score measured after one treatment may help determine the next treatment, while also carrying effects of the earlier treatment forward to the outcome.

The classification question is therefore always specific: what role does this measurement play for this treatment wave and this outcome? A variable can be a mediator for an earlier treatment and a confounder for a later one. It can also predict the outcome without being a confounder or mediator. Correct classification begins with measurement timing and then uses the assumed causal relationships, not statistical association alone.

Definition: Let \(A_1,\ldots,A_K\) denote treatment decisions at successive waves, and let \(Y\) be an outcome measured after the treatment sequence. Let \(L_0\) denote covariates measured before \(A_1\). For \(t=1,\ldots,K-1\), let \(L_t\) denote covariates measured after \(A_t\) and before \(A_{t+1}\). Thus, the ordering is \(L_0,A_1,L_1,A_2,L_2,\ldots,A_K,Y\). A covariate’s classification is relative to a particular treatment \(A_t\), a particular outcome \(Y\), and a causal model for how the variables relate.

This convention matters. \(L_t\) is not a covariate measured before \(A_t\); it is measured after \(A_t\) and before the next treatment, \(A_{t+1}\). A covariate measured before \(A_t\) is part of the history available at that decision, such as \(L_0\) for \(A_1\) or \(L_{t-1}\) for \(A_t\).

Four Roles to Distinguish

Pretreatment confounder: For the effect of \(A_t\) on \(Y\), a pretreatment confounder is measured before \(A_t\) and has a causal role in a noncausal path relating \(A_t\) to \(Y\), such as being a common cause of treatment choice and the outcome. It may also be a sufficient measured variable for controlling a backdoor path. Being associated with both treatment and outcome does not by itself establish this role; the causal structure must support it.

Treatment-affected confounder: A covariate measured before \(A_t\) that has been affected by one or more earlier treatments and that confounds the relation between \(A_t\) and \(Y\). With the notation above, \(L_{t-1}\) may be a treatment-affected confounder for \(A_t\) if an earlier treatment affects it and it also helps determine \(A_t\) and the outcome. For example, \(A_t \rightarrow L_t \rightarrow A_{t+1}\), together with \(L_t \rightarrow Y\), makes \(L_t\) a treatment-affected confounder for \(A_{t+1}\).

Mediator: For the effect of \(A_t\) on \(Y\), a mediator is a variable on a causal pathway from \(A_t\) to \(Y\). It must be affected by \(A_t\) and causally transmit at least part of the effect to \(Y\); being measured after treatment is not sufficient to make a variable a mediator.

Outcome predictor: A covariate that predicts or is associated with \(Y\). This describes its relationship with the outcome, not necessarily a confounding or mediating role. A predictor may be a confounder or mediator too, but prediction alone does not establish either role.

These descriptions are not four mutually exclusive labels for an entire variable. A measurement can occupy different roles for different treatment waves. For example, \(L_t\) may be a mediator for the effect of \(A_t\) and, if it also influences \(A_{t+1}\) and \(Y\), a treatment-affected confounder for the effect of \(A_{t+1}\). Conversely, a variable may predict \(Y\) without influencing any treatment decision and without lying on a treatment-to-outcome causal pathway.

A Wave-by-Wave Classification Procedure

A useful classification records, for every covariate measurement, when it was obtained and which treatment contrasts it may affect. The procedure below is a reasoning aid, not an automatic rule: the proposed arrows must be justified by substantive knowledge about the study.

1
Write the timeline.
Place every measurement before or after the treatment decision it might influence. Respect the actual protocol, including when a measurement was available to clinicians or participants.
2
Name the target treatment wave.
For each classification, ask about \(A_t\) and \(Y\), rather than labelling a covariate simply “a confounder” without specifying the treatment contrast.
3
Trace causal relationships.
Ask whether the covariate helps cause or determine \(A_t\), whether it affects \(Y\), whether an earlier \(A_j\) affects it, and whether it transmits an effect of \(A_t\) to \(Y\).
4
Assign all supported roles.
Record overlapping roles where appropriate, and mark uncertain roles as questions for the study protocol or subject-matter experts rather than inferring them from association alone.

The timeline imposes an important check on any proposed classification. Under this notation, a post-\(A_t\) covariate \(L_t\) cannot be a pretreatment confounder of \(A_t\): it was not measured before that decision. It can, however, be a mediator for \(A_t\), a confounder for \(A_{t+1}\), or both, depending on the causal structure.

Worked Example: Disease Severity Across Three Treatment Waves

Hypothetical setting. Patients with a chronic condition have severity measured at baseline, \(L_0\). Clinicians choose treatment \(A_1\), measure severity again as \(L_1\), and choose \(A_2\). Severity \(L_2\) is then recorded before a final treatment decision \(A_3\). The outcome \(Y\) is a health score measured after the treatment sequence. Assume the clinical protocol and causal knowledge support the following: baseline severity influences each treatment decision and the outcome; each treatment can alter later severity; and severity before a treatment decision influences both that decision and the later health outcome.

Baseline \(L_0\) for \(A_1\). \(L_0\) is measured before \(A_1\), influences the treatment choice, and affects \(Y\). It is therefore a pretreatment confounder for the \(A_1\)-to-\(Y\) relation. The same measurement is also a pretreatment confounder for later treatments if it continues to influence their choices and the outcome.

Severity \(L_1\). Its order is \(A_1 \rightarrow L_1 \rightarrow A_2\). If \(A_1\) changes severity and severity affects \(Y\), \(L_1\) mediates part of the effect of \(A_1\) on \(Y\). If \(L_1\) also affects the choice of \(A_2\) and affects \(Y\), it is a treatment-affected confounder for the \(A_2\)-to-\(Y\) relation. The roles refer to different treatment waves, so they do not contradict one another.

Severity \(L_2\). Because \(L_2\) is measured after \(A_2\) and before \(A_3\), it cannot be a pretreatment confounder for \(A_2\). Under the stated assumptions, it can mediate the effect of \(A_2\) on \(Y\) and be a treatment-affected confounder for \(A_3\), if it affects both \(A_3\) and \(Y\).

The classifications depend on the stated causal assumptions, not on the word “severity” or on a correlation table. If \(L_1\) were not affected by \(A_1\), it would not be a mediator of \(A_1\), even if it predicted \(Y\). If \(L_1\) did not influence \(A_2\), it would not confound the \(A_2\)-to-\(Y\) relation in this description.

Why a Treatment-Affected Covariate Can Change Roles

The central pattern is straightforward when written with the wave indices. Suppose \(A_t\) affects \(L_t\), and \(L_t\) affects both the next treatment \(A_{t+1}\) and the outcome \(Y\). The directed paths include:

$$ A_t \rightarrow L_t \rightarrow Y \qquad\text{and}\qquad A_{t+1} \leftarrow L_t \rightarrow Y. $$

The first path makes \(L_t\) a mediator for \(A_t\). The second shows why \(L_t\) is a confounder for the later treatment \(A_{t+1}\): it is a common cause of that treatment and the outcome in the specified causal structure. Its measurement after \(A_t\) does not change that it precedes \(A_{t+1}\).

This gives a simple timing-and-path justification for the classification. \(L_t\) cannot confound \(A_t\), because it occurs after \(A_t\). It can lie on a causal pathway beginning at \(A_t\), and it can be a cause of both a later treatment and \(Y\). A single global label such as “post-treatment covariate” obscures these distinct relationships.

Worked Example: Biomarker-Guided Dose Changes

Hypothetical setting. A study records kidney function \(L_0\) before an initial medication decision \(A_1\). After the initial dose, clinicians measure a biomarker \(L_1\) and use it to choose a dose change \(A_2\). The final outcome \(Y\) is a measure of kidney health. Assume the clinical model says baseline kidney function affects initial prescribing and the outcome; \(A_1\) affects the biomarker; the biomarker affects both the dose change and the outcome; and \(A_2\) may also affect the outcome.

Classify \(L_0\) for \(A_1\). It is measured before the initial dose, and under the assumptions it affects both prescribing and \(Y\). It is a pretreatment confounder for \(A_1\). It is also an outcome predictor because it affects the final kidney-health measure.

Classify \(L_1\) for \(A_1\). It follows \(A_1\), so it is not a pretreatment confounder of the initial dose. Because \(A_1\) affects \(L_1\), and \(L_1\) affects \(Y\), it lies on a causal pathway from \(A_1\) to \(Y\): it is a mediator for the initial-treatment effect.

Classify \(L_1\) for \(A_2\). It is measured before the dose change, influences that decision, and affects \(Y\). Since it was also affected by the earlier treatment \(A_1\), it is a treatment-affected confounder for the \(A_2\)-to-\(Y\) relation. This remains true even though the same measurement is a mediator for \(A_1\).

The protocol provides evidence about timing and how clinicians use the biomarker, while the assumed causal effects provide the rest of the classification. If clinicians merely recorded \(L_1\) but did not use it in choosing \(A_2\), the stated reason for calling it a confounder of \(A_2\) would need revision.

Outcome Prediction Is Not the Same as Confounding

A covariate may be valuable for predicting \(Y\) without being a confounder for a treatment contrast. Consider a hypothetical study in which a baseline genetic marker predicts the final outcome, but does not influence treatment assignment and is not affected by treatment. Under that causal model, the marker is an outcome predictor, but it is not a confounder of the treatment-outcome relation and is not a mediator.

The reverse distinction is also important: a confounder need not be a strong outcome predictor in a particular sample to have a causal confounding role. Classification concerns the causal structure, while predictive strength concerns how well observed values forecast outcomes. A measured association may help identify questions to investigate, but it cannot, by itself, establish whether a variable causes treatment, causes the outcome, or lies on a treatment pathway.

Worked Example: Separating a Predictor From a Confounder

Hypothetical setting. Before \(A_1\), a study records age \(L_0^{(a)}\) and a laboratory marker \(L_0^{(b)}\). Assume age affects treatment choice and \(Y\). Assume the laboratory marker predicts \(Y\), but has no effect on treatment choice and is not affected by any treatment. After \(A_1\), the study records \(L_1\), which is affected by \(A_1\), influences \(A_2\), and affects \(Y\).

Age \(L_0^{(a)}\). It precedes \(A_1\) and affects both \(A_1\) and \(Y\), so it is a pretreatment confounder for the \(A_1\)-to-\(Y\) relation. It also predicts \(Y\).

Laboratory marker \(L_0^{(b)}\). It is a predictor of \(Y\), but the hypothetical assumptions give it no causal role in treatment assignment and no mediating role. Thus, it is not classified as a confounder or mediator on these assumptions. If new information showed that clinicians used the marker to choose treatment, its classification would need to be reconsidered.

Repeated measurement \(L_1\). Its timing and assumed arrows make it a mediator for \(A_1\) if the path from \(A_1\) through \(L_1\) to \(Y\) is causal. Since it is affected by \(A_1\) and affects both \(A_2\) and \(Y\), it is also a treatment-affected confounder for \(A_2\). It additionally predicts \(Y\), but prediction is not the reason for either causal label.

Common Mistakes and a Practical Audit

  • Using the wrong time index. Calling \(L_t\) a pre-\(A_t\) variable contradicts the convention that \(L_t\) is measured after \(A_t\). Check the timeline: \(L_{t-1}\), not \(L_t\), is the intervening covariate measured before \(A_t\).
  • Labelling every post-treatment measure a mediator. A measure is a mediator only if it is affected by the treatment and causally transmits an effect to \(Y\). Timing alone establishes neither causal link.
  • Calling every outcome predictor a confounder. Predicting \(Y\) does not show that a covariate causes or helps determine treatment, or that it closes a noncausal path.
  • Assigning one label to a variable for all waves. State the treatment contrast each time. A covariate can mediate an earlier treatment effect and confound a later treatment effect.
  • Inferring causal roles from observed associations alone. Use the protocol, measurement schedule, clinical knowledge, and a stated causal model. A table showing that a covariate is associated with treatment and outcome does not settle the direction or causal meaning of those associations.

A compact audit table can make the reasoning explicit. For each measurement, record its time, which treatment decisions it precedes, whether earlier treatment can affect it, whether it influences treatment choice, and whether it can causally affect \(Y\). Then assign roles separately for each treatment wave. This classification clarifies the causal structure that an analysis would need to respect; it does not by itself select or justify a particular estimation method.

Key takeaway: Classify covariates by their position in the treatment timeline and their causal relationships to each specific treatment and the outcome. A post-\(A_t\) covariate \(L_t\) may mediate the effect of \(A_t\) and confound the effect of \(A_{t+1}\), while an outcome predictor need not be either.

Check Your Understanding

For each question, state the treatment wave and outcome to which your classification refers.

  1. Under the stated ordering \(L_0,A_1,L_1,A_2,Y\), can \(L_1\) be a pretreatment confounder for \(A_1\)? Explain using measurement timing.
  2. Suppose \(A_1\) affects \(L_1\), and \(L_1\) affects both \(A_2\) and \(Y\). What roles can \(L_1\) have for the effects of \(A_1\) and \(A_2\), respectively?
  3. A baseline covariate predicts \(Y\) but, under the assumed causal model, does not affect treatment assignment or lie on a treatment-to-outcome pathway. Which role is supported, and which roles are not established?
  4. Why is association between a covariate and both treatment and outcome not, by itself, sufficient to classify it as a confounder?
  5. For a covariate measured after \(A_2\) but before \(A_3\), name one role it cannot have for \(A_2\) and describe two roles it could have under suitable causal assumptions.
Clinical Biostats