Bayesian Sample Size Methods
Estimate the unconditional probability that a planned trial will achieve a successful result while accounting for uncertainty in the true treatment effect. This calculator implements the normal-prior assurance framework illustrated in nQuery Bayes.
Bayesian assurance is the unconditional probability of a successful trial after integrating the conditional probability of success over a prior distribution for the unknown treatment effect. In other words, rather than calculating power at one fixed assumed effect, assurance averages power over the plausible effects represented by the prior distribution.
This calculator follows the normal-prior, normal-sampling framework illustrated by nQuery Bayes for an assurance superiority calculation. Let the treatment difference have prior distribution
For two independent groups, the planned sampling variance of the observed difference is
For a one-sided superiority test, the critical value is z1−α and the assurance is
For a two-sided test, the two tails are integrated over the same prior-predictive distribution:
For a one-sided superiority calculation, as the sampling variance approaches zero, the maximum assurance under the specified normal prior is
This quantity is useful when determining whether a requested assurance is attainable under the specified prior. If the target exceeds the maximum achievable assurance, increasing the sample size cannot reach the target without changing the prior assumptions or the success criterion.
Interpretation: Assurance is not the same as conventional power. Power conditions on one particular true effect, whereas assurance incorporates uncertainty about the true effect through the prior distribution. Consequently, assurance depends directly on the prior mean and variance.
The nQuery Bayesian Assurance white paper gives an assurance-superiority example with α = 0.05, a one-sided test, prior mean m = 0.200, prior variance v = 0.060, σ₁ = σ₂ = 0.250, and N = 25 per group. The resulting posterior variance of the difference is τ = 0.005, with assurance A = 0.629 and maximum achievable assurance AMAX = 0.793.
The calculator reproduces these values to the displayed precision: assurance = 62.9% and maximum achievable assurance = 79.3%.
O'Hagan, A., Stevens, J. W., & Campbell, M. J. (2005). Assurance in clinical trial design. Pharmaceutical Statistics, 4(3), 187–201.
Statsols. Bayesian Assurance: Formalizing Sensitivity Analysis for Sample Size. nQuery Bayes white paper. The nQuery documentation describes assurance as averaging power over a prior distribution and provides the worked assurance-superiority example reproduced above.
Statsols. Sample Size for Bayesian Statistics. nQuery Bayes documentation. Describes Bayesian assurance as a method for calculating the true probability of success while accounting for parameter uncertainty.