← Methods repository
CONCEPTADVANCEDPYTHON · R · SASlast reviewed 2026-10-13 · updated 2026-10-14 · 2 citations

Generalized Propensity Scores for Continuous Exposures

A causal-design approach for a baseline continuous treatment in which the generalized propensity score is the conditional exposure density r(a, X)=f(A=a|X), used with an explicitly defined dose intervention to estimate a marginal dose-response function rather than an associational regression curve.

Causal Inference Methodcausal-inferencegeneralized-propensity-scorecontinuous-treatmentcontinuous-exposuredose-responsepositivitycausal-dose-response
On this page
Methods reference only. Use primary source citations and local policy before applying this in a study protocol, regulatory submission, payer dossier, or clinical decision.
In plain language

A generalized propensity score helps compare patients who received similar-looking but different continuous doses. It can estimate the outcome expected at several supported dose levels after accounting for measured baseline differences, but it cannot make unsupported doses or unmeasured reasons for choosing a dose disappear.

When to use it
—When the goal is a causal contrast between supported baseline dose interventions rather than an adjusted descriptive curve.
—When the treatment is truly continuous and clinically meaningful categories do not exist.
Watch out for
—Requires an exposure-density model and does not solve time-varying dose-selection bias.
—Diagnostics and estimation are more complex than a binary treatment score.

A generalized propensity score (GPS) for a continuous exposure is the conditional density of the observed treatment value A given pre-treatment covariates X. It is not the multinomial generalized propensity score used for three or more categorical treatments. It also is not a single adjusted spline coefficient. The causal target must be stated first: for example, the population mean outcome if every eligible person received a specified baseline exposure quantity, compared with another feasible quantity, over a defined baseline exposure window.

Under consistency, conditional exchangeability for the full continuous treatment, and positivity of the relevant exposure density, the GPS can balance measured X at a specified dose. A common implementation models A|X, estimates r(A,X), models E(Y|A,r), and averages predictions over the eligible cohort on a prespecified grid of supported doses. The output is a marginal dose-response function with uncertainty bands. It does not turn an observed dose-response association into a causal effect when severity, contraindications, preferences, or care access remain unmeasured.

Support is the operational constraint

A density estimate exists mathematically even where the data contain almost no comparable patients. Analysts must show the dose distribution overall and by clinically important X, inspect conditional-density tails, and restrict the dose grid to a region with credible support. Restriction changes the target population or intervention domain and must be reported. Do not quietly extrapolate a spline beyond the observed dose range.

When not to use

Do not use this point-treatment card for dose changes driven by interim response, toxicity, or prior treatment: that is treatment-confounder feedback and needs a longitudinal g-method or a clearly defined sustained strategy. Do not use it to claim an effect of impossible dose assignments (for example, a dose forbidden by renal function) or to repair structural nonpositivity. Modified treatment policies and stochastic interventions can define more feasible continuous-treatment questions, but are outside this card's primary GPS workflow and need their own protocol and identification analysis.

Trade-offs

Compared with a descriptive spline, GPS analysis makes an intervention, confounder set, and support requirement explicit. It requires a correctly specified or suitably flexible exposure-density model and more diagnostics. Compared with categorizing dose into low/medium/high groups, it preserves dose information but can become unstable in sparse tails. A binary or multinomial propensity-score approach remains appropriate only after a clinically justified categorical treatment definition.

Data-source operational depth

  • Claims: strength and quantity dispensed are proxies for intended supply, not ingestion. Convert them to a prespecified baseline dose using a documented denominator; exclude or separately handle overlapping fills, stockpiling, and inpatient supply that claims do not observe.
  • EHR: prescribed, dispensed, administered, and measured concentration are different exposure constructs. Avoid using a dose recorded after response assessment; missed monitoring can make both dose and outcome capture informative.
  • Registry: registry dose fields can be clinically granular, but referral severity and protocol-driven titration can create confounding that a sparse covariate set cannot remove.
  • Linked data: reconcile order, dispensing, administration, lab, and outcome dates before selecting the baseline exposure window. The linked subset can itself be selected relative to the intended target population.

Decision diagram

%%{init: {'themeVariables': {'fontSize': '16px'}, 'flowchart': {'nodeSpacing': 18, 'rankSpacing': 24}}}%%
flowchart TD
  A["Define feasible baseline<br/>continuous-dose intervention"] --> B["Measure exposure A<br/>and pre-exposure covariates X"]
  B --> C["Estimate conditional density<br/>GPS = f(A given X)"]
  C --> D["Assess support and balance<br/>Restrict grid or population<br/>if needed; report the change"]
  D --> E["Fit outcome surface<br/>Predict at each retained dose<br/>Average across the cohort"]
  E --> F["Dose-response curve<br/>with uncertainty<br/>and stated assumptions"]
A baseline continuous-treatment GPS workflow. The support check is a decision gate; a smooth fitted curve does not justify extrapolation beyond observed, clinically feasible dose support.

Worked example

Scenario

A synthetic linked cohort compares 180-day biomarker change under a continuous baseline exposure quantity, using only exposure values inside a prespecified region of conditional support. Baseline severity, renal function, age, and prior therapy are pre-index covariates.

Dataset

Synthetic baseline rows; exposure is fixed at baseline and outcome change is assessed after follow-up.

person_idbaseline_exposure_quantitybaseline_severityegfrageoutcome_change_180d
1010.348.18268-0.5
1020.578.97161-1.0
1030.688.49455-0.8
1041.139.28859-1.2

Steps

1Define the eligible population, baseline exposure window, 180-day outcome window, and candidate exposure grid before viewing outcome estimates.
2Fit an exposure-density model for baseline exposure from pre-index covariates and compute each observed person's conditional density.
3Check exposure distributions and conditional-density tails by baseline eGFR and severity; record a prespecified support decision before removing any unsupported grid point.
4Fit an outcome model conditional on dose and GPS, predict each person's outcome at each supported grid dose, and average those predictions.
5Report the estimated dose-response curve, uncertainty, support restriction, exposure construction, and causal assumptions.

Result

The result is an adjusted 180-day exposure-response function only over the prespecified grid that passes a documented support decision. It is not evidence about exposure changes after follow-up begins.

Trade-offs

Pros of this
—Names a causal intervention, measured-confounding assumptions, and continuous-treatment support diagnostics.
Pros of this
—Retains a continuous dose rather than forcing arbitrary categories.

Code example

Execution not verified · inspect inputs and dependencies before use

Runnable synthetic baseline-GPS demonstration with a lognormal conditional exposure density, Hirano-Imbens quadratic outcome surface, conditional-tail diagnostics, and a 200-resample whole-procedure bootstrap. The tail diagnostic is reported, not treated as automatic proof of support.

requires: numpy · scipy
import numpy as np
from scipy.stats import norm
rng = np.random.default_rng(13); n, B = 500, 200
x = rng.normal(size=(n, 2)); mu = 0.35 + .35*x[:, 0] - .20*x[:, 1]
a = np.exp(mu + rng.normal(0, .35, n))
y = 1 + .45*a - .12*a*a + .45*x[:, 0] - .20*x[:, 1] + rng.normal(0, .6, n)
grid = np.quantile(a, [.20, .50, .80])
def curve(a, x, y, grid):
    z = np.column_stack([np.ones(len(a)), x])
    b = np.linalg.lstsq(z, np.log(a), rcond=None)[0]; m = z @ b
    s = np.sqrt(np.sum((np.log(a)-m)**2)/(len(a)-z.shape[1]))
    r = norm.pdf(np.log(a), m, s)/a
    h = np.column_stack([np.ones(len(a)), a, a*a, r, r*r, a*r])
    bh = np.linalg.lstsq(h, y, rcond=None)[0]
    q = []
    for g in grid:
        rg = norm.pdf(np.log(g), m, s)/g
        hg = np.column_stack([np.ones(len(a)), np.repeat(g,len(a)), np.repeat(g*g,len(a)), rg, rg*rg, g*rg])
        q.append([g, np.mean(hg @ bh), np.mean(np.abs((np.log(g)-m)/s)>2)])
    return np.asarray(q)
point = curve(a,x,y,grid)
boot = np.vstack([curve(a[ix],x[ix],y[ix],grid)[:,1] for ix in (rng.integers(0,n,n) for _ in range(B))])
for j, g in enumerate(grid):
    print({"exposure":float(g), "mean_outcome":float(point[j,1]), "bootstrap_95_ci":tuple(np.quantile(boot[:,j],[.025,.975])), "conditional_tail_fraction_abs_z_gt_2":float(point[j,2])})

Citations

FOUNDATIONAL / METHODS
  1. [1]Hirano K, Imbens GW. The propensity score with continuous treatments. In: Applied Bayesian Modeling and Causal Inference from Incomplete-Data Perspectives. 2004;73-84.
  2. [2]Imai K, van Dyk DA. Causal inference with general treatment regimes: Generalizing the propensity score. Journal of the American Statistical Association. 2004;99(467):854-866.