Tutorials › Bayesian Clinical Trials › Sensitivity Analysis for Residual Confounding in Bayesian Trials

External and Real-World Controls · Tutorial 380 of 696

Sensitivity Analysis for Residual Confounding in Bayesian Trials

Model residual prognostic mismatch as a sensitivity parameter, then calculate how plausible values shift posterior treatment effects and probabilities.

Advanced 12 min read

What You'll Learn

  • Define residual prognostic mismatch on the same scale as the treatment-effect estimate.
  • Derive the posterior distribution conditional on a fixed mismatch value.
  • Calculate how changing the mismatch shifts posterior means and credible intervals.
  • Find sensitivity values at which a posterior conclusion changes.
  • Diagnose scale, sign, and modeling assumptions that can make a sensitivity analysis misleading.

Why Examine Residual Prognostic Differences?

An external control cohort can add useful information when a randomized trial has a small or absent concurrent control arm. Adjustment for measured baseline characteristics does not guarantee that the trial patients and external patients have the same prognosis, however. Unmeasured differences, imperfect measurement, or imperfect adjustment can leave a residual difference in expected control outcomes. A treatment-effect estimate that uses external controls may then partly reflect that mismatch rather than treatment.

Sensitivity analysis makes this concern explicit. Instead of treating the adjusted estimate as unbiased by definition, we specify a range of plausible residual differences and calculate the posterior treatment effect under each value. The exercise does not discover the true residual difference from the observed treatment contrast. It shows how much the conclusion depends on assumptions about that difference.

Definition: Let \(\theta\) be the treatment effect on a specified outcome scale, defined as the trial treatment-group outcome minus the trial control-group outcome after the stated adjustment and standardization. Let \(y\) be the corresponding adjusted estimate when the external controls are used. Define \(\delta\) as the residual contribution of the external-versus-trial control prognosis difference to that estimate, on the same scale. The sensitivity model is \(y=\theta+\delta+\varepsilon\), where \(\varepsilon\) is sampling error. Thus, positive \(\delta\) makes the external-control estimate more positive than the target effect, and the effect corrected for a fixed \(\delta\) is centered around \(y-\delta\).

The sign convention matters. For an outcome where lower values are better, suppose \(\delta>0\) means that, after adjustment, the external controls would have had a lower expected outcome than the trial controls in the absence of treatment. Subtracting those lower external outcomes from trial treatment outcomes tends to make the observed contrast more positive. This is why the model uses \(y=\theta+\delta+\varepsilon\). If a different contrast or outcome coding is used, define the sign of \(\delta\) anew before calculating anything.

Posterior Conditional on a Fixed Sensitivity Value

For a transparent calculation, suppose the adjusted estimate has an approximately normal sampling distribution with known standard error \(s\), and use a normal prior for the treatment effect. Conditional on a specified \(\delta\), assume

$$ y\mid\theta,\delta\sim N(\theta+\delta,s^2), \qquad \theta\sim N(\mu_0,\tau^2). $$

Here \(s^2\) is the sampling variance of \(y\), \(\mu_0\) and \(\tau^2\) are the prior mean and variance for \(\theta\), and \(\delta\) is held fixed in this analysis. The likelihood and prior are normal, so the conditional posterior is normal. Completing the square gives

$$ \theta\mid y,\delta\sim N(m_\delta,V), \qquad V=\left(\frac{1}{\tau^2}+\frac{1}{s^2}\right)^{-1}, \qquad m_\delta=V\left(\frac{\mu_0}{\tau^2}+\frac{y-\delta}{s^2}\right). $$

The conditional posterior variance \(V\) does not depend on \(\delta\) in this model: changing the assumed residual difference shifts the estimate, but supplies no new sampling information. The posterior mean moves linearly with \(\delta\), at rate \(-V/s^2\). This also means the posterior credible interval shifts with the mean while retaining the same width.

Deriving the Adjustment

The adjustment follows directly from the normal likelihood. For fixed \(\delta\), the part of the posterior density that depends on \(\theta\) is proportional to

$$ \exp\left\{-\frac{(\theta-\mu_0)^2}{2\tau^2} -\frac{(y-\delta-\theta)^2}{2s^2}\right\}. $$

Expanding the two squared terms, the coefficient of \(\theta^2\) in the exponent is \(-\tfrac{1}{2}(1/\tau^2+1/s^2)\), and the coefficient of \(\theta\) is \(\mu_0/\tau^2+(y-\delta)/s^2\). Completing the square therefore yields posterior precision \(1/\tau^2+1/s^2\) and posterior mean equal to that precision’s reciprocal times the coefficient of \(\theta\), which are \(V\) and \(m_\delta\) above.

If the prior is centered at zero, \(\mu_0=0\), then \(m_\delta=(V/s^2)(y-\delta)\). In the limiting case of a very diffuse prior, \(\tau^2\) becomes large, \(V\) approaches \(s^2\), and \(m_\delta\) approaches \(y-\delta\). With a more informative prior, the corrected estimate is also shrunk toward the prior mean.

Worked Example: Shifting a Blood-Pressure Effect Estimate

Suppose a hypothetical adjusted trial-minus-external-control estimate for change in systolic blood pressure is \(y=2.4\) mmHg, with standard error \(s=1.5\) mmHg. Positive values mean higher blood pressure in the treatment group. Use the prior \(\theta\sim N(0,10^2)\), and examine fixed residual differences \(\delta=0,\ 1,\) and \(2.5\) mmHg. Assume the normal sampling model is reasonable for this adjusted estimate, the standard error is treated as known, and the prior is independent of the data.

The posterior variance is

$$ V=\left(\frac{1}{100}+\frac{1}{2.25}\right)^{-1} =2.201835\ {\rm mmHg}^2, \qquad \sqrt{V}=1.483858\ {\rm mmHg}. $$

The multiplier on \(y-\delta\) is \(V/s^2=2.201834862/2.25=0.9785933\). Thus \(m_\delta=0.9785933(2.4-\delta)\) mmHg. At \(\delta=0\), the posterior mean is \(2.349\) mmHg; at \(\delta=1\), it is \(1.370\) mmHg; and at \(\delta=2.5\), it is \(-0.09786\) mmHg. The assumed residual difference changes the direction of the posterior mean between the latter two scenarios.

At \(\delta=1\), a 95% equal-tail credible interval is \(m_\delta\pm1.96\sqrt{V}\). Using the unrounded posterior quantities, this is approximately \((-1.538,\ 4.278)\) mmHg. Conditional on this model and \(\delta=1\), the posterior probability that the treatment effect lies in this interval is 0.95. The interval is not a 95% probability statement about a fixed parameter under repeated sampling.

Posterior Probabilities and Sensitivity Thresholds

For a normal posterior, probabilities about clinically meaningful effects can be evaluated at each fixed \(\delta\). For example, if lower blood pressure is beneficial, then

$$ P(\theta<0\mid y,\delta) =\Phi\left(\frac{0-m_\delta}{\sqrt{V}}\right), $$

where \(\Phi\) is the standard normal cumulative distribution function. A threshold analysis solves for the \(\delta\) at which this probability reaches a chosen level. Such a value is not an estimate of the actual residual difference; it identifies the assumption required for a particular posterior conclusion.

Worked Example: Finding the Residual Difference Needed for Strong Evidence of Benefit

Continue the hypothetical blood-pressure example. Define benefit as \(\theta<0\), and ask how large \(\delta\) must be for \(P(\theta<0\mid y,\delta)\) to exceed 0.95. For a normal posterior, the probability exceeds 0.95 exactly when \(m_\delta/\sqrt{V}<-1.64485\). Here \(m_\delta=0.9785933(2.4-\delta)\) mmHg and \(\sqrt{V}=1.483858\) mmHg, so the condition is

$$ 0.9785933(2.4-\delta)<-1.64485(1.483858), \qquad \delta>2.4+\frac{1.64485(1.483858)}{0.9785933} \approx4.894\ {\rm mmHg}. $$

Thus, under this model, a residual difference greater than about 4.894 mmHg is needed for the posterior probability of a lower blood-pressure effect to exceed 0.95. Whether such a difference is clinically plausible must be assessed using subject-matter knowledge and the study context; the calculation itself cannot establish plausibility.

Worked Example: Sensitivity on a Log-Odds Scale

Consider a separate hypothetical binary-outcome analysis. Let \(\theta\) be a treatment effect on the log-odds-ratio scale, with negative values favoring treatment. Suppose \(y=0.30\), \(s=0.20\), and \(\theta\sim N(0,1)\). These assumptions give \(V=(1+25)^{-1}=1/26=0.03846154\), \(\sqrt{V}=0.196116\), and \(V/s^2=25/26=0.9615385\). The log-odds scale is used throughout, so \(\delta\) must also be expressed on that scale.

At \(\delta=0.25\), \(m_\delta=(25/26)(0.30-0.25)=0.04808\). Therefore \(P(\theta<0\mid y,\delta)=\Phi(-0.04808/0.196116)\approx0.403\). At \(\delta=0.45\), \(m_\delta=(25/26)(0.30-0.45)=-0.1442\), giving \(P(\theta<0\mid y,\delta)=\Phi(0.1442/0.196116)\approx0.769\). The posterior probability of benefit changes substantially across these two assumed residual differences. Neither probability is the probability that the assumed \(\delta\) is correct.

Choosing Scenarios and Checking the Analysis

A useful sensitivity analysis chooses values that have an interpretable clinical meaning and are plausible on the outcome scale. The values need not be equally spaced, but should cover the range that decision-makers consider credible, including \(\delta=0\) as the no-residual-difference reference when appropriate. Report the posterior mean, interval, or decision-relevant probability across that range, not only the scenario that gives the most favorable result.

Several checks help identify a misleading analysis:

  • Check the sign. Write out how a higher external-control outcome changes the treatment-minus-control contrast. Confirm that the chosen sign of \(\delta\) produces the stated correction.
  • Check the scale and units. A difference in mmHg cannot be inserted directly into a log-odds model. Transform or define sensitivity values on the effect scale used by the likelihood.
  • Check the uncertainty model. The simple normal calculation assumes an approximately normal estimate and a suitable standard error. If the estimate’s sampling distribution is strongly skewed, bounded, or based on sparse data, the normal likelihood may be a poor approximation.
  • Check for double counting. The sensitivity value should represent residual mismatch after the measured-covariate adjustment used to obtain \(y\), not the entire baseline difference before adjustment.
  • Check the range against the data and context. A range that is implausibly narrow can create false reassurance; an arbitrary extreme range may obscure which assumptions are genuinely relevant.

A fixed-\(\delta\) analysis is conditional: it treats each assumed value as a separate model. If the posterior conclusion changes within a plausible range, the result is sensitive to residual confounding. If it remains stable across a well-justified range, that is evidence of robustness to this particular concern, not proof that confounding is absent.

How This Analysis Differs From Other Approaches

The adjusted estimate at \(\delta=0\) is the usual reference analysis: it assumes no remaining prognostic mismatch after adjustment. The sensitivity analysis retains that estimator and its sampling uncertainty but asks what follows if this assumption is relaxed by specified amounts. Earlier material on outcome regression, weighting, and standardization concerns how to adjust for measured covariates; varying \(\delta\) addresses what those procedures may leave unresolved.

A fixed-value grid is different from assigning a probability distribution to the residual difference. The grid gives conditional posterior results for explicit scenarios and does not average over uncertainty about \(\delta\). A model that assigns \(\delta\) a distribution requires additional assumptions about that distribution and answers a different question. Neither approach can compensate for an unjustified outcome model, poor overlap, or an implausible range of residual differences. The purpose here is narrower: quantify the effect of specified residual prognostic shifts on the treatment-effect inference.

Common Mistakes and Limitations

  • Wrong: “The external controls have a worse prognosis, so I add a positive correction to the effect estimate.” Correction: Start from the defined contrast and derive the sign. Under the convention here, \(\delta\) is the contribution added to \(y\), so the corrected center is based on \(y-\delta\).
  • Wrong: “The posterior probability of benefit at \(\delta=0.45\) tells us the probability that the residual difference is 0.45.” Correction: It is conditional on that fixed value; it does not assign probability to the value itself.
  • Wrong: “A stable result proves the external controls are unbiased.” Correction: Stability applies only to the specified form and range of prognostic mismatch. Other sources of bias may remain.
  • Wrong: “Any chosen \(\delta\) can be used regardless of outcome scale.” Correction: The sensitivity parameter must be expressed on the same scale as the model’s treatment-effect estimate.

The analysis is limited by the chosen model, prior, and scenario range. The normal conjugate calculation is valuable because its shift and uncertainty are easy to inspect, but complex adjusted estimators may require fitting a model directly rather than treating \(y\) as normally distributed with a fixed standard error. A sensitivity analysis clarifies dependence on assumptions; it does not identify residual confounding from the observed data alone.

Check Your Understanding

Use the hypothetical blood-pressure model with \(y=2.4\) mmHg, \(s=1.5\) mmHg, \(\theta\sim N(0,100)\), \(V=2.201835\), and \(V/s^2=0.9785933\). Try each question, then check the solutions.

  1. What is the posterior mean at \(\delta=1.5\) mmHg?
  2. If external controls are expected to have outcomes 0.8 mmHg lower than trial controls after adjustment, what sign of \(\delta\) corresponds to that mismatch under the definition in this tutorial? How does the posterior mean change from the \(\delta=0\) scenario?
  3. At \(\delta=2.5\) mmHg, what is the posterior probability that \(\theta<0\), approximately?
  4. Why would it be invalid to use a 0.8 mmHg sensitivity value directly in the log-odds example?

Solutions. 1. \(m_{1.5}=0.9785933(2.4-1.5)=0.8807\) mmHg. 2. This is \(\delta=+0.8\) mmHg, because the lower expected external-control outcome makes the observed treatment-minus-external contrast more positive. The posterior mean decreases from 2.349 mmHg by \(0.9785933(0.8)=0.7829\) mmHg, to \(1.566\) mmHg. 3. The posterior mean is \(-0.09786\) mmHg, so \(P(\theta<0\mid y,\delta)=\Phi(0.09786/1.483858)\approx\Phi(0.06595)\approx0.526\). 4. The log-odds model uses a log-odds scale, whereas 0.8 mmHg is a difference on a blood-pressure scale; the units and meaning do not match. A log-odds-scale sensitivity value would need to be specified instead.

Clinical Biostats