Bayesian Sample Size Methods
Determines the minimum current-trial sample size for a single-arm binary endpoint when historical data are incorporated through a power prior. The historical likelihood is downweighted by a user-specified borrowing parameter, and the required sample size is the smallest integer achieving the requested Bayesian power.
The power prior incorporates historical observations by raising their likelihood contribution to a discounting parameter a0. For a binary endpoint, the resulting prior remains conjugate when the baseline prior is Beta. This gives a convenient exact calculation of the posterior distribution and of the Bayesian operating characteristics used for sample-size determination.
Let the historical study contain x0 responses among n0 patients. Starting with a Beta(a, b) baseline prior, the historical likelihood is raised to the power a0. The resulting power prior is:
Thus, for the binary endpoint, a0 acts as a fractional information weight on the historical observations. The historical effective sample size contributed by the likelihood is a0n0.
If the new trial enrolls n patients and observes x responses, the posterior distribution is:
The calculator declares success for a particular possible current-trial result when the posterior probability that the response rate exceeds the null value reaches the prespecified Bayesian threshold:
For each candidate current-trial sample size n, the calculator evaluates every possible response count x = 0, …, n. Under the specified alternative response rate p1, the probability of observing each count is:
Bayesian power is the sum of those binomial probabilities for response counts satisfying the posterior-probability decision rule. The reported sample size is the smallest integer n for which this power is at least the requested target.
Increasing a0 does not automatically guarantee a smaller sample size. The effect depends on how the historical response rate relates to the null and alternative assumptions. Historical information that conflicts with the current-trial assumptions can change the operating characteristics in the opposite direction from historical information that supports them.
This implementation is the conjugate single-arm binary-endpoint special case of power-prior Bayesian sample-size determination. It is designed to make the historical-borrowing calculation transparent and reproducible in the browser. More general power-prior designs—including continuous, survival, two-arm, hierarchical, and simulation-based designs—require model-specific likelihoods and operating-characteristic calculations.
Fixed verification inputs: historical events = 18; historical N = 30; a₀ = 0.50; null rate = 0.40; alternative rate = 0.60; one-sided α = 0.05; target power = 0.80; baseline prior = Beta(1,1).
Power-prior parameters: Beta(1 + 0.5×18, 1 + 0.5×12) = Beta(10, 7).
Expected result: required current-trial N = 12.
Achieved power at N = 12: 0.8417877074.
Check at N = 11: power = 0.7534982576, so N = 11 does not meet the 0.80 target.
Ibrahim, J.G., Chen, M.-H., Gwon, Y., & Chen, F. (2015). The power prior: theory and applications. Statistical Science, 30(1), 92–108. The paper develops the power-prior framework for incorporating historical information by discounting its likelihood contribution.
Psioda, M.A. & Ibrahim, J.G. (2019). Bayesian clinical trial design using historical data that inform the treatment effect. Biostatistics, 20(3), 400–415. This paper develops Bayesian sample-size determination using historical data and a partial-borrowing power prior, including calibration of borrowing and Bayesian operating characteristics.
The calculator is also aligned with the Bayesian sample-size / historical-borrowing methodology available in Bayesian sample-size software. The present browser implementation specializes that framework to the analytically tractable Beta-Binomial binary-endpoint case.