From observed histories to a regime-specific risk
A longitudinal TMLE (LTMLE) turns a sequence of observed treatment decisions into an estimate of the outcome risk under a specified intervention. The task is not just to fit an outcome model: the analysis must preserve the time order of covariates and treatments, target the sequential regressions using treatment mechanisms, and use inference appropriate to the targeted estimator.
For concreteness, consider two treatment times. Let \(W\) denote baseline covariates, \(A_0\) the first treatment, \(L_1\) covariates measured after \(A_0\) and before the next treatment, \(A_1\) the second treatment, and \(Y\) a binary outcome measured after \(A_1\). The observed data for one participant are \(O=(W,A_0,L_1,A_1,Y)\). Assume initially that everyone has complete follow-up. A censoring process, if present, must be represented in the time ordering and accounted for in the analysis; it cannot simply be ignored.
Identification requires consistency (the observed outcome under a participant’s observed treatment history equals the corresponding potential outcome), sequential exchangeability (at each time, treatment is independent of future potential outcomes conditional on the measured past), and positivity (the required treatment has positive conditional probability at histories that occur under the regime). These assumptions identify a causal parameter only if the measured history is adequate to support exchangeability. In this example, positivity requires \(P(A_0=d_0\mid W)>0\) and \(P(A_1=d_1\mid W,L_1,A_0=d_0)>0\) on the relevant histories.
The sequential regressions and targeting steps
Write the observed treatment probabilities as \(g_0(a\mid w)=P(A_0=a\mid W=w)\) and \(g_1(a\mid w,l,a_0)=P(A_1=a\mid W=w,L_1=l,A_0=a_0)\). Define the outcome regressions \(Q_2(w,l,a_0,a_1)=E[Y\mid W=w,L_1=l,A_0=a_0,A_1=a_1]\) and \(Q_1(w,l,a_0)=Q_2(w,l,a_0,d_1)\). Then \(Q_1\) is the terminal regression evaluated at the second regime treatment. Define \(Q_0(w)=E[Q_1(W,L_1,d_0)\mid W=w,A_0=d_0]\). The g-formula identifies the risk as \(\psi_d=E[Q_0(W)]\).
The formula shows why time order matters: the distribution of \(L_1\) is the distribution that would follow the first regime treatment, not its unconditional observed distribution. LTMLE estimates the sequential regressions and updates them so their empirical residuals align with the relevant treatment-weighted estimating equations. For a binary outcome, logistic fluctuations keep predictions in \([0,1]\).
Estimate \(Q_2\), \(g_0\), and \(g_1\) using models suitable for the data. Flexible machine-learning fits and cross-fitting can be used; the earlier material on cross-fitting and product-rate conditions explains the relevant asymptotic safeguards.
For the observed data, form \(H_1=I(A_0=d_0,A_1=d_1)/\{\hat g_0(d_0\mid W)\hat g_1(d_1\mid W,L_1,A_0)\}\). A logistic fluctuation uses \(\operatorname{logit}\hat Q_2\) as an offset and \(H_1\) as a covariate, with \(Y\) as the response. Predict the updated regression under \(A_1=d_1\).
Use the updated terminal predictions under \(d_1\) as the sequential pseudo-outcome. Target the regression at the earlier treatment stage with \(H_0=I(A_0=d_0)/\hat g_0(d_0\mid W)\). Predict under \(A_0=d_0\), average over the empirical baseline distribution, and obtain the plug-in estimate \(\hat\psi_d\).
The exact regression representation depends on which sequential conditional means are fitted, but the essential order is fixed: target later outcome regressions first, pass their regime-specific predictions backward, then average the final predictions. The empirical EIF equation for the targeted estimator is a useful implementation check, not a substitute for checking that the time-indexed histories and treatment probabilities are correctly constructed.
Worked Example: G-Formula Risks for Two Regimes
Suppose \(W\) has one level. Under \(A_0=1\), \(P(L_1=1\mid A_0=1)=0.60\); under \(A_0=0\), that probability is \(0.25\). Suppose the fitted terminal predictions under \(A_1=1\) are 0.70 when \(L_1=1\) and 0.30 when \(L_1=0\). Under \(A_1=0\), they are 0.50 and 0.20, respectively.
For regime \((1,1)\), average the \(A_1=1\) predictions over the \(L_1\) distribution following \(A_0=1\): \(0.60(0.70)+0.40(0.30)=0.42+0.12=0.54\). Thus the estimated risk under \((1,1)\) is 0.54.
For regime \((0,0)\), use the \(L_1\) distribution following \(A_0=0\) and the predictions under \(A_1=0\): \(0.25(0.50)+0.75(0.20)=0.125+0.150=0.275\). The risk difference, \(\hat\psi_{(1,1)}-\hat\psi_{(0,0)}\), is \(0.54-0.275=0.265\), or 26.5 percentage points. This is a contrast of regime-specific risks, not a contrast conditional on the observed treatment choices.
Identification and influence-curve inference
The g-formula identification can be seen by iterated expectation. Under consistency and sequential exchangeability, the conditional distribution of \(Y\) after setting \(A_1=d_1\) is represented by \(Q_2(W,L_1,d_0,d_1)\). Under the intervention, \(L_1\) follows its observed conditional distribution among those with \(A_0=d_0\). Averaging first over that distribution and then over \(W\) gives the stated formula. Positivity ensures that each conditional quantity needed in this calculation is estimable from observed data.
For this two-treatment setup, define the regime-specific influence function using the true regressions:
where \(H_0=I(A_0=d_0)/\{g_0(d_0\mid W)\}\) and \(H_1=I(A_0=d_0,A_1=d_1)/\{g_0(d_0\mid W)g_1(d_1\mid W,L_1,A_0)\}\). In the middle term, \(Q_1(W,L_1,A_0)\) denotes \(Q_2(W,L_1,A_0,d_1)\). The first weighted residual accounts for the intermediate history and first treatment stage; the second accounts for the terminal outcome among participants following the full regime.
To verify this, first \(E[Q_0(W)-\psi_d]=0\) by the definition \(\psi_d=E[Q_0(W)]\). Conditional on \(W\), the expectation of the middle term is \(E[I(A_0=d_0)\{Q_1(W,L_1,d_0)-Q_0(W)\}/g_0(d_0\mid W)\mid W]\). Weighting selects the conditional distribution given \(A_0=d_0\); its expectation is zero because \(Q_0(W)=E[Q_1(W,L_1,d_0)\mid W,A_0=d_0]\). Finally, conditional on \((W,L_1,A_0,A_1)\), \(E[Y-Q_2(W,L_1,A_0,A_1)]=0\). Multiplication by \(H_1\), which is determined by those variables, preserves a zero expectation. Adding the three expectations proves the result. \(\square\)
With cross-fitted nuisance estimates, form \(\hat D_{d,i}\) by substituting the estimated regressions and probabilities, and estimate the standard error by \(\widehat{\operatorname{SE}}(\hat\psi_d)=\sqrt{\widehat{\operatorname{Var}}(\hat D_{d,i})/n}\). A Wald interval is \(\hat\psi_d\pm1.96\,\widehat{\operatorname{SE}}(\hat\psi_d)\). Interpreting this interval as asymptotically valid requires conditions such as independent observations, suitable nuisance convergence and product-rate control, and no severe positivity failure. Cross-fitting relaxes empirical-process restrictions but does not remove those substantive or rate conditions.
The inference statement follows from the asymptotic linear representation \(\sqrt n(\hat\psi_d-\psi_d)=n^{-1/2}\sum_{i=1}^nD_d(O_i)+o_p(1)\). The central limit theorem applies to the independent, mean-zero summands with finite variance, giving convergence to the stated normal distribution. Consistency of the estimated variance then follows from consistent approximation of the influence values and the law of large numbers. The asymptotic linear representation itself is not automatic; the nuisance-rate and regularity conditions must justify its remainder as \(o_p(1)\).
Worked Example: Checking a Clever Covariate
For one participant, suppose the regime is \((1,1)\), \(\hat g_0(1\mid W)=0.40\), and \(\hat g_1(1\mid W,L_1,A_0=1)=0.25\). If the participant received \(A_0=1,A_1=1\), then \(H_0=1/0.40=2.5\) and \(H_1=1/(0.40\times0.25)=1/0.10=10\).
If the same participant received \(A_0=1,A_1=0\), then \(H_0=2.5\), but \(H_1=0\), because the participant did not follow the full regime. If \(A_0=0\), both covariates are zero. These values check the indicator logic and cumulative denominators; they do not prove positivity. A very small estimated denominator can still create a numerically extreme covariate.
Worked Example: Influence-Curve Standard Error
Suppose a fitted regime risk is \(\hat\psi_d=0.54\), and five cross-fitted influence-curve values are \(-0.30,0.10,0.20,-0.20,0.20\). Their mean is zero: \((-0.30+0.10+0.20-0.20+0.20)/5=0\). Their sum of squares is \(0.09+0.01+0.04+0.04+0.04=0.22\).
The sample variance is \(0.22/(5-1)=0.055\), so the estimated standard error is \(\sqrt{0.055/5}=\sqrt{0.011}\approx0.105\). The approximate 95% interval is \(0.54\pm1.96(0.105)\), or approximately \((0.334,0.746)\). This interval is illustrative: five observations are far too few to rely on a normal approximation in practice.
Diagnostics, alternatives, and limitations
Check that the treatment probabilities correspond to the correct histories and that the regime indicators use the intended treatment values at each time. Inspect the distributions of \(\hat g_0,\hat g_1,H_0,H_1\), and the targeting fluctuation estimates. Very small probabilities, extreme clever covariates, separation, or unstable updates signal that the estimate may be dominated by a few observations. Also check that targeted predictions remain within the binary outcome bounds and that empirical EIF equations are close to zero when the fitting procedure is designed to solve them.
Longitudinal inverse-probability weighting relies directly on treatment weights and can be highly variable when positivity is weak. Untargeted sequential regression avoids those explicit weighted outcome updates but can be sensitive to outcome-model misspecification. LTMLE combines sequential outcome regression with targeting based on treatment mechanisms and returns a bounded plug-in estimate for a binary risk. It does not guarantee low variance, correct nuisance estimation, or causal identification when assumptions fail. In particular, truncating probabilities may stabilize estimates but changes the procedure and can introduce bias; it does not repair a genuine lack of overlap.
Worked Example: A Positivity Warning
Suppose a participant has \(\hat g_0(d_0\mid W)=0.10\) and \(\hat g_1(d_1\mid W,L_1,A_0=d_0)=0.05\), and follows the regime. Then \(H_1=1/(0.10\times0.05)=200\). This observation can exert substantial influence on targeting and the estimated variance. If such values recur, inspect covariate overlap, model calibration, and the histories driving the small probabilities. Reporting a stable-looking point estimate alone would not resolve the lack of information about the regime.
The main limitations remain substantive and statistical: unmeasured confounding can invalidate exchangeability; sparse histories can undermine positivity; and flexible nuisance fits can still fail to meet the conditions for reliable inference. The estimate is also specific to the defined regime, outcome, follow-up, and target population. A numerical risk contrast should therefore be accompanied by a clear regime definition and an account of the assumptions supporting its causal interpretation.
Check Your Understanding
Answer each question, then check the short solutions.
- If \(P(L_1=1\mid A_0=d_0)=0.40\), and the regime-specific terminal predictions are 0.60 for \(L_1=1\) and 0.20 for \(L_1=0\), what is the regime risk?
- For a participant who follows the regime, if the two treatment probabilities are 0.50 and 0.20, what are \(H_0\) and \(H_1\)?
- Why is the average of \(Q_2(W,L_1,d_0,d_1)\) over the unconditional distribution of \(L_1\) generally not the g-formula risk?
- What does a very large estimated \(H_1\) indicate, and what does it not establish?
Solutions. (1) \(0.40(0.60)+0.60(0.20)=0.24+0.12=0.36\). (2) \(H_0=1/0.50=2\), and \(H_1=1/(0.50\times0.20)=10\). (3) The intervention changes the distribution of \(L_1\) through \(A_0=d_0\), so the risk must average over \(L_1\mid W,A_0=d_0\), not the unconditional distribution. (4) It indicates a small estimated probability of following the required treatment history and potential instability. It does not by itself prove that positivity fails in the population; it may also reflect estimation error, so the underlying histories and probability fits need examination.