Tutorials › Propensity Score Matching and Instrumental Variables › AIPW Estimation of the Average Treatment Effect

Doubly Robust Estimation · Tutorial 289 of 699

AIPW Estimation of the Average Treatment Effect

Learn to calculate the AIPW estimate of an average treatment effect and interpret the distinct roles of its predictions, propensity scores, and weighted residual corrections.

Advanced 10 min read

What You'll Learn

  • Define the average treatment effect using potential outcomes.
  • State the causal assumptions needed to interpret an AIPW estimate.
  • Identify the outcome-regression, propensity-score, and residual-correction components of the estimator.
  • Calculate an AIPW estimate from hypothetical individual-level data.
  • Explain how extreme propensity scores can make residual corrections unstable.
  • Compare AIPW with outcome-regression and inverse-probability-weighted estimates.

Why Augment an Average Treatment Effect Estimate?

An average treatment effect compares the mean outcome that would occur under treatment with the mean outcome that would occur without treatment in the same target population. In observational data, treatment groups may differ in their covariates, so a raw difference in observed means need not estimate this causal contrast. The augmented inverse probability weighted estimator, abbreviated AIPW, combines predictions from an outcome model with weighted residual corrections based on a propensity score.

The point of this tutorial is to make the parts of that estimator explicit and show how to calculate them. The estimator uses outcome-regression predictions for both treatment conditions, the estimated probability of the treatment actually received, and the difference between an observed outcome and its corresponding prediction. It does not make causal interpretation automatic: the study design and assumptions still matter.

Definition: Let \(A_i\in\{0,1\}\) denote the treatment received by individual \(i\), \(Y_i\) the observed outcome, and \(X_i\) a vector of pretreatment covariates. Let \(Y_i(1)\) and \(Y_i(0)\) be that individual's potential outcomes under treatment and control. The average treatment effect (ATE) is \(E[Y(1)-Y(0)]\). Define the propensity score \(e(X)=P(A=1\mid X)\) and the treatment-specific conditional outcome means \(m_a(X)=E[Y\mid A=a,X]\), for \(a\in\{0,1\}\). With fitted values \(\hat e(X_i)\) and \(\hat m_a(X_i)\), the AIPW 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]. $$

Assumptions and the Three Components

The estimator is calculated from observed data, but interpreting it as an estimate of a causal ATE requires assumptions. First, consistency means that the observed outcome equals the potential outcome under the treatment actually received: \(Y=A Y(1)+(1-A)Y(0)\). Second, no interference means one individual's treatment does not change another individual's potential outcomes. Third, conditional exchangeability requires \(\{Y(1),Y(0)\}\) to be independent of \(A\) given \(X\); in words, the measured pretreatment covariates are sufficient to remove confounding conditional on those covariates. Finally, positivity requires \(0<e(X)<1\) for covariate values in the target population. Both treatment options must be possible across the covariate patterns whose effects are being averaged.

For the sample calculation, the fitted propensity scores must also be usable: treated observations require \(\hat e(X_i)>0\), and control observations require \(\hat e(X_i)<1\). A specified outcome model produces \(\hat m_1(X_i)\) and \(\hat m_0(X_i)\) for every individual. In practice, the quality of those fits and of the propensity-score fit matters. The formula alone does not ensure either model is adequate, nor does it guarantee stable estimates in a small sample.

The expression inside the square brackets has three interpretable parts. The first, \(\hat m_1(X_i)-\hat m_0(X_i)\), is the outcome-regression contrast: the fitted difference between the two treatment-specific outcomes at that individual's covariates. Averaging this part alone gives a model-based estimate over the sample's covariate distribution.

The second and third parts together are the residual correction. For a treated individual, the correction is the observed-minus-predicted treated outcome, \(Y_i-\hat m_1(X_i)\), multiplied by \(1/\hat e(X_i)\). For a control individual, it is the observed-minus-predicted control outcome, \(Y_i-\hat m_0(X_i)\), multiplied by \(-1/\{1-\hat e(X_i)\}\). Thus the propensity-score component supplies the inverse-probability multipliers, while the residuals determine the size and direction of the adjustments. Only the residual from the treatment actually received appears for each individual.

This decomposition follows directly by grouping the terms in the estimator. If \(B_i=\hat m_1(X_i)-\hat m_0(X_i)\), \(R_{1i}=Y_i-\hat m_1(X_i)\), and \(R_{0i}=Y_i-\hat m_0(X_i)\), then each individual contributes \(B_i+A_iR_{1i}/\hat e(X_i)-(1-A_i)R_{0i}/\{1-\hat e(X_i)\}\). Averaging gives the outcome-regression contrast average plus the treated and control residual-correction averages. If the observed-arm residuals happen to be zero for every individual, both corrections are zero and the estimate equals the average fitted contrast. This is an algebraic statement about the calculation, not a claim that fitted residuals will generally vanish.

Worked Example: Calculating All Three Components

Consider four hypothetical individuals. The outcome is measured in points. The table supplies the observed treatment, outcome, fitted propensity score, and fitted outcomes under treatment and control. Assume the fitted propensity scores are strictly between zero and one.

Individual\(A_i\)\(Y_i\)\(\hat e(X_i)\)\(\hat m_1(X_i)\)\(\hat m_0(X_i)\)
1180.607.05.0
2160.406.54.5
3040.507.04.5
4050.258.05.5

The outcome-regression contrasts are \(2.0, 2.0, 2.5,\) and \(2.5\) points, whose mean is \((2+2+2.5+2.5)/4=2.25\) points. Now calculate the residual corrections for each row.

For individual 1, the treated residual is \(8-7=1\), so the contribution is \(2+1/0.60=3.6667\) points. For individual 2, it is \(2+(-0.5)/0.40=0.7500\) points. For individual 3, the control residual is \(4-4.5=-0.5\), so the contribution is \(2.5-(-0.5)/0.50=3.500\) points. For individual 4, it is \(2.5-(-0.5)/0.75=3.1667\) points.

Therefore, $$ \hat\tau_{\mathrm{AIPW}}=\frac{3.6667+0.7500+3.500+3.1667}{4}=2.771\text{ points}. $$ The same result can be checked by summing components. The average fitted contrast is \(2.25\) points. The treated residual corrections sum to \(1/0.60+(-0.5)/0.40=0.4167\) points; the control corrections sum to \(1.000+0.6667=1.6667\) points. Their combined contribution to the sample average is \((0.4167+1.6667)/4=0.5208\) points, and \(2.25+0.5208=2.771\). The estimate is in outcome points; the hypothetical example alone provides no basis for a population-level causal conclusion or an uncertainty interval.

How the Propensity Score Changes a Residual Correction

The inverse-probability multiplier is not a multiplier on every outcome or on the fitted contrast. It acts specifically on the observed-arm residual. When a treated person has a small fitted treatment probability, the factor \(1/\hat e(X_i)\) is large. When a control person has a fitted treatment probability close to one, \(1/\{1-\hat e(X_i)\}\) is large. In either case, even a modest residual can make a large adjustment to the estimate.

Worked Example: A Large Weight on a Residual

Suppose two hypothetical individuals have the following fitted values and outcomes. Individual 1 is treated, with \(Y_1=10\), \(\hat e(X_1)=0.20\), \(\hat m_1(X_1)=8\), and \(\hat m_0(X_1)=5\). Individual 2 is a control, with \(Y_2=4\), \(\hat e(X_2)=0.80\), \(\hat m_1(X_2)=7\), and \(\hat m_0(X_2)=5\). Both scores satisfy the numerical positivity requirement for the observed treatment.

Individual 1's fitted contrast is \(8-5=3\). Its treated residual is \(10-8=2\), which is multiplied by \(1/0.20=5\). Its AIPW contribution is \(3+5(2)=13\) points. Individual 2's contrast is \(7-5=2\); its control residual is \(4-5=-1\), multiplied by \(-1/(1-0.80)=-5\). Its contribution is \(2-(-1)/0.20=7\) points. The two-person estimate is \((13+7)/2=10\) points.

The arithmetic is correct, but this deliberately tiny example illustrates why a valid-looking score does not imply a stable estimate. Both residual adjustments are magnified fivefold. With a larger sample, a few observations like these can dominate the average. The value \(10\) points should not be read as reliable evidence about an ATE: the sample is extremely small, and the calculation supplies no uncertainty assessment.

Diagnostics, Alternatives, and Limits

A practical calculation should be accompanied by checks of the inputs and the resulting contributions. Inspect the distribution of fitted propensity scores separately by treatment group, paying particular attention to values near zero for treated individuals and near one for controls. Also inspect the weighted residual corrections and individual AIPW contributions. An estimate driven by a small number of unusually large contributions deserves investigation, even if the overall average appears plausible.

Check that the outcome predictions are defined for both treatment conditions across the covariate values in the sample, and that the fitted propensity scores correspond to the probability of receiving treatment. Confirm that the coding of \(A=1\) and \(A=0\), the sign of the control correction, and the target population are consistent throughout. A coding error can change the sign or meaning of the estimate without producing an obvious numerical warning.

AIPW differs from outcome regression alone, which averages \(\hat m_1(X_i)-\hat m_0(X_i)\) without residual corrections. It also differs from inverse-probability weighting alone, which uses propensity-score weights to construct a contrast without this outcome-regression augmentation. AIPW includes both fitted contrasts and weighted residuals; neither set of terms should be mistaken for the complete estimator. Matching is another adjustment strategy, with its own construction of comparisons and target. These methods do not automatically share the same finite-sample behavior or target, so comparisons require attention to their estimands and assumptions.

Several limitations remain. Poor covariate measurement can undermine conditional exchangeability; fitted models cannot adjust for unmeasured confounding simply by being combined. Weak overlap can produce highly variable corrections, and the formula does not resolve a lack of support in the data. AIPW is also an estimate, not an uncertainty interval: assessment of sampling variability requires an appropriate inferential procedure that accounts for the data and estimation process. Finally, an estimate outside the outcome's possible range may occur with some outcomes and finite samples; it signals that the estimator is not constrained to that range, not that the arithmetic must be wrong.

Common pitfall: It is incorrect to say, “The outcome model predicts the contrast, so the propensity score is only a diagnostic,” or to multiply the entire outcome-regression contrast by an inverse propensity score. In the AIPW formula, the fitted contrast is averaged as written, and the propensity-score weights multiply only the observed-arm residuals. Check each individual contribution against that structure before interpreting the result.

Worked Example: When Residual Corrections Are Zero

In a final hypothetical two-person example, both fitted propensity scores equal \(0.50\). For the treated individual, \(Y_1=7\), \(\hat m_1(X_1)=7\), and \(\hat m_0(X_1)=4\). For the control individual, \(Y_2=2\), \(\hat m_1(X_2)=5\), and \(\hat m_0(X_2)=2\). The treated contribution is \((7-4)+(7-7)/0.50=3\) points. The control contribution is \((5-2)-(2-2)/0.50=3\) points. Thus \(\hat\tau_{\mathrm{AIPW}}=(3+3)/2=3\) points, equal to the mean fitted contrast. This equality occurs because each observed-arm residual is zero in this example; it should not be expected as a general feature of fitted models.

Check Your Understanding

Try each question, then compare with the solutions below.

  1. For a treated individual with fitted contrast \(4\), observed outcome \(Y=9\), fitted treated outcome \(8\), and propensity score \(0.50\), calculate the AIPW contribution.
  2. For a control individual with fitted contrast \(3\), observed outcome \(Y=4\), fitted control outcome \(5\), and propensity score \(0.75\), calculate the AIPW contribution.
  3. Which terms form the outcome-regression component, and which terms form the residual correction?
  4. Name two assumptions needed to interpret an AIPW estimate as an estimate of a causal ATE.
  5. Why can a small propensity score for a treated individual create instability?

Solutions. (1) The treated residual is \(9-8=1\), so the contribution is \(4+1/0.50=6\) outcome units. (2) The control residual is \(4-5=-1\), so the contribution is \(3-(-1)/(1-0.75)=3+4=7\) outcome units. (3) The outcome-regression component is \(\hat m_1(X_i)-\hat m_0(X_i)\); the residual correction consists of the treated weighted residual minus the control weighted residual, using only the observed treatment arm for each individual. (4) Examples include conditional exchangeability, positivity, consistency, and no interference. (5) The treated residual is divided by \(\hat e(X_i)\), so a small value creates a large multiplier and can magnify even a modest residual.

Clinical Biostats