Why a Covariate’s Role Depends on Time
In a longitudinal study, treatment decisions may be made repeatedly as a person’s health changes. A symptom measured before the first treatment decision could help determine whether treatment begins and could also affect the outcome. The same symptom, measured after an earlier treatment but before a later decision, may have a different role: it can be part of the earlier treatment’s effect and also influence the next treatment choice.
A variable’s name or measurement scale does not settle its causal role. The relevant questions are when was it measured, which treatment decision is being considered, and what causal paths connect it to treatment and outcome? A variable can be a confounder for one treatment decision, a mediator for an earlier treatment, both, or neither.
Three Roles, Three Causal Questions
The arrows describe causal assumptions, not merely observed correlations. A covariate associated with both treatment and outcome is not automatically a confounder: those associations could arise from other variables, selection, or chance. Conversely, a confounding path can be present even when a particular sample shows weak associations. A causal diagram and knowledge of how decisions are made help distinguish these cases.
A mediator is defined in relation to a particular earlier treatment and outcome. Being measured after treatment is necessary for a variable to mediate that treatment’s effect, but timing alone is not enough: the variable must also lie on a causal path. A post-treatment variable that does not carry an effect from treatment to outcome is not a mediator merely because it was measured later.
These labels are not mutually exclusive. A covariate can be prognostic and a confounder if it predicts the outcome and also contributes to treatment assignment. A covariate can be prognostic and a mediator if it carries an earlier treatment effect to the outcome. What matters is the role it plays in the causal structure for the question being asked.
Worked Examples of Role Classification
Worked Example: Severity Before the First Decision
Suppose a hypothetical study follows 100 patients with a chronic condition. Before treatment \(A_0\) is decided, clinicians record whether each patient has high or low disease severity. Among 50 patients with high severity, 30 receive treatment; among 50 with low severity, 10 receive it. Clinical knowledge supports the causal structure \(L_0 \rightarrow A_0\) and \(L_0 \rightarrow Y\), where \(L_0\) is severity and \(Y\) is a later adverse event.
The observed treatment proportions are \(30/50=0.600\) for high severity and \(10/50=0.200\) for low severity. Thus, treatment is more common in the high-severity group in these hypothetical data. The difference is \(0.600-0.200=0.400\), or 40 percentage points.
The classification follows from the timing and assumed causal structure, not from that 40-point difference alone. Severity is measured before \(A_0\), affects the treatment decision, and also affects the outcome. It therefore contributes the backdoor path \(A_0 \leftarrow L_0 \rightarrow Y\), making severity a confounder for the effect of \(A_0\) on \(Y\). Because it is related to the outcome, it may also be prognostic. It is not a mediator of \(A_0\), since it precedes that treatment.
Worked Example: A Covariate That Changes Role
In a hypothetical two-decision study of 200 patients, \(A_0\) is an initial treatment, \(L_1\) is symptom control measured after \(A_0\) but before the next decision, and \(A_1\) is a later treatment intensification. Suppose 60 of 100 patients receiving \(A_0=1\) have symptom control, compared with 30 of 100 receiving \(A_0=0\). The observed proportions are \(60/100=0.600\) and \(30/100=0.300\), respectively.
Suppose clinicians use symptom control when deciding \(A_1\): 20 of the 90 patients with control receive intensification, while 55 of the 110 without control receive it. The corresponding proportions are \(20/90=0.222\) and \(55/110=0.500\). Suppose also that clinical knowledge supports arrows from symptom control to the later outcome and from symptom control to the intensification decision.
For the effect of \(A_0\) on \(Y\), symptom control is downstream of \(A_0\) and lies on the path \(A_0 \rightarrow L_1 \rightarrow Y\). It is therefore a mediator of a possible effect of the initial treatment. For the effect of \(A_1\) on \(Y\), symptom control is measured before the intensification decision, helps determine that decision, and affects the outcome. It is therefore a confounder for the later treatment contrast as well. The same \(L_1\) has two valid labels because the treatment being considered has changed.
The proportions above describe the hypothetical data; they do not, by themselves, prove any of the causal arrows. The classifications rely on the stated clinical causal assumptions and measurement order.
Worked Example: Predictive but Not a Confounder
Suppose a hypothetical randomized study assigns 100 high-risk and 100 low-risk patients equally between treatment and control. Among the high-risk patients, 50 receive treatment and 50 control; the same counts apply among low-risk patients. In the control group, 30 of 50 high-risk patients and 10 of 50 low-risk patients experience the outcome.
The control-group outcome proportions are \(30/50=0.600\) for high risk and \(10/50=0.200\) for low risk, a difference of \(0.600-0.200=0.400\), or 40 percentage points. Risk status is strongly prognostic in these hypothetical data. Yet treatment assignment is balanced within each risk group: \(50/100=0.500\) in the high-risk group and \(50/100=0.500\) in the low-risk group.
Given the stated randomization and the absence of a causal effect of risk status on treatment assignment, risk status is prognostic but is not a confounder of this treatment contrast. The fact that it predicts the outcome does not, on its own, make it a confounder. In a nonrandomized setting, the same risk factor could affect treatment decisions and could then play both roles.
Why Timing and Paths Work Together
Temporal order rules out some classifications, but it does not establish a causal role by itself. A variable measured before \(A_t\) can be considered as a possible confounder of \(A_t\), but it is not a confounder merely for being pre-treatment. A variable measured after \(A_t\) cannot be a pre-treatment common cause of that same \(A_t\), although it might mediate an effect of \(A_t\) or have another post-treatment role.
This can be seen from the direction of the arrows. A common cause of \(L_t\) and \(A_t\) must precede, or otherwise be causally prior to, the decision represented by \(A_t\). By contrast, for \(L_t\) to mediate an effect of \(A_{t-1}\), the causal ordering must allow \(A_{t-1} \rightarrow L_t\); for \(L_t\) to carry that effect to \(Y\), the path must continue from \(L_t\) toward \(Y\). Thus, measurement order constrains possible paths, while causal knowledge determines which paths are plausible.
The first path makes \(L_t\) a mediator of an earlier treatment effect. The second makes it a confounder of the later treatment effect. Both can hold at once when \(L_t\) is measured after \(A_{t-1}\) and before \(A_t\). This is a key feature of treatment-confounder feedback: earlier treatment can change a covariate that then influences subsequent treatment and the outcome.
A Practical Classification Sequence
For each candidate covariate, make the classification separately for each treatment decision and outcome. A compact audit is:
Name the treatment decision \(A_t\) and the outcome \(Y\). Do not label a variable simply “a confounder” without stating which treatment effect is under discussion.
Establish whether the covariate was measured before or after \(A_t\), and whether it was measured before or after earlier treatments such as \(A_{t-1}\).
Ask whether it helps determine \(A_t\), whether it affects \(Y\), whether an earlier treatment can affect it, and whether it lies on a directed path to \(Y\).
Use confounder for a role in a noncausal treatment–outcome path, mediator for a role on a directed path from an earlier treatment, and prognostic for outcome prediction. Record multiple roles when the causal structure supports them.
The sequence helps prevent a common shortcut: using “predicts the outcome” as a synonym for “confounder.” Prediction is about the outcome relationship; confounding is about how treatment assignment and outcome are connected through causal paths. The two questions overlap only when the causal structure makes them overlap.
Common Mistakes and Why the Distinction Matters
- Calling every post-treatment variable a mediator. Being measured after treatment is not enough. The variable must lie on a directed path from that treatment to the outcome.
- Calling every outcome predictor a confounder. A variable can be strongly prognostic without influencing treatment assignment or contributing to a noncausal path, as in the randomized example.
- Assigning one permanent label to a repeated variable. A time-varying covariate can mediate an earlier treatment effect and confound a later decision. Always identify the treatment time in the claim.
- Inferring causal roles from observed proportions alone. Differences in treatment or outcome proportions are descriptive. Causal classification also requires temporal information and defensible assumptions about the arrows.
- Treating classification as an automatic adjustment instruction. Identifying a covariate’s role is an essential first step, but it does not by itself determine which variables should be conditioned on for a particular estimand. That decision depends on the causal question and the longitudinal structure.
These distinctions matter because treatment histories contain several decision points and a covariate may have been affected by earlier treatment. If its timing and role are mislabeled, the analysis can answer a different causal question from the one intended. A clear timeline and explicit causal paths make the assumptions visible before an analysis is chosen.
Check Your Understanding
For each question, state the treatment decision and outcome to which your classification refers.
- A symptom is measured before \(A_1\), is influenced by \(A_0\), affects the decision to give \(A_1\), and affects \(Y\). What roles can it play relative to \(A_0\) and \(A_1\)?
- Why is a covariate’s strong association with \(Y\) not sufficient to classify it as a confounder of \(A_t\)?
- A variable is measured after \(A_t\), but there is no causal path from \(A_t\) through that variable to \(Y\). Is it a mediator of \(A_t\)’s effect on \(Y\)? Explain.
- What information, beyond observed treatment proportions, would help justify classifying a pre-decision variable as a confounder?
- Can a variable be prognostic but not a confounder in a randomized study? Give the causal reason.