Ask Mallard
Analysis method

Augmented inverse probability weighting (AIPW)

4 min read

AIPW combines outcome predictions with weighted prediction errors; the average effect can remain consistent when either the treatment model or outcome models are correct.

Fit

When to use it, and when not to

Use it when

  • You compare two baseline treatments and want the average effect for a defined eligible population.
  • You can fit treatment probabilities and outcome predictions using measured baseline factors.

Not when

Before you start

What you need

Decide these first
  1. The target, contrast and outcome horizonSpecify a mean difference or risk difference for the eligible population.
  2. Treatment scores and two outcome predictions per personPredict each outcome under treatment and under control from baseline factors.
  3. A fitting and uncertainty planFor flexible learners, plan cross-fitting: train models on other folds before predicting each held-out record.
It rests on these
  1. The measured baseline factors suffice for causal adjustment.How to check: Check clinical knowledge and the causal diagram; two models do not fix an omitted common cause.
  2. Either treatment is possible at each target profile.How to check: Inspect probabilities and weighted errors; extreme scores still cause instability.
  3. The treatment versions are well defined, without relevant interference.How to check: Align eligibility, assignment and follow-up at time zero.
  4. Either the treatment model or both treatment-specific outcome models are correct for consistency under regularity conditions.How to check: Check both models. Double robustness is not a promise about bias in a small sample.
  5. Missing at random given recorded predictors may justify imputation.How to check: Specify imputation and sensitivity analyses. AIPW for treatment does not automatically solve missing outcomes.

Plain language

How it works

First fit a treatment model and an outcome model for each arm. For each person, start with their predicted outcome under treatment. For treated people, add the observed outcome minus that prediction, divided by their treatment chance. Average these corrected predictions. Repeat for control, correcting only untreated people with one minus the treatment chance. Subtract the corrected averages.

Reading the result

Bang and Robins establish double robustness; Funk and colleagues give a worked example and simulation study. The consistency claim requires either a correct treatment model or correct outcome models, plus causal assumptions. For regular parametric models, bootstrap the entire fitting procedure and use a percentile interval. An influence-function Wald interval with flexible models needs cross-fitting and suitable convergence rates; consistency alone does not establish interval validity.

The method in steps
The correction supplies double robustness under causal and model assumptions. Valid intervals require additional inference conditions.Augmented inverse probability weighting (AIPW)Fit baseline treatment and outcome modelsPredict both potential outcome meansAdd inverse-weighted observed-arm errorsAverage corrected predictions in each armSubtract corrected means for the targetThe correction supplies double robustness under causal and model assumptions. Valid intervals requireadditional inference conditions.
Conceptual diagram. It shows the structure of the idea, not data from any study.

Worked example

A worked example

Invented for illustration
Setting
Four records have treatment scores of 0.5, with treated pain scores 3 and 5 and untreated pain scores 5 and 7.
Question
What is the average treatment-minus-control difference in pain?
Approach
Outcome predictions are 4 under treatment and 6 under control for every record. Add each observed arm’s prediction error divided by its treatment chance.
Result
The corrected means are 4 under treatment and 6 under control. Their difference is -2 pain points.
What it means
This small dataset illustrates the correction only. Double robustness gives no guarantee of a reliable effect or confidence interval for four records.

In practice

Recent studies PubMed search · not vetted

Searching PubMed…

Watch out

Common mistakes

The one to remember

Double robustness concerns consistency when either nuisance model is correct. It does not remove unmeasured confounding, repair absent treatment support or guarantee valid uncertainty.

  • Calling two incorrect models doubly safe.Instead: Either nuisance model must be correct for the usual consistency claim; both can fail together.
  • Assuming consistency guarantees correct confidence intervals.Instead: Use a joint sandwich variance or full refit bootstrap for regular models. Flexible learners need suitable cross-fitting and rate conditions.
  • Reading a single corrected contribution as a possible patient outcome.Instead: Contributions are calculation devices and may lie outside the observed outcome range.

Inside Mallard

How Mallard uses this

Plans do not link to this method yet.

Code example in Mallard: Augmented inverse-probability weighting (AIPW): a doubly robust effect (aipw-doubly-robust).
Sample size: Mallard sizes the main comparison with two proportions. It does not size adjustment or any secondary analysis.
Atlas node analysis.aipw, the id a plan cue records.
Code for this method
Loading…

Related Learn pages

Related designs and methods

Evidence

Sources & further reading

  1. Doubly robust estimation in missing data and causal inference models (opens in a new tab) · Biometrics · doi 10.1111/j.1541-0420.2005.00377.x
  2. Doubly robust estimation of causal effects (opens in a new tab) · Am J Epidemiol · doi 10.1093/aje/kwq439
PubMed records, authors, years and available DOIs checked 2026-11-06. Bang and Robins develop doubly robust estimators. Funk and colleagues provide a worked example and original simulations of estimation and standard errors. No independent professional approval is claimed.
Last source review: 2026-11-06
AI-generated educational content
Mallard uses reputable methodological and reporting sources, but this material may contain errors or omit important context. Verify important methodological decisions with the cited sources and, when appropriate, a qualified research methodologist or statistician.