- Introduced by
- James M. Robins and colleagues
- Year
- 1986-2000
- Type
- Causal weighting estimator
- Family
- Quasi-experimental / causal inference
What does it do?
Dynamic Inverse Probability Weighting (Dynamic IPW) estimates the causal effect of a treatment sequence that changes over time.
It reweights observed longitudinal data so that the weighted sample resembles one in which treatment at each period is not driven by the covariate history. The approach is needed because past treatment can affect later covariates, which in turn affect later treatment, a feedback loop that standard regression adjustment cannot handle without biasing the estimate.
The intuition behind the method
In a single-time study, confounders can be handled by including them in a regression. When treatment is given at several time points, a covariate measured between treatments can be a confounder of the next treatment decision and also an effect of the previous one. Adjusting for it in a regression removes some confounding but also blocks part of the effect of earlier treatment, so the estimate is biased. Dynamic IPW avoids this by building a pseudo-population: each person is weighted by the inverse of the probability that they received their observed treatment sequence, given their covariate history. Individuals on unlikely treatment trajectories receive larger weights, so the weighted data balance covariate histories across treatment sequences, as they would if treatment were assigned at random at each period.
History
Robins, Hernán, and Brumback (2000) introduced marginal structural models and the inverse-probability-of-treatment weighted estimators used to fit them, for settings where time-dependent confounders are also affected by previous treatment. Hernán and Robins (2020) later presented the framework in their textbook Causal Inference: What If.
When to use it
Use Dynamic IPW when the treatment of interest is administered repeatedly over time, both treatment and covariates vary across periods, and treatment decisions at each time point are influenced by prior covariate history, the classic time-varying confounding setting. It is well suited to pharmacoepidemiology (e.g., time-varying drug use), economics of repeated programme participation, and public-health interventions with evolving exposure. Assumptions are: no unmeasured time-varying confounding (sequential ignorability), positivity (every subject has a non-zero probability of each treatment at each period), and consistency. Avoid it when unmeasured confounders exist (instrumental variables may be preferred), when the number of time points is very large relative to sample size so weights become extreme, or when treatment sequences are so rare that positivity fails for some covariate histories.
Limitations and considerations
- Relies on the no unmeasured time-varying confounding assumption (sequential ignorability), which is untestable and demanding in observational settings.
- The positivity assumption can fail in practice: if some covariate histories make treatment nearly deterministic, weights become extreme and variance explodes.
- Propensity models must be correctly specified at every time point; misspecification accumulates multiplicatively across periods and can produce substantial bias.
- With many time points or rare treatment trajectories, the product of inverse probabilities can yield extremely large weights, leading to unstable estimates.
- Requires large samples to estimate propensity models reliably at each period and to have enough individuals following each treatment regime of interest.
- When subjects are lost to follow-up or censored, the stabilised weights must be multiplied by inverse probability of censoring weights estimated at each period, and censoring must be conditionally independent of the outcome given the measured history.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Handles time-varying confounding that mediates the treatment-covariate-treatment feedback loop, which standard regression adjustment cannot resolve without biasing the estimate.
- Does not require a parametric outcome model — only the treatment assignment mechanism needs to be modelled at each period.
- Stabilised weights reduce variance and allow standard weighted outcome regression on the resulting pseudo-population.
- Directly targets the causal effect of well-defined treatment regimes or protocols, making the estimand transparent and policy-relevant.
- Can be combined with outcome modelling in a doubly robust estimator for added protection against propensity model misspecification.
Applications
- Estimating the effect of time-varying antiretroviral therapy regimes on HIV disease progression in observational cohort studies.
- Evaluating the causal impact of repeated job-training programme participation on long-run employment and earnings outcomes.
- Assessing the effect of time-varying medication use or smoking exposure on chronic disease risk in longitudinal health surveys.
- Analysing the impact of dynamic environmental or occupational exposures on health endpoints measured at the end of follow-up.
- Evaluating multi-stage educational or social interventions where enrolment or dosage changes over time in response to participant characteristics.
- Estimating the effect of time-varying social benefit receipt on poverty outcomes in administrative panel data.
How it works
How it works
At each time point t, a propensity score model is estimated: the conditional probability of receiving the observed treatment given the history of past treatments and time-varying covariates up to t. A separate model is fit for each time point, typically using logistic regression or a flexible classifier, and repeated for every period in the observation window.
Formula
\hat{p}(A_t = a_t \mid \bar{A}_{t-1}, \bar{L}_t)The unstabilised weight for each individual is the product of the inverse propensity scores across all time points. A large cumulative weight signals that the individual's observed treatment sequence was unlikely given their covariate history, so their data are upweighted to represent others on the same trajectory.
Formula
\hat{W}_i = \prod_{t=1}^{T} \frac{1}{\hat{p}(A_t = a_t \mid \bar{A}_{t-1}, \bar{L}_t)}The stabilised weight places in the numerator the probability of each treatment conditional on past treatment only, omitting the time-varying covariates. Because the numerator depends only on treatment history, the weights are usually less variable than unstabilised weights, and the estimator remains consistent under the same assumptions. Stabilisation does not remove finite-sample bias, which can still arise when some weights are extreme. Using stabilised weights is the usual default.
Formula
\hat{SW}_i = \prod_{t=1}^{T} \frac{\hat{p}(A_t = a_t \mid \bar{A}_{t-1})}{\hat{p}(A_t = a_t \mid \bar{A}_{t-1}, \bar{L}_t)}The causal mean potential outcome under a specific treatment regime is estimated by taking the weighted average of observed outcomes among individuals who actually followed that regime. In the weighted pseudo-population, treatment at each period is no longer associated with the time-varying covariates, mimicking an experiment in which treatment was randomised at every time point.
Formula
\hat{E}[Y^{\bar{a}}] = \frac{\sum_i \hat{SW}_i \cdot \mathbf{1}(\bar{A}_i = \bar{a}) \cdot Y_i}{\sum_i \hat{SW}_i \cdot \mathbf{1}(\bar{A}_i = \bar{a})}The labels 1 and 0 in the formula denote two fixed treatment regimes, for example two different treatment sequences chosen by the analyst. The causal effect of one regime versus the other is the difference (or ratio) between the two weighted potential-outcome estimates. Read the contrast as a population-average effect: it is the marginal mean outcome expected if the whole population followed one regime, compared with the whole population following the other, for the population represented by the weighted sample. The scale (difference or ratio) must be stated with the estimate. The formulas above are written for fixed regimes; rules that make treatment depend on history need a different weight definition, which is not given here. Standard errors are obtained via robust sandwich variance or bootstrap, accounting for the fact that the weights were estimated rather than known.
Formula
\hat{\Delta} = \hat{E}[Y^{\bar{a}=1}] - \hat{E}[Y^{\bar{a}=0}]Common pitfalls
- Failing to inspect and trim extreme weights: even a few very large weights can dominate the weighted estimator and inflate variance substantially. Always check the weight distribution and consider truncation at a high percentile.
- Using unstabilised rather than stabilised weights without reason — unstabilised weights tend to be more variable for no gain in bias reduction, and should be replaced with stabilised weights in almost all applications.
- Ignoring the positivity assumption: when certain covariate histories make treatment deterministic for some subjects, the causal effect is not identified for them. In that case, restrict the target population or the regimes, report the restriction, and do not extrapolate the estimate to the excluded subgroup.
- Reporting confidence intervals that do not account for estimation of the weights — use bootstrap or sandwich standard errors that propagate weight uncertainty.
- Conflating this setting with a simple cross-sectional IPW analysis and applying a single static propensity score where sequential propensity models and cumulative weighting are required.
Frequently asked questions
What distinguishes Dynamic IPW from standard (static) IPW?
Standard IPW handles a single-time treatment: one propensity score is estimated and each observation is reweighted once. Dynamic IPW handles treatment sequences over multiple periods, estimating a propensity model at each time point and multiplying the inverse probabilities across periods. The key additional challenge is time-varying confounding, variables that are simultaneously affected by past treatment and cause future treatment, which static IPW cannot accommodate without biasing the estimate by blocking causal pathways.
What is the positivity assumption and when does it fail?
Positivity requires that every individual, regardless of their covariate history, has a non-zero probability of receiving each treatment at each time point. It fails when some covariate combinations make treatment deterministic, for example if all patients with a certain lab value always receive a specific drug. In such cases, weights become infinite and the causal effect is not identified for those individuals. Checking empirical support for positivity (e.g., examining propensity score distributions) is essential before applying Dynamic IPW.
Why use stabilised weights instead of plain inverse probability weights?
Unstabilised weights are products of inverse conditional probabilities, so a few small treatment probabilities can make individual weights very large and inflate the variance of the estimator. Stabilised weights replace the conditional probability in the numerator with the probability conditional on past treatment alone, as in the stabilised weight formula. This usually reduces the spread of the weights and the variance while leaving the target causal contrast unchanged. It does not guarantee unbiasedness in small samples, so the weight distribution should still be checked.
How should I handle extreme weights in practice?
First diagnose them by examining the distribution of weights (mean, maximum, 99th percentile). If extreme weights are present, consider: (1) improving propensity model specification by adding interactions or using flexible machine-learning methods; (2) ensuring weights are stabilised; (3) trimming or truncating weights at a threshold such as the 99th percentile, which introduces small bias but reduces variance. Report sensitivity analyses under different trimming strategies.
Can Dynamic IPW be combined with outcome modelling for robustness?
Yes. A doubly robust estimator combines the Dynamic IPW weights with a separate outcome regression fitted conditional on treatment and covariate history, rather than with a marginal structural model, which is itself a weighted model. Such estimators are designed to remain consistent if either the propensity models or the outcome regression is correctly specified, which provides some protection against misspecification of either component. Whether this improves finite-sample behaviour depends on the data, so it should be checked in the specific application.
Related methods
Sources
Robins, J. M., Hernan, M. A., & Brumback, B. (2000). Marginal structural models and causal inference in epidemiology. Epidemiology, 11(5), 550-560.
Open DOI referenceHernan, M. A., & Robins, J. M. (2020). Causal Inference: What If. Chapman & Hall/CRC.
Open publication reference