Tutorials › Bayesian Clinical Trials › Estimating Propensity Scores With External Controls

External and Real-World Controls · Tutorial 368 of 696

Estimating Propensity Scores With External Controls

Learn to define the relevant propensity score, fit and interpret practical models, and recognize when an estimated score may not support a credible comparison.

Advanced 11 min read

What You'll Learn

  • Define a trial-participation score and distinguish it from a treatment-assignment score.
  • Specify the eligible source population and baseline covariates required for a meaningful model.
  • Fit and interpret logistic propensity models, including a simple model with a binary covariate.
  • Recognize how cohort sampling and model specification affect estimated probabilities.
  • Identify warning signs such as separation, poor covariate harmonization, and extreme predictions.
  • Explain what a propensity score does not establish about causal comparability.

Why Estimate a Propensity Score?

An external-control comparison combines patients from different sources: trial participants and people observed in routine care or another data system. Even after eligibility criteria and time zero have been aligned, the groups may differ in their baseline characteristics. A propensity score summarizes, conditional on measured baseline covariates, the probability of belonging to a specified group. It can help describe how comparable the groups are and provide an input to later adjustment methods. It does not itself remove confounding.

The first decision is what probability the model should estimate. In many external-control analyses, the relevant score is the probability of trial participation rather than the probability of receiving a drug. These are not interchangeable. A trial may randomize treatment among its participants, while a nontrial control cohort is assembled from a separate source. The source of the comparison, the treatment definition, and the intended target population must therefore be stated before fitting a model.

Definition: Let \(S=1\) indicate that an eligible person is a trial participant and \(S=0\) indicate that the person is an eligible nontrial control. Let \(X\) denote harmonized baseline covariates measured before the relevant time zero. The trial-participation propensity score is \(e(X)=P(S=1\mid X)\). If instead \(A=1\) denotes receipt of a specified treatment and \(A=0\) its comparator in a defined treatment-choice population, the treatment propensity score is \(g(X)=P(A=1\mid X)\).

The conditioning variables \(X\) must be available and meaningfully comparable in both sources. The earlier material on harmonizing baseline covariates is relevant here: two fields with similar names do not necessarily measure the same quantity, use the same time window, or encode the same categories. The earlier material on selecting confounders also informs which baseline variables belong in the model. A propensity model is not a device for selecting confounders automatically.

Define the Estimand’s Population Before Modeling

A participation score is only well defined relative to a population from which trial and nontrial patients could, conceptually, arise. Specify the eligibility rules, the time zero, the treatment strategies being compared, and how each source contributes patients. A score calculated in a convenience sample can still rank observed patients by their fitted probability of trial membership, but its numerical probabilities need not be the probabilities in the intended source population.

This issue arises when analysts deliberately sample a fixed number of trial participants and external controls. If the sampling fractions differ from the source-population fractions, the fitted model’s intercept generally reflects those sampling fractions. Its covariate associations and ranking may remain informative under appropriate sampling assumptions, but its probabilities should not be called calibrated source-population participation probabilities without correcting for sampling or using appropriate source-population information.

The model also requires a coherent baseline: covariates must be measured before trial participation or treatment assignment as defined for the analysis, not after outcomes or follow-up begin. If coding, measurement windows, or missing-data handling differ by source, the model can learn differences in data capture rather than clinically relevant differences between patients. These problems cannot be repaired simply by adding more predictors.

Logistic Regression as a Practical Model

A common specification is logistic regression. For covariates \(X_1,\ldots,X_p\), write the linear predictor as \(\eta(X)=\beta_0+\beta_1X_1+\cdots+\beta_pX_p\). Then the modeled probability of trial participation is the inverse-logit of that predictor. Continuous covariates may require nonlinear terms, and clinically plausible interactions may be included when justified. Categorical variables require suitable indicator coding and a stated reference category.

$$ \operatorname{logit}\{e(X)\} = \log\left(\frac{e(X)}{1-e(X)}\right) = \beta_0+\sum_{j=1}^{p}\beta_jX_j, \qquad \widehat e(X) = \frac{\exp\{\widehat\eta(X)\}}{1+\exp\{\widehat\eta(X)\}}. $$

For a treatment score, replace \(e(X)\) with \(g(X)\), and model \(A\) rather than \(S\). In a randomized trial with known allocation probability, that randomization probability is known by design; it is not necessary to estimate it as though assignment were observational. A fitted participation score may still be relevant when comparing trial participants with external patients, but it answers a different question.

Worked Example: Calculating a Trial-Participation Score

Suppose a hypothetical fitted model for trial participation uses two binary baseline covariates: severe disease (\(X_1=1\) if present) and prior therapy (\(X_2=1\) if present). The fitted equation is \(\widehat\eta=-1.10+0.70X_1+0.50X_2\). Calculate the score for an eligible patient with severe disease but no prior therapy.

For this patient, \(X_1=1\) and \(X_2=0\), so the linear predictor is \(\widehat\eta=-1.10+(0.70)(1)+(0.50)(0)=-0.40\). Applying the inverse-logit gives

$$ \widehat e(X) = \frac{\exp(-0.40)}{1+\exp(-0.40)} = \frac{0.6703}{1.6703} \approx 0.4013. $$

The model assigns this covariate profile an estimated trial-participation probability of about 0.401, or 40.1%, in the population and sampling scheme represented by the fitted data. This is not the probability that the patient will benefit from treatment, nor is it evidence that trial participation caused an outcome difference.

What the Logistic Fit Estimates

With observed indicators \(S_i\) and covariate vectors \(X_i\), a logistic model treats each \(S_i\) as Bernoulli with probability \(e(X_i)\). Under independent observations and the specified model, its likelihood is the product of the Bernoulli probabilities. The maximum-likelihood estimate chooses coefficients that maximize this likelihood. In a Bayesian fit, the same likelihood can be combined with a stated prior on the coefficients to obtain a posterior distribution; predicted scores can then be summarized across posterior draws rather than treated as known constants.

$$ L(\beta) = \prod_{i=1}^{n} e(X_i)^{S_i}\{1-e(X_i)\}^{1-S_i}, \qquad \ell(\beta) = \sum_{i=1}^{n} \left[ S_i\log e(X_i)+(1-S_i)\log\{1-e(X_i)\} \right]. $$

A short derivation explains the logistic form. A linear predictor can take any real value, whereas a probability must lie strictly between 0 and 1. The odds \(e(X)/(1-e(X))\) are positive; taking their logarithm maps them to the real line. Modeling that log-odds as a linear predictor and solving for the probability gives the inverse-logit formula above. For a single binary covariate, the fitted probabilities in its two groups can be calculated directly from the observed proportions, as in the next example.

Worked Example: A Saturated Model With One Binary Covariate

In a hypothetical eligible source population, consider two strata defined by a binary severity indicator \(X\). Among 100 people with \(X=0\), 20 are trial participants; among 100 with \(X=1\), 40 are trial participants. Assume these counts represent the source population rather than a case-control sample, and fit a logistic model with an intercept and \(X\) only.

The observed participation proportions are \(20/100=0.20\) for \(X=0\) and \(40/100=0.40\) for \(X=1\). With only a binary predictor, the model can reproduce both proportions. The intercept is the log-odds for \(X=0\):

$$ \widehat\beta_0 = \log\left(\frac{0.20}{1-0.20}\right) = \log(0.25) \approx -1.386. $$

The coefficient for \(X\) is the difference between the log-odds for \(X=1\) and \(X=0\):

$$ \widehat\beta_1 = \log\left(\frac{0.40}{0.60}\right)-\widehat\beta_0 = \log(0.6667)-(-1.386) \approx -0.4055+1.386 = 0.9808. $$

Thus the fitted model is \(\operatorname{logit}\{\widehat e(X)\}=-1.386+0.9808X\). For \(X=1\), the linear predictor is \(-1.386+0.9808=-0.4052\), and the inverse-logit is approximately \(0.400\), consistent with the observed 40% participation proportion. The coefficient is a log-odds contrast, not a probability difference: the fitted probability difference here is \(0.40-0.20=0.20\), or 20 percentage points.

Model Checks and Failure Modes

A fitted score is a model-based summary, so inspect the data and model before using it. Check that each covariate has the same definition and reference coding across sources, that covariates are genuinely baseline, and that all included terms can be estimated. Inspect fitted probabilities and their distributions separately by source. These checks can reveal coding errors, unsupported covariate patterns, or a model that nearly predicts source membership perfectly.

Complete or near separation occurs when a covariate pattern, or a combination of predictors, almost perfectly distinguishes trial participants from external controls. Ordinary maximum-likelihood logistic estimates can then become extremely large or fail to converge, and predicted probabilities can be close to 0 or 1. Sparse categories and an excessive number of interactions can create similar instability. Possible responses include checking coding and data provenance, simplifying unsupported terms, combining categories only when scientifically defensible, or using a regularized or Bayesian model with an explicitly justified prior. A prior can stabilize estimation, but does not create information where the sources have no comparable patients.

A score can also be numerically well behaved while the scientific comparison remains weak. Important prognostic or confounding covariates may be unmeasured; observed covariates may be measured with error; or the selected covariates may not capture meaningful differences in care setting or calendar time. Model fit and a plausible score distribution do not establish conditional exchangeability, meaning that the relevant potential outcomes are comparable across groups after conditioning on measured covariates. That assumption requires substantive justification and sensitivity analysis.

Worked Example: Distinguishing Treatment From Participation

Suppose a hypothetical observational treatment-choice population contains patients who either receive a new drug (\(A=1\)) or standard care (\(A=0\)). A fitted treatment-score model is \(\operatorname{logit}\{\widehat g(X)\}=-1.50+0.90X_1+0.40X_2\), where \(X_1\) indicates severe disease and \(X_2\) indicates an older age group. For a patient with both indicators equal to 1, calculate and interpret the score.

The linear predictor is \(\widehat\eta=-1.50+0.90+0.40=-0.20\). Therefore,

$$ \widehat g(X) = \frac{\exp(-0.20)}{1+\exp(-0.20)} = \frac{0.8187}{1.8187} \approx 0.4502. $$

The model estimates a 45.0% probability of receiving the new drug for this covariate profile in the specified treatment-choice population. If the analysis instead contrasts trial participants with nontrial controls, the outcome being modeled may be \(S\), not \(A\). Calling both fitted probabilities “the propensity score” without specifying the indicator obscures what is estimated. If the trial randomized treatment with a known allocation ratio, the randomization probability should be distinguished from this observational treatment score.

Comparing Approaches and Understanding Their Limits

Logistic regression is interpretable and widely available, but it imposes a linear form on the log-odds unless nonlinear terms and interactions are included. Flexible alternatives, such as splines or other prediction algorithms, can represent more complex patterns, but require careful tuning and validation and may be less transparent. No algorithm can compensate for incompatible variable definitions, omitted important covariates, or lack of information in one source. The choice should be guided by the scientific structure, data support, and stability of predictions, not by a single measure of predictive accuracy.

The participation score is not an outcome model: it predicts source membership or treatment assignment, not the clinical endpoint. It is also not an estimated treatment effect. Matching, weighting, and outcome-regression procedures use covariates or scores in different ways; their implementation and diagnostics are separate tasks. In particular, a score model that predicts group membership well is not automatically a good adjustment model. The causal purpose is to support a defensible comparison, not to maximize the ability to identify which source a patient came from.

For Bayesian analyses, coefficient uncertainty can be carried into score predictions. If \(\beta^{(m)}\) is a draw from the coefficient posterior, calculate \(e^{(m)}(X)\) for each draw. The posterior mean score is the average of these transformed draws, rather than necessarily the inverse-logit evaluated at the posterior mean coefficient, because the inverse-logit is nonlinear. This accounts for uncertainty in model coefficients, but it does not resolve uncertainty from unmeasured confounding or model misspecification.

Key takeaway: Define the indicator, eligible population, and baseline covariates before fitting a propensity model. Interpret each fitted score as a conditional probability under the specified data and model, and do not mistake estimation for proof of comparability or causal validity.

Common Mistakes

  • Using the wrong indicator. A model for trial participation does not estimate treatment receipt. State whether the modeled response is \(S\) or \(A\).
  • Interpreting a score as an outcome probability. A participation score concerns source membership, not response, survival, or treatment benefit.
  • Taking probabilities literally after unequal sampling. If trial and external patients were sampled at different rates, the fitted intercept may not represent source-population participation probabilities.
  • Assuming a fitted score proves exchangeability. A model uses measured covariates; it cannot guarantee that all important confounding has been measured or correctly modeled.
  • Treating a large model as automatically safer. Unsupported interactions and sparse categories can produce unstable estimates or separation. Model terms need data support and scientific justification.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. In an external-control comparison, what probability does \(e(X)=P(S=1\mid X)\) represent, and what does it not represent?
  2. A fitted logistic model has \(\widehat\eta=-0.80\) for a patient. Calculate the participation score to three significant figures.
  3. Among patients in a source-population stratum, 30 of 120 are trial participants. What is the fitted participation probability in a saturated model for that stratum? State one condition needed for interpreting it as a source-population probability.
  4. A model predicts trial membership almost perfectly and has very large coefficients. Name a likely fitting problem and one reasonable response.
  5. Why is a known randomized allocation probability in a trial not the same as an estimated trial-participation score?

Solutions. (1) It is the conditional probability of trial participation given the measured baseline covariates in the defined population; it is not an outcome probability or treatment-benefit probability. (2) \(\widehat e=\exp(-0.80)/\{1+\exp(-0.80)\}=0.4493/1.4493\approx0.310\), or 31.0%. (3) The probability is \(30/120=0.250\), or 25.0%; interpreting it as a source-population probability requires that the stratum counts represent the relevant source population rather than distorted sampling fractions. (4) Separation or near separation is likely; check coding and sparse cells, then consider a scientifically justified simpler model or regularization. (5) Randomization probability describes assignment to treatment among trial participants under the trial design, whereas a participation score describes membership in the trial rather than the external-control source.

Clinical Biostats