Tutorials › Causal Inference › Inverse-Probability Weights for Continuous Treatments

Marginal Structural Models · Tutorial 734 of 972

Inverse-Probability Weights for Continuous Treatments

Construct and interpret longitudinal density-ratio weights for continuous treatments, then check how normal-model overlap affects their size.

Advanced 12 min read

What You'll Learn

  • Define denominator and numerator conditional treatment densities at each visit.
  • Construct stabilized longitudinal weights as products of density ratios.
  • Distinguish a conditional density from the probability of an exact treatment value.
  • Calculate density ratios and a two-visit cumulative weight under normal models.
  • Check support and identify treatment values that can produce unstable ratios.

Why Continuous Treatments Require Density Ratios

Inverse-probability weighting can be used when treatment is measured on a continuum, such as a dose in milligrams per day. In that setting, an individual’s probability of receiving exactly the observed dose is generally zero. The weighting calculation therefore does not divide probabilities of exact treatment values. It divides conditional densities, evaluated at the observed treatment values.

The purpose of a treatment weight is to change the treatment assignment distribution represented in the observed data. At each visit, the denominator describes the treatment distribution given the measured history that may confound the treatment–outcome relationship. A numerator density defines the treatment distribution retained in a stabilized weight. The longitudinal weight multiplies these visit-specific density ratios.

Definition: Let \(A_t\) be a continuous treatment at visit \(t\), and let \(H_t=(V,\bar L_t,\bar A_{t-1})\) be the observed history available immediately before that treatment. Here \(V\) denotes baseline covariates, \(L_t\) denotes covariates measured before \(A_t\), and bars denote histories through the indicated visit. Let \(f_t(a_t\mid H_t)\) be the conditional density of \(A_t\) given that history. Let \(q_t(a_t\mid V,\bar A_{t-1})\) be a specified numerator density. The stabilized treatment weight through visit \(K\) is $$ SW_K=\prod_{t=1}^{K} \frac{q_t(A_t\mid V,\bar A_{t-1})} {f_t(A_t\mid H_t)}. $$ The unstabilized weight for a specified treatment density \(g_t\) at each visit replaces \(q_t\) by \(g_t\). Each density ratio is evaluated at the treatment actually observed for that individual.

The denominator conditions on the measured history used to account for treatment assignment, including time-varying covariates that may be affected by earlier treatment. The numerator commonly conditions on baseline covariates and prior treatments, but omits some or all of the time-varying covariates in the denominator. This choice stabilizes the weights while retaining the treatment distribution specified by the numerator model. A particular numerator model must be stated; it is not determined by the denominator alone.

Causal interpretation requires more than calculating a ratio. The usual conditions include consistency (the observed outcome under the treatment actually received equals the corresponding potential outcome), sequential exchangeability (at each visit, treatment is conditionally independent of the relevant future potential outcomes given the measured history), and positivity. For continuous treatments, the relevant positivity condition is that the numerator distribution be supported wherever the denominator distribution assigns the observed treatment process positive probability: informally, \(q_t(a_t\mid V,\bar A_{t-1})\) must not put mass in regions where \(f_t(a_t\mid H_t)=0\), for histories with positive probability. In density terms, the numerator distribution must be absolutely continuous with respect to the denominator distribution at the histories being weighted. These assumptions are not established by fitting a density model.

Densities Are Not Probabilities

A density gives probability per unit of the treatment scale, not the probability of one exact value. For a continuous treatment \(A_t\), \(P(A_t=a\mid H_t)=0\) for any particular \(a\), even when the conditional density \(f_t(a\mid H_t)\) is positive. Probabilities refer to intervals, such as \(P(4.9<A_t<5.1\mid H_t)\), which are obtained by integrating the density over the interval.

In a ratio such as \(q_t(A_t\mid V,\bar A_{t-1})/f_t(A_t\mid H_t)\), both densities use the same treatment scale, so their units cancel. The ratio is dimensionless. It can be smaller or larger than one; it is not itself a probability. Changing the treatment scale, for example from milligrams to grams, changes each density by the same scale factor and leaves the ratio unchanged when both models are transformed consistently.

Worked Example: One Normal Density Ratio

Suppose a hypothetical study measures a continuous daily dose in milligrams. For a participant with a particular measured history, the denominator model is \(A\mid H\sim N(4,1.5^2)\). The numerator model for that participant is \(A\mid V\sim N(3,2^2)\). The observed dose is \(5\) mg. Calculate the stabilized ratio for this visit.

For a normal density with mean \(\mu\) and standard deviation \(\sigma\), the density at \(a\) is \(\frac{1}{\sigma\sqrt{2\pi}}\exp[-(a-\mu)^2/(2\sigma^2)]\). Thus the numerator density at 5 is $$ q(5\mid V)=\frac{1}{2\sqrt{2\pi}}\exp\left[-\frac{(5-3)^2}{2(2^2)}\right] \approx 0.1210\ \text{per mg}. $$

The denominator density at 5 is $$ f(5\mid H)=\frac{1}{1.5\sqrt{2\pi}}\exp\left[-\frac{(5-4)^2}{2(1.5^2)}\right] \approx 0.2130\ \text{per mg}. $$

Taking the ratio gives $$ \frac{q(5\mid V)}{f(5\mid H)} = \frac{1.5}{2} \exp\left[-\frac{(5-3)^2}{2(2^2)} +\frac{(5-4)^2}{2(1.5^2)}\right] \approx 0.5681. $$

The participant’s visit-specific stabilized weight is about 0.5681. This is a density ratio, not the probability that the participant received a 5 mg dose. Its being below one is valid: some observed doses are more strongly represented by the denominator distribution than by the numerator distribution.

Building the Longitudinal Weight

At multiple visits, calculate a conditional density ratio at each visit and multiply the ratios. Histories matter: the denominator at a later visit is conditional on the covariate and treatment history observed before that visit. The numerator can also depend on baseline covariates and past treatment, as specified by its model. Do not use an unconditional density at a later visit if the stated model is conditional.

Worked Example: Multiplying Two Visit-Specific Ratios

Consider a hypothetical two-visit study in which dose is measured in milligrams. At visit 1, the models and observed dose are those in the preceding calculation: \(q_1\) is normal with mean 3 mg and standard deviation 2 mg, \(f_1\) is normal with mean 4 mg and standard deviation 1.5 mg, and \(A_1=5\) mg. At visit 2, conditional on this participant’s baseline and prior treatment for the numerator and full measured history for the denominator, suppose \(q_2\) is normal with mean 2 mg and standard deviation 1.2 mg, \(f_2\) is normal with mean 1.5 mg and standard deviation 0.8 mg, and \(A_2=2\) mg. Calculate the cumulative stabilized weight.

The first ratio is \(q_1(5)/f_1(5)\approx0.5681\). For visit 2, the normal-density ratio is $$ \frac{q_2(2)}{f_2(2)} = \frac{0.8}{1.2} \exp\left[-\frac{(2-2)^2}{2(1.2^2)} +\frac{(2-1.5)^2}{2(0.8^2)}\right] = \frac{0.8}{1.2}\exp(0.1953) \approx 0.8104. $$

The two-visit weight is the product: $$ SW_2=0.5681\times0.8104\approx0.4604. $$

This participant’s cumulative stabilized treatment weight through visit 2 is about 0.4604. The value is not obtained by averaging the two ratios: the longitudinal likelihood ratio is the product of the visit-specific ratios. Each ratio compares the numerator and denominator densities at the treatment actually observed at that visit.

Why the Density-Ratio Construction Works

The basic justification is a change of conditional treatment distribution. At one visit, fix the measured history \(H_t\), and consider any integrable function \(h\) of the treatment. Under the observed treatment density, the weighted conditional expectation is $$ E\left[ \left. \frac{q_t(A_t\mid V,\bar A_{t-1})}{f_t(A_t\mid H_t)} h(A_t) \right|H_t\right] = \int \frac{q_t(a_t\mid V,\bar A_{t-1})}{f_t(a_t\mid H_t)} h(a_t)f_t(a_t\mid H_t)\, da_t. $$

Where the denominator density is positive, it cancels inside the integral, giving $$ \int h(a_t)q_t(a_t\mid V,\bar A_{t-1})\,da_t. $$

Thus weighting by the density ratio replaces the observed conditional treatment density \(f_t\) with the chosen numerator density \(q_t\) in this conditional calculation. Applying this replacement successively across visits explains the product form of the longitudinal weight. Under consistency, sequential exchangeability, and positivity, this reweighting can support causal estimation under the treatment distributions represented by the numerator models. The algebra alone does not prove those causal assumptions or guarantee correct density models.

The justification also clarifies why a ratio may exceed one: reweighting increases the contribution of treatment values that are relatively more represented under the numerator distribution. Conversely, a ratio below one reduces their contribution. The weights alter representation; they do not change the recorded treatment or outcome for any person.

Checking for Unstable Density Ratios

A ratio can become very large when the numerator density is appreciable but the denominator density is very small at an observed treatment value. This may indicate weak overlap, an overly narrow denominator model, model misspecification, or a genuinely rare treatment conditional on the measured history. Since longitudinal weights multiply visit-specific ratios, even moderately large ratios at several visits can produce a very large cumulative weight.

A useful first check is to compare the conditional distributions implied by numerator and denominator models across the observed histories, paying special attention to tails and differences in spread. A treatment value should not be judged as problematic merely because its density is numerically small: what matters for the weight is the ratio of the two densities at that same value. Conversely, a finite ratio is not by itself proof that overlap is adequate. Model diagnostics and weight-distribution summaries are part of a broader analysis.

Worked Example: A Large Ratio in a Tail

Suppose, for one hypothetical history, the numerator density is \(q(a)=N(0,1)\) and the denominator density is \(f(a\mid H)=N(0,0.25^2)\), with treatment measured in a common unit. At the observed value \(A=1\), calculate the ratio and explain why it is large.

The ratio is $$ \frac{q(1)}{f(1\mid H)} = \frac{0.25}{1} \exp\left[-\frac{(1-0)^2}{2(1^2)} +\frac{(1-0)^2}{2(0.25^2)}\right] = 0.25\exp(7.5) \approx 452.0. $$

The numerator distribution has a much wider spread than the denominator. A value one unit above the mean is plausible under the numerator but lies far into the tail of the narrow denominator distribution, so the ratio is large. For comparison, at \(A=0\) the ratio is \(0.25\), since both exponential terms equal one and the ratio of the density constants is 0.25. The sharp change across treatment values illustrates why one should inspect ratios over the support, not infer stability from a single central observation.

A large ratio is a warning to investigate the conditional density models and overlap; it is not an automatic instruction to alter the estimate. Any remedial choice changes the analysis and its interpretation and requires explicit justification.

Common Mistakes

  • Treating a density as a point probability. The probability of exactly 5 mg is zero for a continuous treatment. The calculation uses density values at 5 mg, or probabilities over intervals obtained by integrating densities.
  • Using a probability-mass formula for a continuous treatment. A normal density includes a standard-deviation factor and an exponential term. The continuous ratio is the ratio of those density values, not the ratio of probabilities assigned to exact doses.
  • Dropping the history from a conditional model. At visit \(t\), the denominator is evaluated using the pre-treatment history \(H_t\), and the numerator is evaluated using its specified conditioning variables. A later-visit ratio cannot generally be calculated from the dose alone.
  • Adding ratios instead of multiplying them. The longitudinal weight is a product across visits because it is a ratio of sequential treatment densities.
  • Calling a finite ratio proof of positivity. A fitted model can return a positive density at every observed value even when the modeled tails or extrapolations are unreliable. Support and model adequacy still require scrutiny.
Key takeaway: For continuous treatments, construct each visit’s weight from conditional density values at the observed dose, then multiply those ratios across visits. The numerator and denominator models, their conditioning histories, and their overlap determine whether the resulting weights are interpretable and stable.

Check Your Understanding

Answer each question by referring to the density-ratio definition and the assumptions stated above.

  1. Why is a conditional density used instead of the probability of receiving exactly a particular continuous dose?
  2. If the visit-specific ratios are 0.7, 1.4, and 2.0, what is the cumulative three-visit weight, and why are the ratios multiplied?
  3. What history belongs in the denominator density at visit \(t\), and why must the numerator conditioning variables also be stated?
  4. In a normal example, what feature can make a density ratio large even when the numerator density is not unusually high?
  5. Does a positive estimated denominator density at every observed treatment value establish causal positivity? Explain what else is required.
Clinical Biostats