Why Model Treatment Given History?
At each time point in a longitudinal study, treatment may depend on what has happened so far. A treatment mechanism describes that assignment process: it gives the conditional distribution of the treatment actually received, given the information available immediately before the decision. Longitudinal TMLE uses these mechanisms as nuisance models, alongside the sequential outcome regressions, to account for treatment assignment that varies with measured history.
The conditioning set matters. A model for the marginal proportion treated at each time ignores how treatment depends on prior treatment and evolving covariates. Conversely, the treatment mechanism is not itself an outcome model and does not specify the effect of an intervention. Its role is to characterize the observed treatment process conditional on history.
Here \(L_0\) is baseline information, \(L_t\) is the covariate information measured after \(A_t\), and \(Y\) is the terminal outcome. Thus \(L_t\) is part of \(H_{t+1}\), not \(H_t\). The observed data for one participant can be written \(O=(L_0,A_1,L_1,\ldots,A_K,L_K,Y)\). This tutorial treats complete follow-up; censoring mechanisms are a separate issue.
A treatment regime specifies a treatment \(d_t(h)\) at each history \(h\). For a discrete treatment, the regime-relevant conditional probability is \(g_t(d_t(h)\mid h)\). For a continuous treatment, an exact value has probability zero in the usual continuous case; the relevant quantity is a density evaluated at that value, not a point probability.
Likelihood and Estimation
The treatment mechanism can be estimated separately at each decision time by treating \(A_t\) as the response and \(H_t\) as the predictors. The model must respect the support of treatment: a Bernoulli or logistic model for binary treatment, a multinomial model for a finite set of categories, and a conditional density model for continuous treatment are common choices. Flexible regression methods may also be used, provided they yield valid probabilities or densities and are evaluated with appropriate protection against overfitting.
To see this, factor the joint density or mass of the observed data by the chain rule, ordering variables as \(L_0,A_1,L_1,\ldots,A_K,L_K,Y\). The factor for \(A_1\) is its conditional distribution given \(L_0=H_1\). The factor for \(A_t\) is its conditional distribution given all variables ordered before it, which are exactly \(H_t\). The remaining factors describe baseline covariates, post-treatment covariates, and the outcome. Collecting only the factors involving treatment gives the displayed product. This factorization explains which conditional distributions are modeled; it does not imply that the treatment factors alone describe the full observed-data likelihood. \(\square\)
For example, with binary treatment and a logistic regression model, \(g_t(1\mid H_t)=\operatorname{expit}(\beta_t^\mathsf{T}z(H_t))\), where \(z(H_t)\) is a chosen history feature vector and \(\operatorname{expit}(x)=1/(1+\exp(-x))\). The conditional log-likelihood at time \(t\), for \(n\) independent participants, is $$ \ell_t(\beta_t)=\sum_{i=1}^{n}\left\{A_{it}\log g_t(1\mid H_{it})+(1-A_{it})\log\left[1-g_t(1\mid H_{it})\right]\right\}. $$ For a treatment with \(J\) categories, a multinomial regression instead estimates the \(J\) conditional probabilities, constrained to be nonnegative and to sum to one. For continuous treatment, estimation requires a density model: specifying only a conditional mean is not enough to determine \(g_t(a\mid h)\).
Worked Example: Saturated Probabilities for Two Binary Decisions
Suppose there are 12 participants. At the first decision, six have baseline history \(H_1=0\), and three of those receive \(A_1=1\). The other six have \(H_1=1\), and four receive \(A_1=1\). Among participants with \(A_1=1\), the second-decision histories have the following counts:
| Second-decision history \(H_2\) | Number observed | Number with \(A_2=0\) |
|---|---|---|
| \((A_1=1,L_1=0)\) | 4 | 3 |
| \((A_1=1,L_1=1)\) | 3 | 1 |
Use separate saturated conditional probabilities within each listed history stratum. At the first decision, \( \hat g_1(1\mid H_1=0)=3/6=0.5\) and \(\hat g_1(1\mid H_1=1)=4/6=2/3\). At the second decision, \(\hat g_2(0\mid A_1=1,L_1=0)=3/4=0.75\), while \(\hat g_2(0\mid A_1=1,L_1=1)=1/3\). The complementary probabilities are \(0.25\) and \(2/3\), respectively; each pair sums to one.
For the static regime that sets \(A_1=1\) and \(A_2=0\), the fitted treatment probabilities along a history with \(H_1=0\) and then \(L_1=0\) are \(0.5\) and \(0.75\). Along a history with \(H_1=0\) and then \(L_1=1\), they are \(0.5\) and \(1/3\). The second probability changes with the covariate history, which a model using only the overall proportion receiving \(A_2=0\) would fail to capture. These calculations are conditional treatment probabilities, not estimates of the regime-specific outcome mean.
A saturated estimate is the empirical proportion in each history stratum. More generally, it is the maximum-likelihood estimate under a categorical model: if a stratum contains counts \(n_1,\ldots,n_J\) in \(J\) categories and \(n=\sum_j n_j\), its likelihood is proportional to \(\prod_j p_j^{n_j}\), subject to \(\sum_jp_j=1\). On the face where zero-count categories have probability zero, the interior likelihood equations for positive-count categories give \(n_j/p_j=\lambda\); summing over those categories, whose probabilities sum to one, yields \(\lambda=n\). If zero-count categories are allowed positive mass, the total mass \(q\) assigned to positive-count categories is less than one, and the likelihood is \(q^n\) times the likelihood for the normalized probabilities within those categories; maximizing therefore sets \(q=1\). Hence \(\hat p_j=n_j/n\), including zero estimates for zero-count categories. This derivation also shows the limitation of saturation: a stratum with no observations in a category receives estimated probability zero.
Worked Example: A Multinomial Treatment Model
At a particular history \(H_t=h\), suppose a three-category treatment takes values \(0,1,2\) among 20 participants with counts \(9,7,4\). The saturated estimates are \(\hat g_t(0\mid h)=9/20=0.45\), \(\hat g_t(1\mid h)=7/20=0.35\), and \(\hat g_t(2\mid h)=4/20=0.20\). They are nonnegative and sum to \(0.45+0.35+0.20=1\).
If a regime chooses category 2 at this history, the estimated conditional treatment probability is \(0.20\). A multinomial regression could share information across histories by relating category probabilities to history features; it would not generally reproduce the separate within-stratum proportions. The trade-off is that pooling can reduce instability in small strata, but makes the estimate depend on the model specification.
Continuous Treatments Require Densities
For a continuous treatment, \(g_t(a\mid h)\) describes probability per unit of treatment, and probabilities of intervals are obtained by integration. For example, \(P(c\leq A_t\leq d\mid H_t=h)=\int_c^d g_t(a\mid h)\,da\). A density can exceed one; this is not a contradiction, since probabilities come from integrating over sets rather than evaluating the density at a point.
Worked Example: Normal Conditional Density
Suppose that at a fixed history \(h\), the treatment dose is modeled as \(A_t\mid H_t=h\sim N(3,2)\), where the second parameter is the variance. The density at dose \(a\) is \(g_t(a\mid h)=(1/\sqrt{4\pi})\exp\{-(a-3)^2/4\}\). At \(a=4\), \(g_t(4\mid h)=(1/\sqrt{4\pi})\exp(-1/4)\). Using \(1/\sqrt{4\pi}\approx0.2821\) and \(\exp(-1/4)\approx0.7788\), this is approximately \(0.2197\). This is a density value, not the probability of receiving exactly dose 4.
For the interval from 3 to 4, standardizing by the mean 3 and standard deviation \(\sqrt{2}\) gives \(P(3\leq A_t\leq4\mid h)=\Phi(1/\sqrt{2})-\Phi(0)\approx0.7602-0.5=0.2602\), where \(\Phi\) is the standard normal distribution function. The interval probability is less than one and is distinct from the density value at either endpoint.
In practice, a conditional normal model may estimate a mean function \(\mu_t(h)\) and a variance \(\sigma_t^2(h)\), then use the corresponding normal density. A constant variance is a modeling restriction, not a general property of continuous treatment. Depending on the dose scale and support, a log-normal, gamma, truncated, or other conditional density may be more credible. The model must be defined on the treatment's actual support and must integrate to one for each history under consideration.
Identification Conditions, Diagnostics, and Limitations
Correctly describing the observed treatment process is useful only in conjunction with the causal assumptions supporting the target parameter. For a regime-specific mean, the usual conditions include consistency (the observed outcome agrees with the counterfactual outcome under the treatment actually received), sequential exchangeability (at each decision, treatment is conditionally independent of the relevant future counterfactual outcomes given \(H_t\)), and positivity. For a discrete regime, positivity requires \(g_t(d_t(h)\mid h)>0\) for histories with positive probability under the regime. With continuous treatment, the analogous support condition requires the regime's treatment values to lie in regions supported by the conditional treatment distribution; a density must be available around those values. Estimating \(g_t\) does not establish these assumptions.
Useful checks include comparing observed treatment proportions across important histories, inspecting fitted probabilities for values near zero or one, checking that multinomial predictions sum to one, and checking that continuous densities are normalized and compatible with the treatment support. Conditional residual or calibration checks can reveal systematic mismatch. Cross-validation can help assess predictive fit, although good prediction alone does not establish causal identification or adequate support for a target regime.
A near-zero fitted probability for a regime-required treatment is a warning: the data provide little information for that treatment at that history. For continuous treatments, very small density near the intervention value signals the analogous problem. Flexible models can reduce functional-form error but may produce unstable estimates in sparse histories; highly parametric models can be stable but miss important treatment-history relationships. No estimator can manufacture support absent from the data.
A common mistake is to fit one treatment proportion per time point and treat it as the treatment mechanism. For example, an overall proportion of 0.5 treated at time 2 does not imply a conditional probability of 0.5 for every history. If treatment is more common among participants with a particular prior covariate value, the overall proportion averages over those histories and can conceal a conditional probability near zero. The correction is to model \(P(A_t\mid H_t)\), including the history required by the study's treatment-assignment process and the causal analysis.
Treatment nuisance models differ from the main alternative of relying only on outcome regression: they model assignment rather than the conditional outcome. In longitudinal TMLE both types of nuisance model have distinct roles, and a treatment model should not be presented as an effect model. They also differ from simple marginal weighting models when the latter omit time-varying history. The practical choice among logistic, multinomial, parametric density, and flexible conditional models depends on treatment support, sample size, history dimension, and whether predictions remain scientifically plausible.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- What information belongs in \(H_2\) under the notation used here?
- In a history stratum of 25 participants, 10 receive treatment category 1. What is the saturated estimate of its conditional probability?
- Why is \(g_t(4\mid h)=0.22\) not necessarily the probability of receiving exactly dose 4?
- What is the problem with estimating treatment probability only as an overall proportion at each time?
- Name one diagnostic warning for a discrete treatment and one for a continuous treatment.
Solutions. (1) \(H_2=(L_0,A_1,L_1)\): baseline information, the first treatment, and the covariate measured after it. (2) The estimate is \(10/25=0.4\); the other categories' proportions must also be estimated and the full set must sum to one. (3) For a continuous treatment, the value is a density, while the probability of a single point is zero under an ordinary continuous distribution; interval probabilities require integration. (4) The marginal proportion averages over histories and can hide different conditional assignment probabilities, including near-zero probabilities in relevant strata. (5) For discrete treatment, fitted probabilities near zero or one can signal poor support; for continuous treatment, a very small density near the regime value can signal poor support.