Tutorials › Propensity Score Matching and Instrumental Variables › Worked TMLE Example with a Continuous Outcome

Doubly Robust Estimation · Tutorial 325 of 699

Worked TMLE Example with a Continuous Outcome

Learn how a continuous-outcome TMLE fluctuation updates outcome predictions and produces a targeted estimate of the average treatment effect.

Advanced 10 min read

What You'll Learn

  • Define the continuous-outcome ATE and the assumptions used to identify it.
  • Construct the clever covariate for a binary treatment and calculate the fluctuation parameter.
  • Update both treatment-specific outcome predictions and calculate the targeted ATE.
  • Verify the empirical targeting equation and distinguish the updated plug-in estimate from an initial-regression AIPW estimate.
  • Diagnose instability caused by extreme propensity scores and explain the role of overlap.

From Initial Predictions to a Targeted ATE

For a continuous outcome, a TMLE starts with predictions of the mean outcome under each treatment level, then adjusts those predictions using information from the observed outcomes and treatment assignments. The goal is not to replace the initial regression wholesale. It is to make a targeted update that incorporates the treatment mechanism while retaining an estimate of the average treatment effect (ATE) based on predicted outcomes for the observed covariate distribution.

Let \(O=(W,A,Y)\) denote one observation, where \(W\) is a vector of pretreatment covariates, \(A\in\{0,1\}\) is treatment, and \(Y\) is a continuous outcome. Let \(Y(1)\) and \(Y(0)\) be the potential outcomes. Under consistency, conditional exchangeability, and positivity, the ATE is identified by comparing the conditional outcome means under the two treatment levels.

Definition: Write \(Q_0(a,W)=E(Y\mid A=a,W)\) for the outcome regression and \(g_0(W)=P(A=1\mid W)\) for the propensity score. The identified ATE is \(\psi_0=E\{Q_0(1,W)-Q_0(0,W)\}\). Its sample analogue averages the estimated treatment-specific outcome contrast over the observed covariate values.

The identification conditions are substantive as well as mathematical. Consistency means the observed outcome equals the potential outcome under the treatment actually received. Conditional exchangeability means \((Y(1),Y(0))\) is independent of \(A\) given \(W\), so there is no unmeasured confounding after conditioning on \(W\). Positivity requires \(0<g_0(W)<1\) for covariate values in the target population. For the usual sample-based argument, observations are also assumed independent and identically distributed, with finite outcome variance. These conditions identify the target; fitting a fluctuation does not make them true.

Suppose initial estimates \(\hat Q(a,W_i)\) and \(\hat g(W_i)\) have been obtained. For a binary treatment, the ATE clever covariate is \(H(A,W)=A/g(W)-(1-A)/\{1-g(W)\}\). With a continuous outcome and an identity-link fluctuation, the updated prediction for either treatment level is

$$ \hat Q^*(a,W_i)=\hat Q(a,W_i)+\hat\epsilon H(a,W_i), \qquad H(a,W_i)=\frac{a}{\hat g(W_i)}-\frac{1-a}{1-\hat g(W_i)}. $$

Thus, the update for a treated prediction is \(\hat\epsilon/\hat g(W_i)\); the update for a control prediction is \(-\hat\epsilon/\{1-\hat g(W_i)\}\). The targeted estimate is the average of the updated treatment contrasts, \(\hat\psi=n^{-1}\sum_i\{\hat Q^*(1,W_i)-\hat Q^*(0,W_i)\}\). The outcome is measured on its original scale, so \(\hat\epsilon\) and the updated predictions have the same units as \(Y\).

Why the Fluctuation Solves a Targeting Equation

For the identity-link fluctuation, estimate \(\epsilon\) by least squares with the initial outcome predictions as offsets and the observed clever covariate as the sole fluctuation covariate. In other words, minimize the sum of squared residuals after setting the fitted value for observation \(i\) to \(\hat Q(A_i,W_i)+\epsilon H(A_i,W_i)\). There is no additional intercept: adding one would change the score equation that this particular update is intended to solve.

$$ L(\epsilon)=\sum_{i=1}^n\left[Y_i-\hat Q(A_i,W_i)-\epsilon H(A_i,W_i)\right]^2, \qquad \hat\epsilon= \frac{\sum_i H(A_i,W_i)\{Y_i-\hat Q(A_i,W_i)\}} {\sum_i H(A_i,W_i)^2}. $$

To derive the expression, differentiate the squared-error loss and set its derivative to zero:

$$ \frac{dL(\epsilon)}{d\epsilon} =-2\sum_i H(A_i,W_i)\{Y_i-\hat Q(A_i,W_i)-\epsilon H(A_i,W_i)\}=0. $$

If \(\sum_i H(A_i,W_i)^2>0\), rearranging gives the stated formula. Substituting the resulting \(\hat\epsilon\) into the updated predictions yields the empirical targeting equation

$$ \frac{1}{n}\sum_{i=1}^n H(A_i,W_i)\{Y_i-\hat Q^*(A_i,W_i)\}=0. $$

This equation also explains a useful relationship with an augmented inverse-probability-weighted (AIPW) expression. The plug-in estimate using the updated predictions equals that expression formed with \(\hat Q^*\), because its empirical residual correction is zero. This does not mean the plug-in estimate generally equals an AIPW expression formed from the initial predictions: the initial residual correction need not be zero.

Worked Calculations

Worked Example: Equal Propensity Scores

Consider four hypothetical participants with estimated propensity score \(0.50\) each. The outcome predictions and observed outcomes, measured in points, are shown below. The residual is the observed outcome minus the prediction for the treatment actually received.

Participant\(A\)\(Y\)\(\hat Q(1,W)\)\(\hat Q(0,W)\)Observed residual
11111081
20596-1
319762
404540

At a propensity score of \(0.50\), the observed clever covariates are \(2,-2,2,-2\). The numerator of the fluctuation estimate is \(2(1)+(-2)(-1)+2(2)+(-2)(0)=8\), and its denominator is \(2^2+(-2)^2+2^2+(-2)^2=16\). Therefore, \(\hat\epsilon=8/16=0.50\) points.

Each treated prediction increases by \(0.50/0.50=1\) point, and each control prediction decreases by \(0.50/0.50=1\) point. The initial contrasts are \(10-8=2\), \(9-6=3\), \(7-6=1\), and \(5-4=1\) points. Since each updated contrast increases by \(1-(-1)=2\) points, the targeted contrasts are \(4,5,3,3\). The targeted ATE estimate is \((4+5+3+3)/4=3.75\) points.

The updated observed residuals are \(0,0,1,1\). Their clever-covariate-weighted sum is \(2(0)+(-2)(0)+2(1)+(-2)(1)=0\), verifying the targeting equation. Consequently, the updated-prediction AIPW correction is zero, and its estimate is the same \(3.75\)-point targeted plug-in estimate.

Worked Example: Unequal Propensity Scores

Now consider three hypothetical participants. Their initial treatment contrasts are each \(2\) points, but their propensity scores differ. The observed residuals are \(1,-1,2\) for participants 1, 2, and 3, respectively. Their treatment assignments are \(1,0,1\), and their propensity scores are \(0.25,0.50,0.75\).

The observed clever covariates are \(1/0.25=4\), \(-1/(1-0.50)=-2\), and \(1/0.75=4/3\). Thus,

$$ \hat\epsilon= \frac{4(1)+(-2)(-1)+(4/3)(2)} {4^2+(-2)^2+(4/3)^2} = \frac{26/3}{196/9} = \frac{39}{98} \approx 0.3980\text{ points}. $$

For any participant with propensity score \(g\), the treatment contrast changes by \(\hat\epsilon\{1/g+1/(1-g)\}\), because the treated prediction increases by \(\hat\epsilon/g\) and the control prediction decreases by \(\hat\epsilon/(1-g)\). The respective contrast increments are \((39/98)(16/3)\approx2.122\), \((39/98)(4)\approx1.592\), and \((39/98)(16/3)\approx2.122\) points. Averaging the updated contrasts gives

$$ \hat\psi =2+\frac{2.122+1.592+2.122}{3} \approx 3.945\text{ points}. $$

The observed residual correction after updating is zero in aggregate: the updated residuals are approximately \(-0.592, -0.204, 1.469\), and their weighted sum is \(4(-0.592)+(-2)(-0.204)+(4/3)(1.469)\approx0\), with the small discrepancy due to rounding. The initial AIPW correction, by contrast, is \((26/3)/3=26/9\) points; adding that to the initial contrast of \(2\) gives approximately \(4.889\), not the targeted plug-in estimate. This illustrates why the equality is with the AIPW form based on the updated predictions.

Diagnostics, Alternatives, and Limitations

A fluctuation can be computed even when the data provide weak support for some treatment assignments, but the result may then be unstable. The clever covariate is large when the propensity score is near the boundary for the treatment level actually observed: a treated observation with score \(0.10\) has \(H=10\), while a control observation with score \(0.90\) has \(H=-10\). For comparison, a treated observation with score \(0.90\) has \(H=1/0.90\approx1.111\), not a larger observed clever covariate than a treated observation at score \(0.50\), whose value is \(2\). Which treatment level is observed matters.

Worked Example: Diagnosing a High-Leverage Update

In a hypothetical four-person data set, suppose the observed treatment assignments are \(1,0,1,0\), the propensity scores are \(0.10,0.90,0.50,0.50\), and the initial observed residuals are \(1,-1,0.5,-0.5\) points. The observed clever covariates are \(10,-10,2,-2\). The fluctuation estimate is

$$ \hat\epsilon =\frac{10(1)+(-10)(-1)+2(0.5)+(-2)(-0.5)} {10^2+(-10)^2+2^2+(-2)^2} =\frac{22}{208} =\frac{11}{104} \approx0.1058\text{ points}. $$

The first two observations contribute \(20\) of the numerator's \(22\) and \(200\) of the denominator's \(208\). Thus, a small number of observations with extreme scores dominate the update. If all initial contrasts were \(1\) point, the contrast increments would be approximately \(1.175\) points at scores \(0.10\) and \(0.90\), and \(0.423\) points at scores \(0.50\). The resulting targeted ATE would be \(1+(1.175+1.175+0.423+0.423)/4\approx1.799\) points. The calculation is valid arithmetically, but the extreme weights warn that the estimate may be sensitive to the propensity model and individual observations.

In practice, inspect the propensity-score distribution by treatment group, the range of observed clever covariates, the size of \(\hat\epsilon\), and the change from initial to updated predictions. Also verify the empirical targeting equation numerically using unrounded values. A failed check can indicate a coding error, mismatched observations, or a fluctuation fit that included an unintended intercept. A very large update or extreme covariates can instead signal limited overlap; the targeting equation alone cannot resolve that design limitation.

The initial outcome-regression plug-in estimate is simpler, but it does not use the same residual correction. AIPW directly combines an outcome-regression contrast with a weighted residual term; the continuous-outcome TMLE described here targets the predictions and then averages their updated contrast. Under the stated identification conditions, the TMLE has the usual doubly robust motivation: consistency can be retained if either the outcome regression or propensity score is consistently estimated, subject to regularity conditions. Neither method repairs unmeasured confounding or a genuine lack of positivity. Continuous outcomes are also unbounded in this identity-link update, so updated predictions can be implausible or outside a scientifically meaningful range. If the outcome is known to be bounded, an appropriate bounded-outcome approach is needed rather than assuming the identity fluctuation respects those bounds.

Common Mistakes

  • Updating only the observed treatment prediction. The ATE is formed from both counterfactual predictions. Update \(\hat Q(1,W_i)\) by \(\hat\epsilon/\hat g(W_i)\) and \(\hat Q(0,W_i)\) by \(-\hat\epsilon/\{1-\hat g(W_i)\}\).
  • Using the wrong contrast increment. The change is \(\hat\epsilon\{1/\hat g(W_i)+1/[1-\hat g(W_i)]\}\), not merely the change in the observed prediction.
  • Claiming equality with the initial AIPW estimate. The targeting equation zeros the empirical residual correction using updated predictions; it does not generally zero the correction using initial predictions.
  • Assuming a completed update proves overlap. A numerical estimate exists even with very large clever covariates. That does not mean the data support stable comparisons across treatment groups.
Key takeaway: For the identity-link continuous-outcome fluctuation, estimate one coefficient by regressing the observed residual on the observed clever covariate with no added intercept. Apply that update to both counterfactual predictions, then average their differences over the sample.

Check Your Understanding

Try each question, then check the solutions below.

  1. For an observed treated participant with propensity score \(0.20\), what is the clever covariate? What is it for an observed control participant with the same score?
  2. If \(\hat\epsilon=0.10\) points and \(\hat g(W)=0.50\), by how much does the updated ATE contrast change?
  3. Why does the empirical targeting equation not imply that the initial-prediction AIPW estimate equals the targeted plug-in estimate?
  4. Name two assumptions needed to identify the ATE from observed data and explain what each contributes.

Solutions. (1) For a treated participant, \(H=1/0.20=5\). For a control participant, \(H=-1/(1-0.20)=-1.25\). (2) The contrast changes by \(0.10\{1/0.50+1/(1-0.50)\}=0.10(4)=0.40\) points. (3) The targeting equation makes the empirical weighted residual sum zero using updated predictions; the initial predictions need not satisfy that equation, so their AIPW residual correction can be nonzero. (4) Consistency links observed outcomes to potential outcomes under the received treatment. Conditional exchangeability rules out unmeasured confounding after conditioning on \(W\). Positivity ensures both treatment levels are possible at covariate values in the target population. Any two, correctly explained, identify essential parts of the argument.

Clinical Biostats