Why Covariate Timing Matters
A treatment model must use the information available when the treatment decision is made. In longitudinal data, a variable recorded at a visit may have been measured before the decision, after it, or at an unclear point in the workflow. Those are different statistical situations, even if the data set assigns them the same visit label. A timing error can put a consequence of treatment into the history used to model that treatment.
The key task is therefore to make the time order explicit before constructing model rows or calculating inverse probability weights. The same variable can be a valid predictor for one treatment decision and an invalid predictor for an earlier decision.
This indexing convention describes a chronology: \(L_0\), then \(A_0\), then \(L_1\), then \(A_1\), and so on. If a covariate is measured after \(A_t\), it does not belong in \(H_t\); it may instead be part of \(L_{t+1}\), if it is available before the next decision. If there is no next decision, it is a post-treatment measurement rather than a component of any treatment history in this sequence.
The notation represents actual time order, not merely a database label. A measurement listed under “week 4” is not automatically pre-decision for a week-4 treatment: its collection time, the treatment decision time, and, when relevant, the time its value became available must be checked.
Constructing a Temporally Valid History
For each treatment decision, make a timeline before specifying the conditioning variables. Record the time of the decision and the time of every candidate covariate measurement. Include a covariate in \(H_t\) only if it was measured before \(A_t\) and is part of the history the decision process could use. A value entered retrospectively can be useful for analysis, but its data-entry time does not make it information available at the earlier decision.
When measurements occur at the same nominal visit as treatment, the visit label alone does not resolve their ordering. For example, a blood test drawn at 08:00 and a dose ordered at 10:00 may be pre-decision information; a blood test drawn at 12:00 is not. If the timestamps or protocol do not establish the order, the temporal status is uncertain. It should not be silently resolved by treating the measurement as pre-treatment.
Use the actual decision or assignment time, rather than an interval label alone.
Distinguish when a value was measured from when it was entered or became available.
Include available covariates and past treatments; exclude the current treatment and future measurements.
Confirm that every predictor could have been known at the time of the treatment assignment represented by that row.
Worked Example: Mapping Three Decisions to Histories
Suppose a study records \(L_0\), a baseline severity measure, before treatment \(A_0\); records \(L_1\), a symptom score, after \(A_0\) but before \(A_1\); and records \(L_2\), a laboratory value, after \(A_1\) but before \(A_2\). A participant has \(L_0=2\), \(A_0=1\), \(L_1=5\), \(A_1=0\), and \(L_2=8\).
At decision 0, the available history is \(H_0=L_0=2\). The symptom score and laboratory value have not yet been measured, so neither can be a predictor for \(A_0\).
At decision 1, \(H_1=(L_0,A_0,L_1)=(2,1,5)\). The symptom score is available and the earlier treatment is part of the history. The laboratory value \(L_2=8\) is not yet available.
At decision 2, \(H_2=(L_0,A_0,L_1,A_1,L_2)=(2,1,5,0,8)\). Here the laboratory value is eligible because it precedes \(A_2\).
Suppose the fitted probabilities for this participant’s observed treatments, evaluated at their respective histories, are \(0.8\), \(0.5\), and \(0.6\). The product of the sequential assignment probabilities is \(0.8\times0.5\times0.6=0.24\). The corresponding unstabilized inverse probability weight is \(1/0.24=4.1667\), approximately. This calculation uses each treatment’s own pre-decision history; it does not place \(L_2\) into the model for \(A_0\) or \(A_1\).
Sequential Probabilities and the Full Covariate Record
A crucial distinction is between the sequence of treatment probabilities evaluated at the successive histories and the conditional probability of the treatment sequence given the complete covariate record. These are not generally the same object. In particular, a complete record can include later covariates affected by earlier treatment.
For a discrete-time process, assume the relevant conditional probabilities are defined on the histories under consideration. For general covariates, use regular conditional distributions. The chain rule in chronological order gives the joint distribution as the initial covariate distribution, followed by the conditional distribution of each treatment given its pre-decision history and the conditional distribution of each subsequent covariate given the history and treatment just observed. In density notation, one version is
To verify this factorization, apply the ordinary chain rule to the ordered variables. The first factor is \(f(l_0)\). Given \(L_0=l_0\), the next factor is \(P(A_0=a_0\mid L_0=l_0)\). Given these variables, the next factor is \(f(l_1\mid L_0,A_0)\). Continuing in chronological order gives the displayed factors, because the variables preceding \(A_t\) are exactly the components of \(H_t\), and those preceding \(L_{t+1}\) are \(H_t,A_t\). Multiplying the factors reconstructs the joint distribution by the chain rule. This is a factorization of the joint process; it does not condition every treatment on future covariates. \(\square\)
There is a different chain-rule identity if the target is explicitly the treatment sequence conditional on the full covariate record. For values with \(P(\bar L=\bar l)>0\) in the discrete case, it is
For \(t=0\), the conditioning treatment history in the corresponding factor is empty. This identity follows by applying the chain rule to \(A_0,\ldots,A_T\) under the conditional distribution given \(\bar L=\bar l\). Each factor conditions on the same complete covariate record, including later covariates. It is therefore not a justification for replacing those factors with \(P(A_t=a_t\mid H_t)\).
Worked Example: Why Conditioning on Later Covariates Changes the Probability
Let \(A_0\sim\operatorname{Bernoulli}(0.5)\), let the later covariate be \(L_1=A_0\), and let \(A_1\sim\operatorname{Bernoulli}(0.5)\) independently of \(A_0\). The histories are \(H_0\) (empty in this example) and \(H_1=(A_0,L_1)\). The sequential probabilities of the path \(A_0=1,A_1=1\) are \(0.5\) and \(0.5\), so their product is \(0.25\).
Now condition on the full covariate record \(L_1=1\). Since \(L_1=A_0\), this condition forces \(A_0=1\). Therefore
The values \(0.5\) and \(0.25\) differ. The first is the treatment-path probability conditional on a later covariate value; the second is the product of assignment probabilities in chronological order. The example shows why a sequential treatment mechanism must not be described as the treatment-sequence probability conditional on the entire covariate history without additional justification.
Worked Decisions With Ambiguous Measurement Times
Worked Example: A Same-Day Laboratory Result
At a follow-up visit, a clinician makes treatment decision \(A_1\) at 10:00. A laboratory value is recorded under the same visit date. The data contain two possible records: one says the sample was drawn at 08:00 and the result was available at 09:30; the other says the sample was drawn at 11:00. Suppose the treatment probability given a high pre-decision result is \(0.8\), and given the prior history without that result is \(0.5\). The participant receives \(A_1=1\).
For the 08:00 sample, the result is available before the decision. If it is part of the decision history, the applicable probability is \(0.8\), and this treatment contributes an inverse probability factor \(1/0.8=1.25\).
For the 11:00 sample, the result is measured after the decision. It cannot be used to model \(A_1\). Under the stated probability for the prior history, the applicable factor is \(1/0.5=2\). The visit date is identical in both records, but the temporal ordering changes which probability is appropriate. If the study cannot establish whether the result was available before the decision, the history definition needs to acknowledge that uncertainty rather than infer pre-decision status from the visit label.
Worked Example: A Post-Treatment Variable Produces a Different Conditional Probability
Suppose a binary treatment \(A_1\) is assigned with probability \(P(A_1=1\mid H_1)=0.5\). A later measurement \(L_2\) is taken after \(A_1\), with \(P(L_2=1\mid A_1=1)=0.9\) and \(P(L_2=1\mid A_1=0)=0.2\). Consider a participant with \(A_1=1\) and \(L_2=1\).
The correct treatment probability for this decision, under the stated model, is \(0.5\), so the inverse probability factor is \(1/0.5=2\). If one instead conditions on the later measurement, Bayes’ rule gives
The corresponding reciprocal is about \(1/0.818=1.22\), not \(2\). That difference is not a correction to the assignment probability: it arises because the calculation conditions on a post-treatment measurement associated with treatment. \(L_2\) belongs in a later history only if it precedes a later decision; it does not belong in \(H_1\).
Diagnostics, Alternatives, and Limitations
A timing audit should be part of data preparation, not an afterthought following model fitting. For each decision time, check that the history specification, analysis data, and protocol agree on what was known before assignment. Useful diagnostics include:
- Compare measurement timestamps with the treatment order or assignment timestamps, including same-day measurements.
- Inspect model columns for covariates recorded after the treatment represented by that row.
- Check whether data-entry or result-availability delays are being mistaken for measurement time.
- Trace a few participants across successive rows to verify that each row’s history contains only prior treatments and available covariates.
- Investigate whether a “baseline” value was truly measured before the first treatment decision; the label alone does not establish the ordering.
A common alternative is to use a lagged covariate, such as the last measurement known before treatment, rather than a same-visit measurement whose ordering is uncertain. That can provide a clear, reproducible history, but it changes the information used by the treatment model and may leave out a measurement that actually informed the decision. Another approach is to define decision times more finely, if the data support a reliable order. Neither choice can recover an unobserved or undocumented temporal order by itself.
The central limitation is that a correctly ordered history does not guarantee that the treatment model is otherwise adequate. It only prevents a particular class of temporal errors. Measurement error, missing covariates, model misspecification, and lack of support for treatment choices remain possible. Likewise, a post-decision covariate can be scientifically important, but its importance does not make it a pre-decision predictor for that treatment.
Check Your Understanding
Answer each question, then compare with the solutions below.
- At time 2, what variables are in \(H_2\) under the stated indexing convention?
- A laboratory sample is drawn after \(A_1\) but before \(A_2\). Which treatment history can include its result?
- Why is the product of the sequential assignment probabilities not generally the conditional probability of the treatment sequence given the full covariate record?
- In the numerical example with \(P(A_1=1)=0.5\), \(P(L_2=1\mid A_1=1)=0.9\), and \(P(L_2=1\mid A_1=0)=0.2\), calculate \(P(A_1=1\mid L_2=1)\).
Solutions. (1) \(H_2=(L_0,A_0,L_1,A_1,L_2)\): it includes the covariates available before decision 2 and treatments 0 and 1. (2) Its result can be included in \(H_2\), not \(H_1\), provided it is available before \(A_2\). (3) The full-record conditional probability uses chain-rule factors conditioned on \(\bar L\), which can include later covariates; the sequential mechanism uses \(P(A_t\mid H_t)\) at each decision. These are different conditionings in general. (4) Bayes’ rule gives \(0.9(0.5)/[0.9(0.5)+0.2(0.5)]=0.45/0.55\approx0.818\).