Tutorials › Marginal Structural Models › Stabilized Weights for Continuous Treatments

Weight Stabilization and Truncation · Tutorial 135 of 501

Stabilized Weights for Continuous Treatments

Learn how continuous-treatment stabilized weights compare numerator and denominator densities, what weighted distribution they create, and how to calculate them from fitted normal models.

Advanced 11 min read

What You'll Learn

  • Define a stabilized weight as a ratio of treatment densities for a continuous exposure.
  • Distinguish a marginal numerator density from one conditional on baseline covariates.
  • Calculate Gaussian numerator and denominator densities and their ratio for observed treatment values.
  • Derive the weighted covariate-treatment distribution under correctly specified density models.
  • Identify the support and modeling conditions needed to interpret the weights.
  • Recognize why a density ratio is not a probability or a guarantee of well-behaved weights.

Why Stabilization Uses Densities for a Continuous Treatment

For a binary treatment, an inverse-probability weight is built from the probability of the treatment actually received. With a continuous treatment, the probability of receiving exactly the observed value is generally zero. The corresponding ingredient is instead a density evaluated at the observed treatment value. A stabilized weight compares that density under a numerator model with the density under a denominator model.

This comparison has a practical interpretation: the denominator describes how treatment varies with the measured covariates, while the numerator describes the treatment distribution to retain in the weighted population. The ratio reweights the observed data toward that chosen numerator distribution. It is a ratio of densities, not a probability and not necessarily a number below one.

Definition: Let \(A\) be a continuous treatment and \(L\) the measured pre-treatment covariates used in the denominator model. Write \(f_{A\mid L}(a\mid l)\) for the conditional density of treatment given covariates. A stabilized treatment weight at the observed values \((A,L)\) is $$ SW=\frac{f_{\mathrm{num}}(A\mid V)}{f_{\mathrm{den}}(A\mid L)}. $$ Here \(V\) is a chosen subset of baseline covariates, possibly empty; if \(V\) is empty, \(f_{\mathrm{num}}(A\mid V)\) means the marginal density \(f_A(A)\). Under correctly specified models, the numerator and denominator are the corresponding treatment densities. The unstabilized weight has numerator 1 and denominator \(f_{A\mid L}(A\mid L)\).

The denominator model must describe the conditional density of \(A\) given the relevant pre-treatment covariates. The numerator can be marginal or conditional on selected baseline covariates. Using baseline covariates in the numerator retains their association with treatment in the weighted population; it does not mean those covariates should be omitted from the denominator.

Assumptions and Meaning of the Density Ratio

The ratio is defined only where the denominator density is positive. For the weighted distribution to be well-defined, the numerator distribution must be absolutely continuous with respect to the denominator distribution: wherever the numerator assigns positive density, the denominator must also assign positive density. In a causal analysis, the denominator density must also be positive over treatment values relevant to the target intervention, conditional on the covariate values being considered. This is the continuous-treatment form of positivity.

The weight formula itself is a distributional construction. Its causal interpretation additionally relies on the usual causal assumptions, including consistency and conditional exchangeability given the measured pre-treatment covariates, as well as an appropriate treatment density model. A correctly calculated density ratio cannot correct unmeasured confounding or a misspecified denominator model.

A density has units inverse to the units of \(A\). The units cancel in the ratio, so a stabilized weight is dimensionless. For a continuous treatment, \(f(A\mid L)\) is not \(P(A\mid L)\): it is a density value. A density can exceed one, depending on the measurement scale, without violating any probability rule.

Worked Example: A Marginal Normal Numerator

Suppose the numerator model is \(A\sim N(0,1.5^2)\), and for a person with covariate value \(L=0\), the denominator model is \(A\mid L=0\sim N(0,1^2)\). For an observed treatment \(A=1\), calculate the stabilized weight.

For a normal density with mean \(\mu\) and standard deviation \(\sigma\), $$ f(a)=\frac{1}{\sigma\sqrt{2\pi}}\exp\left\{-\frac{(a-\mu)^2}{2\sigma^2}\right\}. $$ Thus the numerator density is $$ f_{\mathrm{num}}(1)=\frac{1}{1.5\sqrt{2\pi}}\exp\left(-\frac{1}{2(1.5^2)}\right) =\frac{1}{1.5\sqrt{2\pi}}\exp(-0.222222\ldots) \approx 0.21297. $$

The denominator density is $$ f_{\mathrm{den}}(1\mid 0)=\frac{1}{\sqrt{2\pi}}\exp\left(-\frac{1}{2}\right) \approx 0.24197. $$ Therefore $$ SW=\frac{0.21297}{0.24197}\approx 0.8801. $$ Equivalently, canceling the common \(\sqrt{2\pi}\) factor gives $$ SW=\frac{1}{1.5}\exp\left(-\frac{1}{4.5}+\frac{1}{2}\right) =\frac{2}{3}\exp(0.277778\ldots)\approx 0.8801. $$

This example also shows why one must retain the normalizing constants in the density ratio: the factor \(1/1.5\) is part of the weight.

What Distribution Does Stabilization Create?

The next result makes the role of the numerator precise. Assume the denominator is the true conditional density \(f_{A\mid L}\), and the joint distribution of \((A,L)\) has density \(f_{A\mid L}(a\mid l)f_L(l)\). Let \(q(a\mid v)\) be a numerator density, where \(V\) is a function of \(L\). Define \(w(a,l)=q(a\mid v)/f_{A\mid L}(a\mid l)\). Assume \(q\) integrates to one for each \(v\), and that the required support condition holds.

Theorem: Reweighting the joint distribution of \((A,L)\) by \(w(A,L)\) gives the density $$ f_w(a,l)=f_L(l)q(a\mid v). $$ In particular, if the numerator is marginal, \(q(a\mid v)=f_A(a)\), then the weighted joint density is \(f_L(l)f_A(a)\), so \(A\) and \(L\) are independent in the weighted distribution.

Proof. The original joint density is \(f_{A\mid L}(a\mid l)f_L(l)\). Multiplying it by the weight gives $$ w(a,l)f_{A\mid L}(a\mid l)f_L(l) =\frac{q(a\mid v)}{f_{A\mid L}(a\mid l)}f_{A\mid L}(a\mid l)f_L(l) =f_L(l)q(a\mid v). $$ The expression is already normalized. Indeed, since \(V\) is determined by \(L\), $$ \int\!\!\int f_L(l)q(a\mid v)\,da\,dl =\int f_L(l)\left\{\int q(a\mid v)\,da\right\}dl =\int f_L(l)\,dl=1. $$ It is therefore the weighted joint density. If \(q(a\mid v)=f_A(a)\), it factors into the marginal density of \(L\) and the marginal density of \(A\), which is precisely independence. \(\square\)

When the numerator is conditional on baseline covariates \(V\), the same factorization shows that the treatment distribution given \(L\) in the weighted population is \(q(a\mid v)\). Since that distribution depends on \(V\) but not on the remaining components of \(L\), treatment is independent of those remaining components conditional on \(V\) in the weighted population. The association with \(V\) is intentionally retained.

Result: Under the same conditions, the expected stabilized weight is one: $$ E[SW]=1. $$ For a marginal numerator this follows by integrating \(f_L(l)f_A(a)\); for a numerator \(q(a\mid v)\), it follows by integrating \(f_L(l)q(a\mid v)\). This is a population identity under the specified true densities, not a requirement that the sample average of fitted weights equal exactly one.

For completeness, the identity also follows conditionally on \(L=l\): $$ E[SW\mid L=l] =\int \frac{q(a\mid v)}{f_{A\mid L}(a\mid l)}f_{A\mid L}(a\mid l)\,da =\int q(a\mid v)\,da=1. $$ This calculation requires the numerator density to integrate to one and the denominator to be positive wherever the numerator is positive. Averaging over \(L\) then gives \(E[SW]=1\).

Worked Example: Checking the Corrected Gaussian Ratio

Consider normal numerator and denominator models with standard deviations \(0.9\) and \(1.4\), respectively. At an observed treatment value \(a\), suppose their centered quadratic terms in the log-density ratio evaluate to \(-0.010204\) for the numerator and \(+0.302469054\ldots\) for the denominator. The standard-deviation factor in the density ratio is \(0.9/1.4\). Calculate the weight and check its rounding.

The normalizing constants contribute \(0.9/1.4=0.6428571429\ldots\). The log-density contribution is $$ -0.010204+0.302469054\ldots=0.292265054\ldots. $$ Hence the exponential factor is $$ \exp(0.292265054\ldots)\approx 1.339458. $$ The stabilized weight is consequently $$ SW=\left(\frac{0.9}{1.4}\right)(1.339458\ldots) \approx 0.86108. $$ To four decimal places, the exponential factor is \(1.3395\), and the weight is \(0.8611\). These rounded values follow from the unrounded exponent and ratio; rounding the exponential factor too early can change the last reported digit.

Worked Example: A Numerator Conditional on Baseline Covariates

Suppose \(V=0\) for a person, with numerator model \(A\mid V=0\sim N(1,1^2)\). Given the fuller denominator covariate value \(L=1\), suppose \(A\mid L=1\sim N(2,0.5^2)\). For the observed value \(A=1.5\), calculate the stabilized weight.

The numerator density is $$ f_{\mathrm{num}}(1.5\mid 0) =\frac{1}{\sqrt{2\pi}}\exp\left(-\frac{(1.5-1)^2}{2}\right) =\frac{1}{\sqrt{2\pi}}\exp(-0.125) \approx 0.35207. $$ The denominator density is $$ f_{\mathrm{den}}(1.5\mid 1) =\frac{1}{0.5\sqrt{2\pi}} \exp\left(-\frac{(1.5-2)^2}{2(0.5^2)}\right) =\frac{2}{\sqrt{2\pi}}\exp(-0.5) \approx 0.48394. $$ Thus \(SW\approx 0.35207/0.48394=0.7275\). The same calculation using the ratio form is $$ SW=\frac{0.5}{1}\exp(-0.125+0.5) =0.5\exp(0.375)\approx 0.7275. $$

The numerator preserves the treatment distribution associated with \(V\), while the denominator accounts for the fuller covariate set \(L\). Had the numerator instead been marginal, its density would not condition on \(V\), and the weighted population would target a different treatment-covariate distribution.

Modeling Checks, Alternatives, and Limitations

A continuous-treatment density model requires more than selecting a familiar regression formula. Check whether its conditional means and spread describe the observed treatment across covariate patterns, and inspect whether the fitted densities assign negligible values to observed treatments. Residual plots, comparisons of observed and model-implied treatment distributions across covariate groups, and sensitivity to reasonable alternative density specifications can reveal poor fit. A model that captures the conditional mean but badly misses variation or tail behavior can produce inaccurate density ratios.

Several choices should be made deliberately:

  • Marginal versus conditional numerator. A marginal numerator targets a weighted treatment distribution independent of all covariates in \(L\). A numerator conditional on \(V\) retains treatment association with \(V\). The choice changes the weighted distribution and should match the intended marginal structural model.
  • Parametric versus flexible density modeling. A normal model is convenient when plausible, but skewness, multimodality, or changing variance may require a different or more flexible conditional density model. Fit quality matters in both numerator and denominator, though denominator errors directly affect adjustment for covariates.
  • Stabilized versus unstabilized weights. The unstabilized density ratio uses numerator 1; stabilized weights use a proper numerator density and have population mean one under the stated conditions. This identity does not ensure that individual weights are moderate or that a finite-sample average is exactly one.

A common mistake is to substitute a probability for the density at the observed treatment, or to omit the normalizing constant in a fitted density. For example, a normal density ratio includes the standard-deviation factor \(\sigma_{\mathrm{den}}/\sigma_{\mathrm{num}}\) as well as the exponential terms. Omitting it does not merely change notation; it produces the wrong weight. Another mistake is to treat the numerator as a harmless numerical rescaling. Its conditional variables define which treatment-covariate associations are retained in the weighted population.

Density ratios can also be sensitive to support mismatch: if observed treatment values occur where a fitted denominator density is extremely small, the ratio may be unstable. This is a warning to examine overlap and model fit, not a reason to interpret a fitted density as a probability. Stabilization alone cannot repair a lack of support, misspecification, or unmeasured confounding.

1
Specify the target numerator.
Decide whether the numerator is marginal or conditional on selected baseline covariates, based on the treatment distribution intended in the weighted population.
2
Fit both density models.
Estimate the numerator density and the conditional denominator density using models suited to the treatment distribution and covariate structure.
3
Evaluate at each observed treatment.
Calculate the two densities at the person's observed treatment value, retain their normalizing constants, and take the numerator-to-denominator ratio.
4
Check support and fit.
Assess whether the denominator assigns adequate density to observed treatments and whether the fitted conditional treatment distributions are credible.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. Why is the denominator for a continuous treatment a density rather than the probability of receiving the exact observed value?
  2. If the numerator is marginal and the denominator is correct, what is the joint density of \(A\) and \(L\) in the weighted population?
  3. For numerator density \(0.18\) and denominator density \(0.30\) at an observed treatment value, calculate the stabilized weight.
  4. What changes in the weighted distribution when the numerator is conditional on a baseline covariate \(V\) rather than marginal?

Solutions. (1) A continuously distributed variable has probability zero of equaling any one exact value; the density at that value describes relative local concentration and is the factor used in the density ratio. (2) It is \(f_L(l)f_A(a)\), so treatment and the full covariate vector are independent in that weighted population. (3) \(SW=0.18/0.30=0.6\). (4) The weighted treatment density is \(q(a\mid v)\), so association between treatment and \(V\) is retained; conditional on \(V\), treatment is independent of the remaining components of \(L\), under the theorem's conditions.

Clinical Biostats