Tutorials › Marginal Structural Models › Conditional Models for Covariate Evolution

The Parametric g-Formula · Tutorial 299 of 501

Conditional Models for Covariate Evolution

Learn to define and assess the history-conditional covariate distributions that generate longitudinal trajectories under an intervention.

Advanced 12 min read

What You'll Learn

  • Define the covariate transition kernel at each time from prior covariates and treatment history.
  • Factorize an intervention-specific covariate trajectory distribution into sequential conditional models.
  • Distinguish a joint model for a covariate vector from assumptions of within-time conditional independence.
  • Calculate trajectory probabilities from specified conditional transition probabilities.
  • Diagnose how omitted treatment history or inaccurate transition kernels distort simulated histories.
  • Bound trajectory-distribution error when each fitted transition kernel is close to its target.

Why Model Covariate Evolution?

In longitudinal g-computation, a covariate measured after treatment may both predict later outcomes and be affected by earlier treatment. Under an intervention, the distribution of later covariates therefore needs to be generated from the history that would arise under that intervention. The relevant models are not unconditional models for each covariate in isolation: they are conditional transition models, indexed by the covariate and treatment history available at each time.

Use \(L_0\) for baseline covariates, \(A_t\) for treatment at time \(t\), and \(L_{t+1}\) for covariates measured after \(A_t\), for \(t=0,\ldots,K-1\). Write \(\bar L_t=(L_0,\ldots,L_t)\) and \(\bar A_t=(A_0,\ldots,A_t)\). The history immediately before \(A_t\) is \((\bar L_t,\bar A_{t-1})\); the history used to generate \(L_{t+1}\) includes \(A_t\) as well.

Definition: A covariate transition kernel at time \(t\) is the conditional distribution \(q_{t+1}(l_{t+1}\mid \bar l_t,\bar a_t)\) of the next covariate \(L_{t+1}\), given the covariate history through \(t\) and treatment history through \(t\). In a parametric g-formula, this distribution is represented by a model \(q_{t+1}(\cdot\mid\bar l_t,\bar a_t;\theta_t)\), with parameter \(\theta_t\). It may be a probability mass function, density, or more generally a conditional probability distribution.

A regime specifies the treatment history to be used when generating a trajectory. It may be static, such as \(A_t=1\) at every time, or depend on past history. For a regime \(g\), insert its treatment value \(g_t(\bar l_t,\bar a_{t-1})\) into the transition model at time \(t\). The model still conditions on treatment history: it must describe how covariates evolve under the treatment values imposed by the regime.

The baseline distribution and the sequence of transition kernels determine the covariate-history distribution under the intervention. In particular, the models must preserve the temporal order: \(L_{t+1}\) is generated from history through \(A_t\), not from future treatment or future covariates. This conditional-model component is distinct from the later model for the outcome given the completed history.

Factorization Under an Intervention

Suppose the covariate history has a joint distribution and regular conditional distributions exist. The chain rule for conditional distributions gives its sequential factorization. Under a regime, the treatment values in each factor are replaced by those assigned by that regime. In density notation, for a static regime \(\bar a\), the resulting covariate-history law is

$$ p^{\bar a}(\bar l_K) = p(l_0)\prod_{t=0}^{K-1} q_{t+1}(l_{t+1}\mid \bar l_t,\bar a_t). $$

For a dynamic regime, the same expression uses the treatment values specified by \(g\) along the generated history. If the covariates at a time are a vector, \(q_{t+1}\) is their joint conditional distribution unless a further factorization is explicitly specified. Modeling vector components separately without conditioning on one another asserts a conditional-independence structure; it does not follow merely from writing several models.

Theorem: Suppose consistency and sequential exchangeability hold for the intervention of interest, the intervention’s treatment choices have support in the observed data at histories encountered under that intervention, and the conditional covariate distributions \(q_{t+1}\) are the true distributions given \((\bar L_t,\bar A_t)\). Then the intervention-specific covariate-history distribution is the product of the baseline distribution and the sequential kernels above, evaluated at the treatment values imposed by the intervention.

Proof. For the first transition, the joint distribution of \((L_0,L_1)\) under the intervention factors as \(p(l_0)\) times the conditional distribution of \(L_1\) given \(L_0\) and the intervention’s \(A_0\). Sequential exchangeability and consistency identify that conditional distribution with \(q_1(l_1\mid l_0,a_0)\) at supported histories. Suppose the intervention-specific distribution through \(L_t\) is the product through time \(t-1\). By the chain rule, adjoining \(L_{t+1}\) multiplies that distribution by its conditional distribution given \((\bar L_t,\bar A_t)\). The same identification argument makes this factor \(q_{t+1}\) evaluated at the intervention’s treatment value. Induction through \(t=K-1\) gives the stated product. \(\square\)

This result explains what the covariate models must accomplish: together, they specify the distribution of whole histories under each intervention. Correctly modeling only the average of \(L_{t+1}\) is not enough if the g-formula requires its full conditional distribution. For instance, two distributions can have the same conditional mean but different probabilities of entering an important history.

Worked Examples

Worked Example: A Two-Step Binary Covariate History

Let baseline \(L_0=0\), and consider the static regime \(A_0=1,A_1=0\). Suppose the transition models specify \(P(L_1=1\mid L_0=0,A_0=1)=0.4\), \(P(L_2=1\mid L_1=1,A_1=0)=0.7\), and \(P(L_2=1\mid L_1=0,A_1=0)=0.2\). Find the intervention-specific probability that \(L_2=1\).

The two possible values of \(L_1\) partition the histories. The model gives \(P(L_1=0)=1-0.4=0.6\). By sequential integration,

$$ P^{\bar a}(L_2=1) =(0.4)(0.7)+(0.6)(0.2) =0.28+0.12 =0.40. $$

The joint probabilities also check the calculation: \(P^{\bar a}(L_1=1,L_2=1)=0.4(0.7)=0.28\), and \(P^{\bar a}(L_1=0,L_2=1)=0.6(0.2)=0.12\). Their sum is \(0.40\). The transition model for \(L_2\) must distinguish the two \(L_1\) histories; averaging its conditional probabilities before accounting for the distribution of \(L_1\) would not, in general, give the right answer.

Worked Example: Evaluating a Conditional Model at an Intervention History

Suppose a continuous covariate transition is modeled as \(L_1\mid (L_0,A_0)\sim N(1+0.5L_0+0.8A_0,1.44)\). Under a regime setting \(A_0=1\), evaluate the conditional distribution at \(L_0=2\), and calculate the probability that \(L_1>3\).

The conditional mean is \(1+0.5(2)+0.8(1)=2.8\), and the specified variance is \(1.44\), so the standard deviation is \(1.2\). Thus \(L_1\mid (L_0=2,A_0=1)\sim N(2.8,1.44)\). Standardizing the threshold gives

$$ P(L_1>3\mid L_0=2,A_0=1) = 1-\Phi\left(\frac{3-2.8}{1.2}\right) = 1-\Phi(0.1667) \approx 1-0.5662 =0.4338. $$

The intervention enters the model by setting \(A_0=1\); it does not change the model’s conditioning history or turn the conditional law into an unconditional one. The calculation is specific to \(L_0=2\). A marginal probability would additionally require averaging over the baseline distribution.

Worked Example: Why Prior Treatment Belongs in the Transition Model

Suppose the true model is \(P(L_2=1\mid L_1,A_1)=0.1+0.4L_1+0.3A_1\), where \(L_1,A_1\) are binary. Under the target intervention \(A_1=1\), suppose \(P(L_1=1)=0.5\). Find the intervention-specific probability of \(L_2=1\). Then compare it with a calculation using a transition probability averaged over an observational treatment prevalence of \(P(A_1=1\mid L_1)=0.2\).

Under the intervention, the conditional probabilities are \(0.8\) when \(L_1=1\), and \(0.4\) when \(L_1=0\). Therefore \(P^{g}(L_2=1)=0.5(0.8)+0.5(0.4)=0.60\). If instead the model averages over the stated observational treatment prevalence, its probabilities given \(L_1=1\) and \(L_1=0\) are, respectively, \(0.2(0.8)+0.8(0.5)=0.56\) and \(0.2(0.4)+0.8(0.1)=0.16\). Averaging those over the same \(L_1\) distribution gives \(0.5(0.56)+0.5(0.16)=0.36\), not \(0.60\).

The discrepancy arises because the averaged transition is a mixture over observational treatment values, whereas the intervention fixes \(A_1=1\). A model for covariate evolution must retain relevant prior treatment in its conditioning set so that it can be evaluated at the intervention history.

Model Accuracy and Trajectory Error

Errors in a transition model can propagate: an inaccurate distribution at one time changes the histories on which later transition models are evaluated. The following bound makes this accumulation explicit for discrete covariate histories. For probability distributions \(P,Q\), define total variation distance by \(\|P-Q\|_{\mathrm{TV}}=\sup_B|P(B)-Q(B)|\), where the supremum is over events \(B\).

Proposition: Suppose the true and fitted intervention-specific trajectory laws have the same baseline distribution. At each of \(K\) transitions, suppose their conditional kernels \(p_{t+1}(\cdot\mid h)\) and \(q_{t+1}(\cdot\mid h)\) satisfy \(\sup_h\|p_{t+1}(\cdot\mid h)-q_{t+1}(\cdot\mid h)\|_{\mathrm{TV}}\leq\epsilon_t\) over histories in their common finite support. Then the total variation distance between the resulting joint trajectory distributions is at most \(\sum_{t=0}^{K-1}\epsilon_t\).

Proof. Let \(P_t,Q_t\) denote the true and fitted distributions of histories through \(L_t\), and let \(d_t=\|P_t-Q_t\|_{\mathrm{TV}}\). Extending both distributions by the same fitted kernel cannot increase their distance: summing over the next covariate values shows that the absolute difference for any extended event is bounded by the total variation distance on the histories. Replacing the fitted kernel by the true kernel at a fixed history changes the conditional distribution by at most \(\epsilon_t\); averaging this bound over histories preserves it. The triangle inequality therefore gives \(d_{t+1}\leq d_t+\epsilon_t\). Since the baseline distributions agree, \(d_0=0\); induction yields \(d_K\leq\sum_{t=0}^{K-1}\epsilon_t\). \(\square\)

The bound is not a diagnostic that can be calculated from observed data without further assumptions: the true kernels are unknown. It does clarify why checking several transitions matters. Small errors at each step can add up, and a substantial error in one transition can alter many later histories. It also bounds errors in intervention-specific probabilities of trajectory events, since such probabilities differ by no more than the total variation distance.

Diagnostics, Alternatives, and Limitations

A useful review of fitted covariate models checks whether they are defined at the histories generated by the intervention, whether their predictions respect the covariate’s support, and whether they reproduce observed conditional distributions across important history strata. Large differences between observed and model-predicted transition frequencies, residual patterns over prior covariates or treatment, and sparse histories are warnings. Calibration in observed histories is informative but cannot establish correctness in unsupported histories or prove that an unobserved intervention-specific law is right.

The main modeling choice is between a single joint transition model for a covariate vector and a sequence of component-wise conditional models. A joint model can represent within-time dependence directly but may be demanding to estimate. Component-wise models can be convenient, but their factorization must be stated and justified; assuming independence merely for convenience can distort the generated history. Likewise, a model that omits a relevant prior covariate or treatment is not just more parsimonious: it may average over distinctions that the intervention makes consequential.

These models are parametric approximations. Their validity depends on the conditional distributions being adequately represented, and on the causal identification and support assumptions needed to interpret intervention-specific histories. Diagnostics can expose some problems but cannot eliminate model dependence. A model may fit common observed histories well while extrapolating poorly to histories emphasized by a particular intervention.

Common pitfall: Treating \(L_{t+1}\) as if it had one unconditional distribution, or fitting its transition without prior treatment because treatment will be fixed under the intervention. The correction is to model \(L_{t+1}\) conditional on the relevant observed history, including \(A_t\), then evaluate that conditional distribution at the regime’s assigned treatment value. Fixing treatment changes the input to the transition model; it does not remove treatment from the model’s history.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. For \(L_0,A_0,L_1,A_1,L_2\), what variables condition the transition distribution for \(L_2\)?
  2. If two conditional models for \(L_2\) have the same conditional mean but different conditional distributions, must they yield the same probability of \(L_2\) exceeding a threshold?
  3. A covariate at a time consists of two components. What assumption is made by fitting separate component models that do not condition on one another?
  4. If the total variation error bounds for two successive transition kernels are \(0.03\) and \(0.04\), what trajectory-distribution error bound follows from the proposition?

Solutions. (1) Condition on \((L_0,L_1,A_0,A_1)\), the covariate and treatment history through the treatment immediately preceding \(L_2\). (2) No. Equal means do not imply equal tail probabilities; the full conditional distributions can differ. (3) It asserts conditional independence of the components given the histories included in their models. (4) The bound is \(0.03+0.04=0.07\) in total variation, provided the proposition’s common-baseline and support conditions hold.

Clinical Biostats