Tutorials › Bayesian Clinical Trials › Bayesian Treatment Effect Estimation After Adjustment

External and Real-World Controls · Tutorial 374 of 696

Bayesian Treatment Effect Estimation After Adjustment

Use a Bayesian outcome model to estimate adjusted treatment contrasts while accounting for coefficient uncertainty and making the assumptions behind external-control comparisons explicit.

Advanced 12 min read

What You'll Learn

  • Specify an outcome model for treated trial participants and external controls.
  • Derive a posterior treatment contrast from an adjusted normal likelihood and prior.
  • Propagate uncertainty and covariance in model coefficients into conditional contrasts.
  • Recognize when treatment effects and source differences cannot be distinguished.
  • Check model fit, covariate support, and sensitivity to prior and source-bias assumptions.

Why Bayesian Adjustment Needs an Explicit Model

An external-control comparison can adjust for measured differences between treated trial participants and patients observed in routine care. Bayesian estimation then represents uncertainty about the adjusted contrast with a posterior distribution. This is not a device for making external controls randomized: causal interpretation still depends on whether the measured covariates and the outcome model adequately account for differences between the sources.

Here the target is a treatment contrast conditional on specified covariates, or a common treatment coefficient when the model assumes the contrast is constant across covariate values. The treatment contrast is not automatically an average over the trial population. Defining and estimating such a population-average effect is a separate step. The adjustment methods studied earlier, including outcome regression and doubly robust estimation, motivate the covariates and comparisons; the Bayesian task here is to model uncertainty in the adjusted outcome contrast.

Definition: A Bayesian adjusted treatment contrast is a posterior distribution for a contrast in expected outcomes under treatment and control, conditional on a specified outcome model, prior distributions, observed data, and identifying assumptions. A credible interval summarizes uncertainty about that contrast under the specified model and prior.

Outcome Model and Identification Assumptions

For a continuous endpoint, a basic model is

$$ Y_i \mid A_i,X_i,\beta,\sigma^2 \sim N\!\left(\beta_0+\tau A_i+\beta_X^\top X_i,\sigma^2\right), $$

where \(Y_i\) is the endpoint for patient \(i\), \(A_i=1\) denotes trial treatment and \(A_i=0\) denotes external control, \(X_i\) is a vector of measured covariates, \(\tau\) is the treatment contrast, and \(\beta_X\) contains covariate coefficients. With this additive model, the conditional mean difference is \(\tau\) at every \(X_i\). The normal likelihood is a working model for the endpoint; the chosen covariate terms and distribution must be suitable for the data and estimand.

A Bayesian analysis assigns a joint prior to the model parameters, for example \(\beta\sim N(b_0,V_0)\), with a prior for \(\sigma^2\) if it is unknown. The posterior is proportional to the likelihood multiplied by the prior. Its treatment-contrast summary must reflect uncertainty in all parameters relevant to the contrast, not merely uncertainty in a point prediction.

The causal interpretation requires more than a well-computed posterior. In particular, it requires consistency of treatment and endpoint definitions across sources, adequate measurement of confounders, conditional exchangeability of treatment and potential outcomes given the modeled covariates, and sufficient covariate support for the comparison. It also requires that the outcome model be adequate for the conditional means being compared. These are substantive assumptions, not consequences of Bayesian computation.

A crucial identification issue arises when the data contain only treated trial participants and external controls. In that design, treatment status and data source are perfectly aligned: every treated patient is from the trial and every control is external. An unrestricted trial-versus-external source effect cannot be estimated separately from the treatment effect. Omitting a source effect therefore amounts to assuming that, conditional on modeled covariates, there is no remaining source difference relevant to the outcome. A prior cannot by itself resolve this lack of information; any posterior separation then depends on constraints or assumptions.

Posterior Calculation and Uncertainty

A useful derivation is available when an adjusted model yields an approximately normal likelihood summary \(d\) for the treatment contrast, with known standard error \(s\). Write that likelihood as \(d\mid\tau\sim N(\tau,s^2)\), and assign \(\tau\sim N(m_0,v_0)\). Multiplying the normal likelihood and prior gives a normal posterior. Completing the square in the exponent gives its variance and mean:

$$ v_n=\left(\frac{1}{s^2}+\frac{1}{v_0}\right)^{-1}, \qquad m_n=v_n\left(\frac{d}{s^2}+\frac{m_0}{v_0}\right), \qquad \tau\mid d\sim N(m_n,v_n). $$

The likelihood summary must come from the adjusted outcome model, not from an unadjusted comparison. This expression also assumes that the likelihood standard error is appropriately estimated and treats it as known. In a full regression with uncertain residual variance, the posterior can instead be sampled jointly over coefficients and variance parameters; the contrast is calculated at each draw and summarized across draws.

For a general linear model with known \(\sigma^2\), design matrix \(Z\), and prior \(\beta\sim N(b_0,V_0)\), the posterior covariance and mean are

$$ V_n=\left(V_0^{-1}+\frac{Z^\top Z}{\sigma^2}\right)^{-1}, \qquad b_n=V_n\left(V_0^{-1}b_0+\frac{Z^\top Y}{\sigma^2}\right). $$

If the desired conditional contrast is \(c^\top\beta\), then its posterior mean is \(c^\top b_n\) and its variance is \(c^\top V_n c\). The covariance terms in \(V_n\) matter: coefficients in a contrast may be correlated in the posterior. Discarding those terms can give an incorrect interval.

Worked Example: A Normal Prior for an Adjusted Contrast

Suppose a hypothetical covariate-adjusted outcome model gives an estimated treatment contrast of \(d=4.2\) points with standard error \(s=2.0\) points. For illustration, treat the adjusted likelihood as normal with known standard error, and use the prior \(\tau\sim N(0,4^2)\) points. This calculation assumes the adjustment model and cross-source comparability assumptions are adequate.

The posterior variance and mean are

$$ v_n=\left(\frac{1}{2.0^2}+\frac{1}{4^2}\right)^{-1} =(0.25+0.0625)^{-1}=3.2, $$
$$ m_n=3.2\left(\frac{4.2}{4.0}+\frac{0}{16}\right) =3.2(1.05)=3.36\text{ points}. $$

Thus \(\tau\mid d\sim N(3.36,3.2)\), where the second normal parameter is the variance. The posterior standard deviation is \(\sqrt{3.2}=1.789\) points. A 95% equal-tail credible interval is approximately \(3.36\pm1.96(1.789)\), or \((-0.146,6.87)\) points. Under this model and prior, the posterior probability that the contrast is positive is \(P(\tau>0\mid d)=\Phi(3.36/1.789)\approx0.970\). This is a posterior probability conditional on the assumptions; it is not the probability that those assumptions are true.

Contrasts With Interactions and Covariance

If the model includes treatment-by-covariate interactions, the contrast varies with covariates. For example, with a binary severity measure \(X\), a model can include \(\beta_A A+\beta_{AX}AX\). At severity \(x\), the conditional contrast is \(\tau(x)=\beta_A+x\beta_{AX}\). Its posterior uncertainty must use the joint posterior of both coefficients. This is a conditional contrast at a stated covariate value, not a population-standardized effect.

Worked Example: Including Posterior Covariance

Suppose a hypothetical fitted model has posterior means \(E(\beta_A\mid Y)=2.0\) points and \(E(\beta_{AX}\mid Y)=-0.40\) points per severity unit. Suppose its posterior variances are \(0.64\) and \(0.09\), respectively, and its posterior covariance is \(-0.12\). Consider patients with severity \(x=2\).

The conditional contrast has posterior mean

$$ E(\tau(2)\mid Y)=2.0+2(-0.40)=1.20\text{ points}. $$

Its variance includes the covariance term:

$$ \operatorname{Var}(\tau(2)\mid Y) =0.64+2^2(0.09)+2(1)(2)(-0.12) =0.64+0.36-0.48=0.52. $$

The posterior standard deviation is \(\sqrt{0.52}=0.721\) points. A normal-approximation 95% credible interval is \(1.20\pm1.96(0.721)\), or \((-0.213,2.61)\) points. Ignoring covariance would give variance \(1.00\), overstating uncertainty here; a positive covariance could instead make omission understate it.

Allowing for Uncertain Source Discrepancy

A primary outcome model can be sensitive to residual differences between the trial and external cohort. A transparent sensitivity model can represent an additive discrepancy \(\delta\) in the adjusted contrast summary: \(d\mid\tau,\delta\sim N(\tau+\delta,s^2)\). The meaning and sign of \(\delta\) must be stated. Assigning it a prior allows uncertainty about this discrepancy to affect the posterior, but does not prove that the prior covers all relevant bias.

Worked Example: A Prior for Residual Source Discrepancy

Suppose a hypothetical adjusted contrast summary is \(d=4.0\) points with standard error \(s=1.5\) points. Let \(\tau\sim N(0,4^2)\), and independently let \(\delta\sim N(0,1.5^2)\), where \(\delta\) is defined as the additive source discrepancy in \(d=\tau+\delta+\text{sampling error}\). Integrating over \(\delta\) gives \(d\mid\tau\sim N(\tau,1.5^2+1.5^2)\), with variance \(4.5\).

The posterior variance and mean are therefore

$$ v_n=\left(\frac{1}{16}+\frac{1}{4.5}\right)^{-1} =3.5122, \qquad m_n=3.5122\left(\frac{4.0}{4.5}\right)=3.122\text{ points}. $$

The posterior standard deviation is \(\sqrt{3.5122}=1.874\) points, giving an approximate 95% credible interval of \(3.122\pm1.96(1.874)=(-0.551,6.80)\) points. Compared with the no-discrepancy model, this interval is wider because it accounts for another uncertainty source. The result remains conditional on the chosen discrepancy model and prior; a narrowly chosen prior could still understate plausible source bias.

Diagnostics, Alternatives, and Limitations

Before interpreting a posterior contrast, examine whether the model is behaving plausibly. Useful checks include posterior predictive comparisons of observed outcomes with replicated outcomes, residual patterns against fitted values and covariates, influential observations, and sensitivity to reasonable changes in priors and model terms. Check whether treated trial patients have comparable external controls across the covariate patterns that inform the contrast. Sparse or absent support means the estimate relies heavily on model extrapolation, even if the posterior interval is numerically narrow. Posterior computation should also be checked for convergence and adequate sampling when simulation is used.

Bayesian outcome regression differs from propensity-score weighting, which constructs a comparison through weights, and from a frequentist regression analysis, which reports sampling-based uncertainty rather than a posterior distribution. Doubly robust estimators combine outcome and treatment-assignment models for particular robustness properties; Bayesian outcome regression alone does not inherit those properties merely by using a prior. These approaches share the need for credible measured-confounding and overlap assumptions. None can correct unmeasured confounding simply by producing an interval.

A central failure mode is source-treatment confounding: if no trial control observations exist, a source difference can mimic a treatment effect. Another is model misspecification, such as an omitted nonlinear covariate relationship that leaves residual confounding. A common mistake is to say that a precise posterior estimate proves the external controls are comparable. The correction is that precision quantifies uncertainty conditional on the model and prior; it does not quantify unmodeled bias unless that bias is explicitly represented.

Key takeaway: Bayesian adjustment propagates uncertainty in the outcome model into a posterior contrast. The causal meaning of that contrast still rests on comparability, adequate modeling, and support across data sources; posterior computation cannot identify an unrestricted source effect when source and treatment are perfectly aligned.

Check Your Understanding

Answer each question, then compare with the brief solutions below.

  1. With \(d=3\), \(s=2\), and prior \(\tau\sim N(0,4)\), calculate the posterior mean and variance. The prior's second parameter is its variance.
  2. Why can a model with only trial-treated patients and external controls not estimate an unrestricted source effect separately from treatment?
  3. At \(x=1\), let posterior means of \(\beta_A\) and \(\beta_{AX}\) be \(1.5\) and \(0.2\). What is the posterior mean conditional contrast at that covariate value?
  4. What does a 95% posterior credible interval mean, and what does it not establish?

Solutions. (1) \(v_n=(1/4+1/16)^{-1}=3.2\), and \(m_n=3.2(3/4)=2.4\). (2) Treatment status and source are perfectly aligned, so their effects are collinear in the design; separating them requires additional data or an identifying constraint or assumption. (3) The contrast mean is \(1.5+1(0.2)=1.7\) outcome units. (4) Under the specified model, prior, and observed data, the posterior probability that the parameter lies in the interval is 95%; it does not establish model validity, eliminate bias, or show that the external cohort is exchangeable with the trial.

Clinical Biostats