Tutorials › Causal Inference › Longitudinal Histories and Treatment-Confounder Ordering

The G-Formula and Dynamic Regimes · Tutorial 705 of 972

Longitudinal Histories and Treatment-Confounder Ordering

Build a precise timeline of longitudinal covariates and treatments so that each history contains exactly the information available before its treatment decision.

Advanced 10 min read

What You'll Learn

  • Define treatment and covariate histories using a consistent treatment-wave index.
  • Identify which covariates are measured before a current treatment and which follow earlier treatment.
  • Represent how prior treatment may affect later confounders and outcomes.
  • Factor a longitudinal joint distribution in temporal order without interpreting the factors as causal effects.
  • Detect indexing and measurement-timing errors in longitudinal data descriptions.

Why Longitudinal Ordering Matters

In a longitudinal study, treatment decisions and covariate measurements occur repeatedly. A covariate measured before a treatment decision can help describe the information available when that treatment is chosen. A covariate measured after an earlier treatment may also have been affected by that treatment. These distinctions matter: treating every recorded covariate as if it were a baseline characteristic can misrepresent the sequence of events and the causal relationships being studied.

The goal here is to give the sequence an unambiguous notation. We will define the covariates and treatments at each wave, specify what counts as the history immediately before treatment, and show how earlier treatment can precede later confounders and the outcome. A history is a way to organize observed variables by time; by itself, it does not establish that a causal effect is identified.

Definition: Consider \(K\) treatment waves indexed \(t=0,\ldots,K-1\). Let \(L_0\) denote baseline covariates measured before the first treatment \(A_0\). For \(t=1,\ldots,K-1\), let \(L_t\) denote covariates measured after \(A_{t-1}\) and before \(A_t\). Let \(Y\) be the outcome measured after the final treatment \(A_{K-1}\). The temporal sequence is $$ L_0,\ A_0,\ L_1,\ A_1,\ \ldots,\ L_{K-1},\ A_{K-1},\ Y. $$

The subscripts identify positions in this sequence, not necessarily calendar dates or equal-length intervals. In particular, \(L_t\) is pre-treatment for \(A_t\), but for \(t\geq 1\) it is post-treatment with respect to \(A_{t-1}\). Thus a covariate can be both a later treatment's pre-treatment covariate and an earlier treatment's post-treatment variable.

Histories Before a Treatment Decision

Write \(\bar L_t=(L_0,\ldots,L_t)\) for the covariate history through wave \(t\), and \(\bar A_{t-1}=(A_0,\ldots,A_{t-1})\) for the treatment history before wave \(t\). At \(t=0\), there are no earlier treatments, so \(\bar A_{-1}\) is an empty history. The information history just before treatment \(A_t\) is

$$ H_t=(\bar L_t,\bar A_{t-1}), \qquad t=0,\ldots,K-1. $$

Consequently, \(H_0=(L_0)\), while \(H_1=(L_0,L_1,A_0)\). The current treatment \(A_t\) is not part of \(H_t\): it is the treatment decision that follows that history. If we want to name the variables through the current treatment, we can write \((H_t,A_t)\), but that is no longer the pre-treatment history.

This convention prevents a common off-by-one error. The history before \(A_1\) includes \(A_0\), not \(A_1\). Similarly, \(L_1\) is included because it is measured before \(A_1\), while it follows \(A_0\). Histories can therefore overlap in their covariates and treatments, but their endpoint is always clear.

Worked Example: Listing Histories for Three Treatment Waves

Suppose a hypothetical study records baseline health \(L_0\), then three treatment decisions \(A_0,A_1,A_2\). Health status is recorded between treatment waves as \(L_1\) and \(L_2\), and the outcome \(Y\) is measured after \(A_2\). Here \(K=3\), and the sequence is

$$ L_0,\ A_0,\ L_1,\ A_1,\ L_2,\ A_2,\ Y. $$

Before the first decision, \(H_0=(L_0)\). Before the second decision, \(H_1=(L_0,L_1,A_0)\). Before the third decision, \(H_2=(L_0,L_1,L_2,A_0,A_1)\). In each case the current treatment is excluded: the current treatment is \(A_0\) at \(t=0\), \(A_1\) at \(t=1\), and \(A_2\) at \(t=2\).

For example, a person's information before \(A_2\) might be \(L_0=\) moderate baseline symptoms, \(L_1=\) improved symptoms, \(L_2=\) severe symptoms, \(A_0=\) low dose, and \(A_1=\) high dose. Those measurements and past decisions make up that person's \(H_2\); the value of \(A_2\) and the later outcome are not yet part of it.

How Treatment-Confounder Ordering Creates Feedback

A time-varying covariate \(L_t\) may influence the current treatment \(A_t\) and predict the later outcome \(Y\). In that role, it is a potential confounder of the relationship between \(A_t\) and \(Y\). But if \(L_t\) follows an earlier treatment \(A_{t-1}\), it may also be affected by that earlier treatment. This is the defining ordering behind treatment-confounder feedback: past treatment can change a later covariate, and that later covariate can inform subsequent treatment.

The following arrows summarize possible causal relationships, not relationships guaranteed by the notation. An arrow \(A_{t-1}\to L_t\) means earlier treatment may affect the later covariate; \(L_t\to A_t\) means the covariate may influence current treatment; and \(L_t\to Y\) means it may affect the outcome. The arrows need substantive justification from the study and scientific context. Merely observing variables at successive times does not prove those causal links.

$$ A_{t-1}\longrightarrow L_t\longrightarrow A_t, \qquad L_t\longrightarrow Y, \qquad A_{t-1}\longrightarrow Y. $$

This structure helps explain why “adjust for all measured covariates” is not a sufficient analysis plan. A covariate can be a confounder for a later treatment while also lying downstream of an earlier treatment. The earlier material on time-varying confounding and treatment-affected covariates addresses the consequences for adjustment. The task here is narrower and essential: represent the order correctly before choosing an analysis.

Worked Example: Symptom Severity Between Treatment Decisions

Consider a hypothetical two-wave treatment study of a chronic condition. At baseline, severity \(L_0\) is recorded before treatment \(A_0\). After \(A_0\), severity is recorded again as \(L_1\), then treatment \(A_1\) is chosen, and the outcome \(Y\) is measured later. For one hypothetical participant, suppose the records are \(L_0=\) moderate, \(A_0=\) standard dose, \(L_1=\) severe, \(A_1=\) increased dose, and \(Y=\) symptom improvement at follow-up.

The pre-\(A_1\) history is \(H_1=(L_0,L_1,A_0)\). The ordering allows a substantive possibility that the standard dose affected the later severity measurement, and that the severe status influenced the increase to \(A_1\). Because \(L_1\) also may predict follow-up improvement, it can be a confounder for the \(A_1\)-outcome relationship. The record alone does not show that either causal arrow is true; clinical knowledge and the study protocol are needed to support those claims.

It would be incorrect to describe \(L_1\) simply as a baseline covariate: it occurred after \(A_0\). It would also be incorrect to include \(A_1\) in \(H_1\), because the history is defined immediately before that decision. The full order is \(L_0,A_0,L_1,A_1,Y\).

Temporal Factorization: A Notation Check

A simple probability factorization provides a useful check on whether the sequence has been indexed consistently. For two treatment waves, the variables occur in the order \(L_0,A_0,L_1,A_1,Y\). By repeated application of the chain rule for a joint distribution, their joint probability mass or density can be written as

$$ p(l_0,a_0,l_1,a_1,y) = p(l_0)\, p(a_0\mid l_0)\, p(l_1\mid l_0,a_0)\, p(a_1\mid l_0,a_0,l_1)\, p(y\mid l_0,a_0,l_1,a_1). $$

This expression is a statistical representation of the observed joint distribution. In particular, the factors are conditional distributions, not causal effects. The expression does not assert that every listed variable causally affects every later variable; it follows from the chosen variable order.

Worked Example: Checking a Two-Wave Probability Path

Suppose, in a hypothetical dataset, the following conditional probabilities apply to one particular path: \(P(L_0=1)=0.40\), \(P(A_0=1\mid L_0=1)=0.60\), \(P(L_1=1\mid L_0=1,A_0=1)=0.50\), \(P(A_1=1\mid L_0=1,A_0=1,L_1=1)=0.70\), and \(P(Y=1\mid L_0=1,A_0=1,L_1=1,A_1=1)=0.30\). Find the joint probability of this specified path.

Apply the chain rule in the order \(L_0,A_0,L_1,A_1,Y\):

$$ \begin{aligned} &P(L_0=1,A_0=1,L_1=1,A_1=1,Y=1)\\ &=0.40\times0.60\times0.50\times0.70\times0.30\\ &=0.0252. \end{aligned} $$

Thus the probability of this particular combination of values is \(0.0252\), or \(2.52\%\), under the stated hypothetical distribution. Each conditioning set includes the variables earlier in the sequence. For example, the probability for \(A_1\) is conditional on \(L_1\) and the earlier treatment \(A_0\), while \(A_1\) is not included as a condition for \(L_1\). The calculation is a probability factorization, not an estimate of a treatment effect.

The chain-rule factorization can be justified one factor at a time. For any ordered variables \(V_1,\ldots,V_m\), the chain rule gives the joint distribution as the distribution of \(V_1\) times the conditional distribution of \(V_2\) given \(V_1\), continuing in sequence. For the two-wave example, the first two steps are

$$ p(l_0,a_0,l_1,a_1,y) = p(l_0)\,p(a_0,l_1,a_1,y\mid l_0) = p(l_0)\,p(a_0\mid l_0)\,p(l_1,a_1,y\mid l_0,a_0). $$

Applying the same identity to the remaining conditional joint distribution yields the five-factor expression above. This derivation depends on the temporal ordering used to name the variables, not on a claim that the observational process is causal or that any causal effect is identifiable.

Measurement Timing Is Part of the Definition

A variable name and a calendar date may not be enough to determine its position relative to treatment. If a blood test and a dose change are both recorded on “day 7,” the data label does not tell us whether the blood was drawn before or after the dose decision. The protocol, timestamps, or a defensible measurement convention must establish the ordering. Otherwise, we cannot confidently classify that measurement as pre-treatment for the decision or post-treatment with respect to it.

The same issue arises when a covariate is measured several times between decisions. The analysis may need a clearly defined summary or a more detailed time index, but it must not silently assign a measurement to the wrong side of a treatment. Earlier material on choosing covariate lags and auditing longitudinal tables emphasizes that treatment timing, not a convenient column label, determines the relevant lag.

Variable positionRelationship to current treatment \(A_t\)Possible role
\(L_0\)Measured before \(A_0\)Baseline covariate
\(L_t\), for \(t\geq1\)After \(A_{t-1}\), before \(A_t\)Pre-treatment covariate for \(A_t\); potentially affected by prior treatment
\(A_t\)Current treatment decisionNot included in the history immediately before itself
\(Y\)After the final treatment in this setupOutcome, not a pre-treatment covariate

Common Mistakes and a Practical Audit

A frequent mistake is to let the subscript suggest that \(L_t\) is measured before all treatments up to and including \(A_t\). Under the convention here, it is measured before \(A_t\) but after \(A_{t-1}\). Another mistake is to append an extra covariate after the final treatment without defining it. In this setup the sequence ends with \(A_{K-1},Y\); there is no \(L_K\). If a post-final-treatment covariate is genuinely recorded, the timeline must explicitly place and define it rather than using it as though it were already part of this sequence.

A reliable audit follows the time order rather than relying on names:

1
Fix the number of treatment waves.
Write the treatment indices as \(0,\ldots,K-1\), and do not refer to a current treatment outside that range.
2
Place each measurement.
State whether each covariate occurs before or after the treatment decision at each wave.
3
Construct the pre-treatment history.
For \(A_t\), include \(\bar L_t\) and \(\bar A_{t-1}\), and exclude \(A_t\) itself and all later variables.
4
Separate ordering from causation.
Use the timeline to establish what precedes what; justify any causal arrows with substantive knowledge rather than notation alone.

The central payoff is clarity. Once the sequence is explicit, it becomes possible to discuss which variables precede a particular treatment, which may have been changed by earlier treatment, and what data are needed to represent the process. The ordering is foundational to longitudinal causal analysis, but it is not itself an adjustment recipe or a guarantee of valid causal conclusions.

Check Your Understanding

Use the convention that \(L_t\) is measured before \(A_t\), while \(L_t\) for \(t\geq1\) follows \(A_{t-1}\).

  1. For two treatment waves, write the full sequence of variables and the history \(H_1\). Which treatment is current at \(t=1\)?
  2. For three treatment waves, list the components of \(H_2\). Explain why \(A_2\) is not included.
  3. In a study where \(A_0\) may change disease severity \(L_1\), and \(L_1\) may influence \(A_1\), explain why \(L_1\) is both post-treatment for one decision and pre-treatment for another.
  4. Why does a chain-rule factorization of a longitudinal joint distribution not, by itself, establish causal effects?
  5. A biomarker and a dose decision have the same recorded date. What information is needed before classifying the biomarker as pre-treatment or post-treatment?
Clinical Biostats