From a Decision Rule to a Sample Size
For a binary endpoint, a trial's final data are event counts in the treatment and control arms. A Bayesian decision rule might declare success when the posterior probability that the treatment event rate exceeds the control event rate is at least 0.90. Sample size calculation then asks: if the true event rates were specified in advance, how often would the trial's possible data meet that rule?
This is conditional Bayesian power: the probability of meeting a Bayesian success rule conditional on fixed assumed true event rates. The posterior probability in the rule is computed from the analysis model and observed data; the power calculation averages the resulting decision over data generated at the assumed rates. Keeping those two probability calculations distinct is essential.
The calculation below uses a deliberately small design so every possible outcome can be checked by hand. The same enumeration applies to larger candidate sizes, though software is then more practical.
Model, Prior, and Success Rule
Let \(K_T\) and \(K_C\) denote the numbers of participants with the event among \(n_T\) treatment participants and \(n_C\) control participants. Assume independent binomial sampling:
For this worked design, assume outcomes are independent within and between arms conditional on the event rates, every randomized participant contributes a binary outcome, and the arm sizes are fixed. Use independent uniform analysis priors, \(p_T\sim\operatorname{Beta}(1,1)\) and \(p_C\sim\operatorname{Beta}(1,1)\). These are modeling choices, not consequences of the data. The data likelihood in each arm is binomial, and conjugate updating gives
The chosen final decision is success if \(P(p_T>p_C\mid K_T=k_T,K_C=k_C)\geq 0.90\). The posterior probability is calculated using the independent arm posteriors. A count pair that falls short of 0.90 is not a success under this rule, even if its posterior probability seems large in isolation.
Worked Example: Checking the Posterior Decision Boundary
Consider two participants per arm and the outcome pair \(k_T=2,k_C=1\). The posterior distributions are \(p_T\mid data\sim\operatorname{Beta}(3,1)\) and \(p_C\mid data\sim\operatorname{Beta}(2,2)\). For \(X\sim\operatorname{Beta}(3,1)\), the density is \(f_X(x)=3x^2\); for \(Y\sim\operatorname{Beta}(2,2)\), the cumulative distribution function is \(F_Y(x)=3x^2-2x^3\). Independence gives
Although all treatment participants had the event and half the control participants did, this pair does not meet the 0.90 posterior threshold. In contrast, for \(k_T=2,k_C=0\), the posterior distributions are \(\operatorname{Beta}(3,1)\) and \(\operatorname{Beta}(1,3)\). Thus
This count pair does meet the rule. The boundary matters: incorrectly treating the first result as 0.900 would add an outcome to the success set and inflate calculated power.
Enumerate Outcomes Before Calculating Power
For two participants in each arm, each count can be 0, 1, or 2. The table gives the posterior superiority probability for every possible pair under the specified priors. Rows are treatment event counts; columns are control event counts.
| Treatment events \(k_T\) | Control 0 | Control 1 | Control 2 |
|---|---|---|---|
| 0 | 0.500 | 0.200 | 0.050 |
| 1 | 0.800 | 0.500 | 0.200 |
| 2 | 0.950 | 0.800 | 0.500 |
For example, the entry at \((k_T,k_C)=(1,2)\) compares \(\operatorname{Beta}(2,2)\) with \(\operatorname{Beta}(3,1)\). Its probability is
Therefore, the only pair that meets the at-least-0.90 rule is \((k_T,k_C)=(2,0)\). A small table like this is useful both as an audit and as a direct description of the decision rule in terms of observable counts.
Exact Conditional Power
For fixed assumed rates \(p_T^*,p_C^*\), the count probabilities are binomial. If \(\mathcal{S}\) is the set of count pairs meeting the posterior rule, then conditional power is
The product is justified by the assumed independence of arm outcomes given the fixed rates. If arm outcomes are dependent, or the trial design introduces other sources of dependence, this product need not be correct. For the present rule and two-per-arm example, \(\mathcal{S}=\{(2,0)\}\), so the sum has just one term.
Worked Example: Power at Fixed Event Rates
Suppose the fixed rates used for design evaluation are \(p_T^*=0.70\) and \(p_C^*=0.20\), with two participants per arm. Since only \((2,0)\) passes the posterior rule, success requires two treatment events and zero control events. The probability is
The conditional Bayesian power is 0.3136, or 31.36%. For instance, it would be incorrect to include \((2,1)\) in the success set: its posterior superiority probability is 0.800, so that outcome does not satisfy the prespecified decision rule.
Comparing Candidate Sample Sizes
A sample size is selected by applying the same analysis prior and success rule to each candidate design, then comparing its conditional power with a prespecified target. The posterior rule must be reevaluated for each candidate size because the posterior distributions depend on both the counts and the total number observed.
Worked Example: Selecting Between One and Two Participants per Arm
Continue with fixed rates \(p_T^*=0.70\) and \(p_C^*=0.20\), the uniform analysis priors, and the 0.90 posterior threshold. Suppose the target conditional power is 0.30 and candidates use equal arm sizes.
With one participant per arm, the possible count pairs are \((0,0),(0,1),(1,0),(1,1)\). The largest posterior superiority probability occurs for \((1,0)\), where the posteriors are \(\operatorname{Beta}(2,1)\) and \(\operatorname{Beta}(1,2)\). Its probability is
Since even the largest value is below 0.90, no one-per-arm outcome meets the rule; power is zero. With two participants per arm, the previous calculation gives power 0.3136, which exceeds the 0.30 target. Among these two candidates, two participants per arm is therefore the smallest that meets the target. This is a demonstration of the procedure, not a realistic clinical sample size.
Worked Example: Changing the Assumed True Rates
Keep two participants per arm and the same posterior decision rule, but evaluate fixed rates \(p_T^*=0.60\) and \(p_C^*=0.10\). The only successful count pair remains \((2,0)\), because the analysis model and decision rule have not changed. The conditional power is
This is 29.16%, just below the 0.30 target. A design that met the target under the first assumed rates does not meet it under this second scenario. The result illustrates why conditional power is always tied to its stated true-rate assumptions; it is not a single property of the sample size alone.
Practical Calculation, Diagnostics, and Alternatives
For larger \(n_T,n_C\), the same calculation can be implemented by enumerating all \((n_T+1)(n_C+1)\) count pairs. At each pair, update the two Beta posteriors, calculate their posterior superiority probability, mark whether it reaches the threshold, and add the pair's joint binomial probability only when it passes. The earlier material on the Beta-Binomial Predictive Distribution for Power establishes the predictive distribution used in this enumeration; here the fixed true rates supply the binomial data-generating probabilities.
Record the endpoint, fixed arm sizes, analysis priors, decision threshold, and assumed true event rates. Check that the binomial and independence assumptions fit the planned design.
Compute the posterior success probability for each pair and retain precisely those at or above the threshold.
Weight each retained pair by its joint probability under the fixed rates. Check that the probabilities over all possible pairs sum to one.
Repeat for each candidate size, check boundary outcomes and implementation, and assess how conclusions change under plausible design scenarios.
Useful diagnostics include verifying that every posterior parameter is positive, checking that swapping treatment and control counts complements the superiority probability when the priors and sample sizes are symmetric, and checking that all joint outcome probabilities sum to one. Also inspect pairs close to the decision threshold: rounding a posterior probability before classification can change the success set. Compare a software implementation with hand calculations for a small design such as the two-per-arm table above.
Conditional power at fixed rates is not the same as assurance. Assurance averages success probability over uncertainty in the true event rates under a design distribution; the earlier material on Bayesian Power and Assurance distinguishes these operating characteristics. A frequentist power calculation instead evaluates a specified test's rejection probability under assumed parameters. These approaches answer different design questions, so a comparison is meaningful only when the success criteria and assumptions are made explicit.
Exact enumeration is attractive for binary endpoints because the possible data outcomes are finite and their probabilities are available directly. Its limitations are equally important: results can be sensitive to the analysis prior, the posterior threshold, and the fixed rates used for evaluation. The calculation also does not by itself address attrition, nonadherence, multiplicity, interim monitoring, or a more complex randomization scheme. Those features require corresponding changes to the data-generating model and operating-characteristic calculation rather than an unexamined use of the simple binomial formula.
Common Mistakes
- Including a near-threshold outcome. A posterior probability of 0.800 is not success under an at-least-0.90 rule. Apply the stated threshold exactly.
- Confusing posterior probability with power. The former is conditional on observed data; the latter is the probability, under assumed true rates, of observing data that pass the rule.
- Using the wrong outcome probability. If success requires zero control events, its probability is \((1-p_C^*)^{n_C}\), not \(1-(p_C^*)^{n_C}\).
- Reporting a sample size without its assumptions. State the endpoint model, analysis prior, success criterion, target power, and fixed rates alongside the selected size.
Check Your Understanding
Use the independent uniform priors, equal arm sizes where specified, and the rule \(P(p_T>p_C\mid data)\geq0.90\).
- For two participants per arm and \((k_T,k_C)=(1,2)\), what is the posterior superiority probability, and does this pair pass?
- For two participants per arm, list every count pair that meets the success rule.
- At fixed rates \(p_T^*=0.60,p_C^*=0.10\), calculate conditional power for two participants per arm.
- For one participant per arm, why is power zero under this posterior rule, regardless of the fixed true rates?
Solutions. (1) The posteriors are \(\operatorname{Beta}(2,2)\) and \(\operatorname{Beta}(3,1)\), so the probability is \(6\int_0^1(x^4-x^5)\,dx=6(1/5-1/6)=0.200\); it does not pass. (2) Only \((2,0)\) passes: its posterior probability is 0.950, while the next-highest value, for \((2,1)\), is 0.800. (3) Success requires two treatment events and zero control events, giving \(0.60^2(1-0.10)^2=0.36\times0.81=0.2916\), or 29.16%. (4) The largest posterior superiority probability among the four possible pairs is \(5/6\approx0.8333\), for \((1,0)\). Since no pair reaches 0.90, no possible data outcome is successful, so conditional power is zero for any fixed true rates.