Tutorials › Marginal Structural Models › Deriving the Final Plug-In Estimate

Longitudinal Targeted Maximum Likelihood · Tutorial 372 of 501

Deriving the Final Plug-In Estimate

Learn how targeted sequential regressions produce a regime-specific mean estimate by predicting each participant’s outcome under the intervention and averaging over the empirical baseline distribution.

Advanced 11 min read

What You'll Learn

  • Define the targeted sequential prediction evaluated under a fixed treatment regime.
  • Derive the final plug-in estimate as an empirical average over baseline covariates.
  • Distinguish averaging individual predictions from transforming an average prediction.
  • Calculate plug-in estimates on the response scale for bounded outcomes.
  • Check assumptions and diagnose errors in final standardization.

From Sequential Predictions to a Regime-Specific Estimate

Targeted sequential regressions produce a prediction for each baseline profile: the estimated mean outcome if that profile were followed under the specified treatment regime. The final step is to average those predictions across the baseline profiles in the study. This is standardization over the empirical baseline distribution, not an average of the observed outcomes among participants who happened to follow the regime.

The distinction matters because the target population is represented by the observed baseline covariates, while the treatment and covariate histories used to construct each prediction follow the intervention. The recursive regressions provide those intervention-specific predictions; the final plug-in calculation aggregates them.

Definition: Let \(W\) denote baseline covariates and let \(d=(d_1,\ldots,d_K)\) be a fixed treatment regime. Write \(\hat{\bar Q}_1^*(W_i)\) for the targeted sequential prediction of the outcome mean under \(d\), evaluated at participant \(i\)'s baseline covariates. The final plug-in estimate is $$ \hat\Psi_d=\frac{1}{n}\sum_{i=1}^n \hat{\bar Q}_1^*(W_i)=P_n\hat{\bar Q}_1^*. $$ Here \(P_n\) is the empirical distribution of the observed baseline covariates.

The star indicates that the sequential regressions have been targeted. In outline, the terminal outcome regression is updated first; subsequent regressions are updated in reverse time order using the recursively constructed future predictions. At the end, the first-time prediction is evaluated at each observed \(W_i\). The earlier material on recursive targeting establishes how those updates are constructed. The final estimate requires one more operation: average the resulting baseline-specific predictions.

What the Recursion Represents

For clarity, suppose the data contain baseline covariates \(W\), treatment decisions \(A_1,\ldots,A_K\), time-varying covariates measured before those decisions, and a terminal outcome \(Y\). Let \(H_t\) be the observed history immediately before \(A_t\). After \(A_t\), the next history \(H_{t+1}\) includes the subsequent covariates; \(H_{K+1}\) includes the final treatment and the history available before \(Y\). A regime specifies \(A_t=d_t(H_t)\) at each decision.

The population sequential regressions start with \(\bar Q_{K+1}(H_{K+1})=E[Y\mid H_{K+1}]\). For \(t=K,\ldots,1\), define \(\bar Q_t(h_t)\) as the conditional expectation of the next regression prediction when the treatment at time \(t\) is set to the regime value:

$$ \bar Q_t(h_t) = E\!\left[ \bar Q_{t+1}(H_{t+1}) \mid H_t=h_t,\ A_t=d_t(h_t) \right]. $$

At the final step, \(\bar Q_{K+1}\) is the conditional outcome mean. At earlier steps, the expectation also averages over the next covariates under the conditional distribution associated with the specified treatment. Thus \(\bar Q_1(W)\) is a prediction for the regime-specific mean conditional on baseline covariates, and the regime-specific population mean is \(E[\bar Q_1(W)]\).

For a causal interpretation, the usual identification conditions are required: consistency, no interference between participants, sequential exchangeability of each treatment given its measured history, and positivity for the treatment values assigned by the regime at histories in the target population. The fitted regressions must also be defined on the relevant histories. These conditions justify interpreting the identified regime-specific mean causally; they are not needed merely to compute the empirical average of fitted predictions.

Theorem: Given targeted predictions \(\hat{\bar Q}_1^*(W_i)\) for \(i=1,\ldots,n\), the plug-in estimate of the empirical-baseline regime-specific mean is exactly their arithmetic mean. If the empirical baseline distribution assigns mass \(1/n\) to each participant, then $$ \int \hat{\bar Q}_1^*(w)\,dP_n(w) = \frac{1}{n}\sum_{i=1}^n\hat{\bar Q}_1^*(W_i). $$

Proof. By definition, \(P_n\) assigns probability \(1/n\) to each observed baseline value, counting repeated values with their observed multiplicities. Integration with respect to this discrete distribution is therefore a finite weighted sum:

$$ \int \hat{\bar Q}_1^*(w)\,dP_n(w) = \sum_{i=1}^n \frac{1}{n}\hat{\bar Q}_1^*(W_i) = \frac{1}{n}\sum_{i=1}^n\hat{\bar Q}_1^*(W_i). $$

This is an identity for the empirical distribution; it does not require a large-sample approximation. It also shows why every participant’s baseline covariates enter the final calculation, regardless of the participant’s observed treatment history. \(\square\)

Calculating the Final Average

Worked Example: Averaging Predictions for Individual Baseline Profiles

Suppose the targeted recursion produces the following intervention-specific predicted means for four participants:

ParticipantTargeted prediction
10.20
20.45
30.55
40.80

The final estimate gives each observed baseline profile weight \(1/4\):

$$ \hat\Psi_d = \frac{0.20+0.45+0.55+0.80}{4} = \frac{2.00}{4} = 0.50. $$

The result estimates a regime-specific mean of \(0.50\) for the empirical baseline population. It is not the mean of observed outcomes under the regime: the four numbers being averaged are targeted predictions under the regime, not the participants’ observed outcomes.

Worked Example: Respecting the Empirical Baseline Distribution

Suppose a study has 10 participants in three baseline strata. The targeted predictions are \(0.10\) for each of the 2 participants in stratum A, \(0.40\) for each of the 5 in stratum B, and \(0.70\) for each of the 3 in stratum C. The estimate is

$$ \hat\Psi_d = \frac{2(0.10)+5(0.40)+3(0.70)}{10} = \frac{0.20+2.00+2.10}{10} = 0.43. $$

The empirical baseline distribution gives the strata weights \(0.2\), \(0.5\), and \(0.3\), respectively. Giving each stratum equal weight instead would produce

$$ \frac{0.10+0.40+0.70}{3}=0.40, $$

which targets a different baseline distribution. Equal weighting of strata is appropriate only if that alternative target population is intended; it is not the empirical-baseline plug-in estimate.

Worked Example: Averaging on the Outcome Scale

For a binary outcome, suppose two baseline profiles have targeted logit predictions \(0\) and \(\log(3)\). Their predicted outcome means are obtained by applying the inverse-logit function separately:

$$ \operatorname{expit}(0)=\frac{1}{1+\exp(0)}=0.50, \qquad \operatorname{expit}(\log 3)=\frac{1}{1+1/3}=0.75. $$

With one participant at each profile, the plug-in estimate is the average of these predicted means:

$$ \hat\Psi_d=\frac{0.50+0.75}{2}=0.625. $$

It is generally incorrect to average the logits first and then apply the inverse logit. Here that alternative gives $$ \operatorname{expit}\!\left(\frac{0+\log(3)}{2}\right) = \operatorname{expit}(0.5493) \approx 0.6340, $$ which is not \(0.625\). In the special case where every participant has the same targeted logit prediction \(0.7324\), each response-scale prediction is $$ \frac{1}{1+\exp(-0.7324)}\approx 0.6753. $$ If instead \(0.7324\) is a log-odds value with the opposite sign, the corresponding prediction is $$ \frac{1}{1+\exp(0.7324)}\approx 0.3247. $$ The sign convention matters: the inverse logit of a logit \(\eta\) is \(1/(1+\exp(-\eta))\).

A Sufficient Condition for Consistency

The finite-sample identity defines the estimate, but its large-sample behavior depends on the quality of the first-step predictions. One transparent sufficient condition makes the role of the final averaging step explicit.

Result: Suppose \(W_1,\ldots,W_n\) are independent and identically distributed, the true identified regression \(\bar Q_1(W)\) is bounded, and $$ \sup_w\left|\hat{\bar Q}_1^*(w)-\bar Q_1(w)\right|\xrightarrow{p}0. $$ Then the empirical-baseline plug-in estimate satisfies $$ \hat\Psi_d\xrightarrow{p}E[\bar Q_1(W)]. $$

Proof. Add and subtract \(P_n\bar Q_1\), then use the triangle inequality:

$$ \left|P_n\hat{\bar Q}_1^*-E[\bar Q_1(W)]\right| \leq \left|P_n(\hat{\bar Q}_1^*-\bar Q_1)\right| + \left|P_n\bar Q_1-E[\bar Q_1(W)]\right|. $$

The first term is bounded by the uniform error: $$ \left|P_n(\hat{\bar Q}_1^*-\bar Q_1)\right| \leq \sup_w|\hat{\bar Q}_1^*(w)-\bar Q_1(w)| \xrightarrow{p}0. $$ Because \(\bar Q_1(W)\) is bounded and the baseline observations are independent and identically distributed, the law of large numbers gives \(P_n\bar Q_1\xrightarrow{p}E[\bar Q_1(W)]\). The second term therefore converges in probability to zero. Both terms on the right converge to zero in probability, proving the result. \(\square\)

This is a sufficient condition, not a claim that uniform convergence is necessary for longitudinal TMLE. It isolates the aggregation step: if the targeted predictions converge uniformly to the correct baseline-specific mean, averaging them over the empirical baseline distribution consistently estimates its population average.

Diagnostics, Alternatives, and Limitations

Several checks help catch errors before interpreting the estimate:

  • Check the scale. For a binary outcome, each predicted mean and their average should lie in \([0,1]\). For a bounded continuous outcome, predictions should respect the outcome range when the fitted model is designed to enforce it.
  • Check the averaging weights. The empirical-baseline estimate uses weight \(1/n\) per participant. If predictions are stored by unique covariate pattern, weight each pattern by its observed frequency.
  • Check the prediction being averaged. Average the first-step targeted prediction under the regime, not the terminal regression prediction or observed outcome.
  • Check transformation order. For a nonlinear link, convert each linear predictor to the outcome scale before taking the empirical average.
  • Investigate extreme or unstable predictions. Positivity problems, sparse histories, or poorly fitting nuisance models can make the sequential predictions unstable. The final arithmetic mean does not repair those problems.

The plug-in estimate is closely related to parametric g-computation: both obtain a regime-specific mean by predicting under the intervention and averaging over a baseline distribution. Longitudinal TMLE uses targeted sequential regressions, with updates designed to incorporate information from the treatment and censoring mechanisms into the estimate. An inverse-probability-weighted estimator instead aggregates outcomes using weights; it does not use this same final average of targeted baseline-specific predictions. These approaches have different finite-sample behavior and assumptions about nuisance estimation, so a numerical difference between them is not by itself evidence of an arithmetic error.

The final plug-in calculation is simple, but it cannot compensate for a misspecified regime, invalid causal identification assumptions, inadequate support for the regime, or inaccurate sequential predictions. Nor does the point estimate alone quantify uncertainty. In particular, an estimate near the boundary for a bounded outcome should prompt checks of the fitted predictions and support, not an automatic conclusion that the target mean is near that boundary.

Check Your Understanding

Use the definitions and derivations above to answer these questions. Solutions follow each problem.

  1. Three participants have targeted regime-specific predictions \(0.2\), \(0.5\), and \(0.8\). What is the empirical-baseline plug-in estimate?
  2. A study has 4 participants in one stratum and 6 in another, with predictions \(0.3\) and \(0.7\). What weights enter the empirical-baseline average?
  3. Why is averaging predicted outcomes different from averaging logits and then applying the inverse-logit function?
  4. Name two conditions needed to interpret the plug-in estimate as a causal regime-specific mean, beyond being able to calculate it.

Solutions. (1) \((0.2+0.5+0.8)/3=0.5\). (2) The empirical weights are \(4/10\) and \(6/10\), so the estimate is \((4/10)(0.3)+(6/10)(0.7)=0.12+0.42=0.54\). (3) The inverse-logit function is nonlinear, so transforming an average generally differs from averaging the transformed individual predictions; the second worked example gives \(0.6340\) versus \(0.625\). (4) Examples include consistency, no interference, sequential exchangeability, and positivity for regime-assigned treatments.

Clinical Biostats