Planning a Bayesian Noninferiority Trial
A noninferiority design asks whether a new treatment preserves enough of the clinical effect of a comparator to rule out an unacceptable loss. Sample size planning must therefore connect three distinct quantities: the noninferiority margin, the posterior evidence required to declare success, and the chance that the future trial will meet that rule. The last quantity is assurance when it averages over uncertainty in the treatment effect before the trial.
The worked calculations here use a continuous endpoint for which larger values are better. Let \(\theta\) be the treatment effect, defined as the mean outcome under the new treatment minus the mean outcome under control. The margin \(\Delta>0\), in outcome units, is the largest loss considered acceptable. Thus, noninferiority corresponds to \(\theta>-\Delta\). This direction must be stated explicitly: if smaller outcomes are better, the effect and inequality should be oriented accordingly.
This rule is not the same as requiring a high posterior probability that the treatment is exactly as effective as control. It asks whether the effect is above the unacceptable-loss boundary. A treatment can be somewhat less effective than control and still satisfy noninferiority if the posterior evidence supports an effect above \(-\Delta\).
Normal Model and Posterior Decision Boundary
Suppose each arm has \(n\) participants, outcomes are independent and normally distributed with a common known standard deviation \(\sigma\), and there are no unmodelled clustering or other dependencies. Let \(Y=\bar{x}_T-\bar{x}_C\) be the observed difference in sample means. Conditional on the true effect \(\theta\),
The variance \(2\sigma^2/n\) follows because the two independent sample means each have variance \(\sigma^2/n\). For a conjugate prior, assume \(\theta\sim N(m_0,\tau^2)\), with \(\tau^2>0\). Combining this prior with the sampling model gives a normal posterior with variance \(V_n\) and mean \(m_n\):
The posterior probability of noninferiority is therefore a normal tail probability. Write \(\Phi\) for the standard normal cumulative distribution function and \(z_\gamma=\Phi^{-1}(\gamma)\). The decision rule is equivalent to a boundary on the posterior mean:
This equivalence follows because \(\Phi\) is increasing: a posterior tail probability is at least \(\gamma\) exactly when its standardized boundary is at least \(z_\gamma\). It makes the rule operational: for a given sample size, prior, margin, and threshold, one can determine which observed differences would lead to success.
Worked Example: Applying the Posterior Rule
Suppose a trial estimates a treatment effect in units of a symptom score, with larger values better. The prespecified margin is \(\Delta=5\) points and the success threshold is \(\gamma=0.975\). After observing the data, the posterior is \(N(-1,2.25)\): its mean is \(-1\) point and its standard deviation is \(1.5\) points. Calculate the posterior probability of noninferiority and decide whether the rule is met.
The unacceptable-loss boundary is \(-\Delta=-5\) points. Standardizing that boundary under the posterior gives
Since \(0.9962\geq0.975\), the specified Bayesian rule declares noninferiority success. The interpretation is conditional on the model, prior, and observed data: under these assumptions, the posterior probability that the effect exceeds \(-5\) points is about \(99.62\%\). This is not a statement that the probability the null hypothesis is true is \(99.62\%\).
From the Decision Rule to Assurance
The posterior probability is computed after data are observed. Assurance is a design-stage probability that the future data will satisfy the posterior rule. These are different probabilities: posterior probability concerns \(\theta\) conditional on the realised data, whereas assurance concerns future trial results before observing them.
For the normal model above, define \(q=n/(2\sigma^2)\). The posterior mean is a linear function of the observed difference:
Because \(A_n>0\), the trial succeeds exactly when \(Y\) exceeds the following cutoff:
If the true effect is a specified value \(\theta_*\), then \(Y\mid\theta_*\) is normal with mean \(\theta_*\) and standard deviation \(\sqrt{2\sigma^2/n}\). The conditional assurance is consequently
If instead the design averages over the prior distribution for \(\theta\), then the prior predictive distribution of \(Y\) is \(N(m_0,\tau^2+2\sigma^2/n)\). Prior-predictive assurance is
These formulas express two different planning questions. Conditional assurance asks how often the decision rule succeeds at a specified true effect. Prior-predictive assurance averages that probability over the design prior. The chosen interpretation should be reported alongside the calculated sample size.
Worked Example: Sample Size for a Target Conditional Assurance
Assume a continuous endpoint with \(\sigma=10\) points, equal allocation, margin \(\Delta=5\) points, posterior threshold \(\gamma=0.975\), and a true effect \(\theta_*=0\). Use a diffuse-prior approximation, for which the posterior is approximately \(N(Y,2\sigma^2/n)\). Find the smallest integer number per arm giving at least \(80\%\) conditional assurance.
With \(SE=\sqrt{2\sigma^2/n}=\sqrt{200/n}\), the posterior rule becomes \(Y\geq-5+z_{0.975}SE\). Under the assumed true effect, \(Y\sim N(0,SE^2)\), so
To reach \(0.80\), require \(5/SE-z_{0.975}\geq z_{0.80}\). Using \(z_{0.975}=1.960\) and \(z_{0.80}=0.8416\), this gives
Round up to \(n=63\) participants per arm, or 126 in total before any allowance for attrition. At \(n=63\), \(SE=\sqrt{200/63}\approx1.782\), and assurance is \(\Phi(5/1.782-1.960)=\Phi(0.846)\approx0.801\). The target is just exceeded. This calculation is an approximation based on a diffuse prior; a substantive proper prior should be used when it is part of the intended analysis.
Prior Choice Can Change the Required Sample Size
When the prior is not diffuse, sample size cannot generally be chosen by the preceding shortcut. The prior affects both the posterior decision boundary and the distribution used to calculate assurance. A prior centred near an effect that supports noninferiority may increase conditional assurance at that effect; a prior placing substantial probability below the margin can reduce prior-predictive assurance. These effects are consequences of the specified model, not reasons to select a prior merely to obtain a smaller trial.
Worked Example: Assurance With an Informative Prior
Consider an illustrative proper prior \(\theta\sim N(0,16)\), a known outcome standard deviation of \(10\) points, equal allocation, \(\Delta=5\) points, and \(\gamma=0.95\). Evaluate conditional assurance at \(\theta_*=0\) for \(n=32\) participants per arm. The assumptions are the same independent, normal, common-variance model used above.
Here \(q=n/(2\sigma^2)=32/200=0.16\). The posterior variance and the coefficient on \(Y\) are
Because \(m_0=0\), \(B_n=0\), so \(m_n=0.7191Y\). With \(z_{0.95}=1.645\), the posterior-mean boundary is \(-5+1.645\sqrt{4.494}\approx-1.512\). The success cutoff for the observed difference is therefore
Under \(\theta_*=0\), the sampling standard deviation of \(Y\) is \(\sqrt{200/32}=2.5\) points. Thus,
This prior and decision rule give about \(80.0\%\) conditional assurance at a true effect of zero for 32 per arm. That result should not be transferred to other true effects or priors without recalculation. In particular, a prior centred at zero can support noninferiority relative to a \(-5\)-point boundary; it is not neutral about all possible effects.
Practical Design Checks and Alternatives
For a fixed proper prior and analysis rule, a practical design procedure is to compute assurance over candidate integer sample sizes, then choose the smallest size meeting the target. The equations make this direct in the normal model; more complicated models can use simulation. In either case, check that the planning calculation matches the analysis that will actually be used.
- Check direction and units. Confirm that \(\theta\) is defined so that \(\theta>-\Delta\) means noninferiority, and that the margin is on the same scale as the outcome.
- Vary the assumed effect. Conditional assurance can change sharply when \(\theta_*\) approaches the margin. Report a range of clinically plausible values rather than relying on a single favourable scenario.
- Vary prior assumptions. Compare reasonable prior locations and spreads, especially if assurance is prior predictive or the prior materially influences the posterior.
- Check model fit and design features. The simple calculation assumes normal outcomes, known common variance, independent observations, complete data, and equal allocation. Unequal allocation changes the sampling variance to \(\sigma^2(1/n_T+1/n_C)\); clustering, missing outcomes, or uncertain variance require a model that represents those features.
- Verify numerical work. Confirm that the estimated assurance meets the target at the selected size and that the next smaller size does not. In simulation, report Monte Carlo uncertainty and use enough replicates for the decision to be stable.
A frequentist noninferiority design instead plans around a specified test or confidence-interval rule and its repeated-sampling error rates. A Bayesian design plans around a posterior decision rule, but it can and often should also examine frequentist operating characteristics under clinically important true effects. Neither approach removes the need to choose a defensible margin, model, and target effect. The Bayesian calculation is particularly sensitive to the analysis prior when information is limited, and assurance is not a guarantee that a future trial will succeed.
The normal formulas are useful for transparent planning, but their assumptions are substantive. If the final model includes an unknown variance, a binary endpoint, covariate adjustment, noncompliance, or a more complex outcome structure, the posterior probability and assurance may not have these closed forms. Simulate data under the intended design, fit the planned Bayesian model to each simulated trial, apply the exact success rule, and estimate the proportion of trials that succeed. The simulated procedure should reproduce the final analysis as closely as possible.
Check Your Understanding
Answer each question, then compare with the brief solutions below.
- For larger-is-better outcomes, what does a margin of \(\Delta=3\) mean when noninferiority is defined by \(\theta>-\Delta\)?
- A posterior is \(N(-2,1)\) and the margin is \(\Delta=4\). What is the posterior probability of noninferiority?
- Why is conditional assurance at a fixed \(\theta_*\) different from the posterior probability of noninferiority after observing trial data?
- In the equal-allocation normal model, how does the sampling variance of \(Y\) change if each arm has \(n\) participants and \(\sigma\) is doubled?
Solutions. (1) The boundary is \(-3\) outcome units; noninferiority means the new treatment's effect is greater than a loss of 3 units versus control. (2) \(P(\theta>-4\mid\text{data})=\Phi((-2+4)/1)=\Phi(2)\approx0.9772\). (3) The posterior probability conditions on the realised data and describes uncertainty about \(\theta\); conditional assurance is a pre-trial probability over future data at a specified true \(\theta_*\). (4) The variance is \(2\sigma^2/n\), so doubling \(\sigma\) multiplies the variance by four.