Tutorials › Propensity Score Matching and Instrumental Variables › Deriving AIPW from Outcome Regression and Weighting

Doubly Robust Estimation · Tutorial 290 of 699

Deriving AIPW from Outcome Regression and Weighting

Learn why AIPW adds weighted residual corrections to outcome-regression predictions, how to calculate the resulting estimate, and what assumptions and diagnostics matter.

Advanced 12 min read

What You'll Learn

  • Derive the AIPW expression for the average treatment effect from outcome regression and inverse-probability weighting.
  • Define the treatment-specific outcome regressions, propensity score, and probability weights used in the expression.
  • Calculate an AIPW estimate from hypothetical fitted values and observed outcomes.
  • Explain why the residual correction must be weighted by treatment assignment probabilities.
  • Identify assumptions, diagnostics, and finite-sample limitations relevant to the derivation.
  • Compare AIPW with regression-only and inverse-probability-weighted estimators.

Why Add a Residual Correction?

Outcome regression and inverse-probability weighting organize the same causal comparison in different ways. Outcome regression predicts each person's outcome under each treatment and averages those predictions over the covariate distribution. Weighting instead uses observed outcomes, giving more weight to observations whose treatment assignment was less likely given their covariates. The augmented inverse-probability-weighted (AIPW) estimator combines these ideas: it starts with treatment-specific regression predictions and adds weighted residuals, the differences between observed outcomes and the predictions for the treatment actually received.

The goal here is to derive that estimating expression for the average treatment effect (ATE). The earlier material on AIPW estimation of the average treatment effect introduced its use; the derivation makes clear which term comes from regression, which comes from weighting, and why the correction has its particular form.

Definition: Let \(A\in\{0,1\}\) denote treatment assignment, \(X\) the measured pretreatment covariates, and \(Y\) the observed outcome. Let \(Y(1)\) and \(Y(0)\) be the potential outcomes under treatment and control. The ATE is \(\tau=E[Y(1)-Y(0)]\). Define the propensity score \(e(x)=P(A=1\mid X=x)\), the treatment probability \(p_1(x)=e(x)\), and the control probability \(p_0(x)=1-e(x)\). Define the treatment-specific outcome regression \(m_a(x)=E[Y\mid A=a,X=x]\) for \(a\in\{0,1\}\).

Assumptions and Identification

The derivation concerns identification of the population ATE before considering how to estimate it from a sample. It requires consistency, conditional exchangeability, and positivity. Consistency means that the observed outcome equals the potential outcome under the treatment actually received: \(Y=Y(A)\). Conditional exchangeability means \((Y(1),Y(0))\perp A\mid X\); after conditioning on the measured covariates, treatment assignment is independent of both potential outcomes. Positivity means \(0<e(X)<1\) for covariate values in the target population. These are causal identification assumptions, not properties that can be established merely by fitting a regression or checking a balance summary.

Under consistency and conditional exchangeability, the conditional mean outcome among people with \(A=a\) identifies the conditional mean potential outcome under \(a\). Consequently, for each treatment level,

$$ E[Y(a)]=E\{E[Y(a)\mid X]\}=E\{E[Y\mid A=a,X]\}=E[m_a(X)]. $$

Thus, the regression route to the ATE is \(E[m_1(X)-m_0(X)]\). The expectation averages over the covariate distribution of the target population, rather than comparing only the treated and control groups' unadjusted outcome averages.

From Weighting to the Augmented Expression

Weighting gives another representation of the same treatment-specific mean. Write \(I(A=a)\) for the indicator that equals 1 when \(A=a\) and 0 otherwise. If the probability of receiving treatment \(a\), conditional on \(X\), is \(p_a(X)\), then conditioning on \(X\) gives

$$ E\left[\left.\frac{I(A=a)Y}{p_a(X)}\right|X\right] = \frac{P(A=a\mid X)}{p_a(X)}E[Y\mid A=a,X] = m_a(X). $$

The equality uses \(p_a(X)=P(A=a\mid X)\), which requires the propensity model used in this identity to represent the actual treatment probability. Taking expectations over \(X\) shows that the inverse-probability-weighted outcome also has expectation \(E[m_a(X)]\).

To obtain the augmented expression, start with the regression prediction \(m_a(X)\) and add a weighted residual for observations who received treatment \(a\). When \(m_a(X)\) is the true conditional mean, that residual correction has conditional expectation zero:

$$ E\left[\left.\frac{I(A=a)}{p_a(X)}\{Y-m_a(X)\}\right|X\right] = \frac{P(A=a\mid X)}{p_a(X)}E[Y-m_a(X)\mid A=a,X] =0. $$

The second equality follows because \(m_a(X)=E[Y\mid A=a,X]\). Therefore, adding the correction preserves the target mean under the stated conditions. Equivalently, combining the regression prediction and the weighted residual gives a quantity whose expectation is \(E[m_a(X)]\):

$$ E\left[m_a(X)+\frac{I(A=a)}{p_a(X)}\{Y-m_a(X)\}\right] = E[m_a(X)] = E[Y(a)]. $$

This derivation explains the two parts of the estimator. The first part supplies a prediction for everyone in the target population. The second part uses observed outcomes to correct those predictions, with each residual scaled by the probability of the treatment actually received. For the ATE, subtract the control expression from the treatment expression. The resulting sample estimator is

$$ \hat{\tau}_{\mathrm{AIPW}} = \frac{1}{n}\sum_{i=1}^{n} \left[ \hat{m}_1(X_i)-\hat{m}_0(X_i) + \frac{A_i}{\hat{e}(X_i)}\{Y_i-\hat{m}_1(X_i)\} - \frac{1-A_i}{1-\hat{e}(X_i)}\{Y_i-\hat{m}_0(X_i)\} \right]. $$

Here \(\hat{m}_a(X_i)\) and \(\hat{e}(X_i)\) are fitted values for observation \(i\). The minus sign before the control residual term is essential: the estimator subtracts the estimated control mean from the estimated treatment mean. This tutorial derives the expression under correctly represented outcome and treatment models; a fuller analysis of what happens when a nuisance model is misspecified is a separate question.

Worked Example: Checking the Conditional Residual Correction

Suppose, for a particular covariate value \(X=x\), the treatment probability is \(e(x)=0.4\), and the true conditional means are \(m_1(x)=10\) and \(m_0(x)=6\), measured in outcome units. For treatment, \(P(A=1\mid X=x)=0.4\). If the treatment-specific regression is correct, \(E[Y-m_1(x)\mid A=1,X=x]=0\). Therefore,

$$ E\left[\left.\frac{A}{e(x)}\{Y-m_1(x)\}\right|X=x\right] = \frac{0.4}{0.4}\times 0=0. $$

For control, \(P(A=0\mid X=x)=0.6\), and the corresponding conditional residual mean is also zero. Thus,

$$ E\left[\left.\frac{1-A}{1-e(x)}\{Y-m_0(x)\}\right|X=x\right] = \frac{0.6}{0.6}\times 0=0. $$

At this covariate value, the AIPW contribution has conditional expectation \(m_1(x)-m_0(x)=10-6=4\) outcome units. The calculation checks the residual-correction argument for the specified correct conditional means and positive treatment probabilities; it does not establish those assumptions for an observed study.

Calculating the Sample Estimate

In practice, the population functions are unknown. An analyst fits an outcome model to obtain \(\hat{m}_1\) and \(\hat{m}_0\), and a treatment model to obtain \(\hat{e}\), then substitutes those fitted values into the estimating expression. The following hypothetical data illustrate the arithmetic. Assume the listed fitted values came from models and that the estimated propensity scores are positive and below 1 for every row.

Person\(X\)\(A\)\(Y\) (units)\(\hat{e}(X)\)\(\hat{m}_1(X)\)\(\hat{m}_0(X)\)
1Low1100.5095
2Low040.5095
3High1140.50138
4High070.50138

Worked Example: Computing AIPW From Four Observations

For each person, first calculate the predicted treatment contrast \(\hat{m}_1(X_i)-\hat{m}_0(X_i)\), then add the treatment or control residual correction. For person 1, the prediction contrast is \(9-5=4\), and the treated residual correction is \((10-9)/0.50=2\). The full contribution is \(4+2=6\).

For person 2, the prediction contrast is \(9-5=4\). Since this person is a control, the control residual correction is subtracted: \(-\{4-5\}/(1-0.50)=2\). The contribution is \(4+2=6\). For person 3, the contrast is \(13-8=5\), and the treated correction is \((14-13)/0.50=2\), giving \(7\). For person 4, the contrast is \(13-8=5\), and the subtracted control correction is \(-\{7-8\}/0.50=2\), giving \(7\).

Averaging the four contributions gives

$$ \hat{\tau}_{\mathrm{AIPW}} = \frac{6+6+7+7}{4} = 6.50\ \text{outcome units}. $$

For comparison within this calculation, the regression-only estimate is the average predicted contrast, \((4+4+5+5)/4=4.50\) outcome units. The difference occurs because the observed residuals contribute to the AIPW estimate. It is not, by itself, evidence that either estimate is correct; causal interpretation still depends on the identification assumptions and adequate estimation of the nuisance functions.

Worked Example: Why the Residuals Need Probability Weights

Use the same hypothetical four-person data. The two treated residuals are \(10-9=1\) and \(14-13=1\); the two control residuals are \(4-5=-1\) and \(7-8=-1\). The AIPW residual correction for each treated person is \(1/0.50=2\). For each control person, it is \(-(-1)/0.50=2\), where the leading minus sign is the subtraction of the control residual in the ATE expression. The average correction is \((2+2+2+2)/4=2\), and adding it to the regression contrast of \(4.50\) gives \(6.50\) outcome units.

If one instead added the unweighted residual contributions, each contribution would be 1, so their average would be 1 and the result would be \(4.50+1=5.50\) outcome units. That is not the AIPW expression. The probability factors are part of the derivation: they scale observed residuals to account for treatment assignment probabilities. Omitting them changes the estimator.

Diagnostics, Alternatives, and Limitations

The algebra is simple, but its practical behavior depends on fitted values and the data. Before interpreting an estimate, inspect whether the estimated propensity scores approach 0 or 1. A small \(\hat{e}(X_i)\) can make a treated residual receive a large multiplier; a small \(1-\hat{e}(X_i)\) can do the same for a control residual. Such observations can make the estimate highly sensitive to a few outcomes. Also inspect the outcome-model predictions and residuals by treatment and covariate patterns, and check covariate balance using appropriate diagnostics. A good-looking fitted outcome model or propensity score alone does not verify exchangeability, positivity, or correct model specification.

AIPW is not a cure for unmeasured confounding, lack of overlap, or poor data. Positivity violations cannot be repaired by the formula: when some covariate profiles have essentially no chance of receiving one treatment, the data provide little information about that treatment's outcome for those profiles. Truncating extreme weights may reduce instability but changes the estimator and can introduce bias. Likewise, a finite-sample estimate can be unstable even when the population assumptions are plausible. Uncertainty quantification requires an appropriate variance procedure; the point-estimate derivation alone does not supply a standard error or confidence interval.

ApproachHow it forms the estimateImportant practical concern
Outcome regressionAverage fitted treatment-specific outcome contrasts over the covariate distribution.Depends on the outcome model representing conditional outcome means well.
Inverse-probability weightingUses observed outcomes weighted by inverse treatment probabilities.Extreme weights can make estimates unstable.
AIPWCombines outcome predictions with inverse-probability-weighted residual corrections.Still requires credible causal assumptions and can be unstable with poor overlap or extreme weights.
MatchingConstructs a comparison from treated and control observations with similar covariates or scores.Requires adequate comparable observations and choices about matching and the target population.

A common mistake is to read the word “augmented” as meaning that the estimate is automatically protected from every modeling or data problem. The derivation establishes why the correction has its form under the stated identification conditions; it does not guarantee that the fitted models are adequate, that all confounders were measured, or that extreme weights are harmless. Assess overlap, inspect influential weighted residuals, and keep the target population and causal assumptions explicit.

Key takeaway: AIPW for the ATE is the average of a predicted treatment contrast plus a treated residual weighted by \(1/\hat{e}(X_i)\), minus a control residual weighted by \(1/\{1-\hat{e}(X_i)\}\). Regression predictions provide the baseline; weighted residuals supply the augmentation.

Check Your Understanding

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

  1. State the treatment-specific outcome regression and propensity score used in the AIPW expression.
  2. Why does the treatment residual correction have expectation zero conditional on \(X\) when the treatment-specific outcome regression is correct?
  3. For a treated observation with \(\hat{e}(X_i)=0.25\) and \(Y_i-\hat{m}_1(X_i)=3\) outcome units, what is its treatment residual correction?
  4. Why is a control residual term subtracted in the ATE expression?
  5. Name one diagnostic concern associated with estimated propensity scores near 0 or 1.

Solutions. (1) \(m_a(x)=E[Y\mid A=a,X=x]\), and \(e(x)=P(A=1\mid X=x)\); the control probability is \(1-e(x)\). (2) Conditional on receiving treatment \(a\) and on \(X\), the residual has mean \(E[Y-m_a(X)\mid A=a,X]=0\); multiplying by the treatment indicator and its probability weight therefore still gives conditional expectation zero. (3) The correction is \(3/0.25=12\) outcome units. (4) The ATE is the treatment mean minus the control mean, so the control correction must enter with a minus sign. (5) Near-zero treatment probabilities, or near-zero control probabilities, can produce large inverse weights and a highly influential residual contribution.

Clinical Biostats