Tutorials › Bayesian Clinical Trials › Computing Binary Endpoint Power With Beta-Binomial Updates

Sample Size, Power and Assurance · Tutorial 230 of 696

Computing Binary Endpoint Power With Beta-Binomial Updates

See how beta-binomial updating turns a posterior benefit threshold into a set of successful data outcomes whose sampling probabilities give conditional power.

Advanced 12 min read

What You'll Learn

  • Specify independent binomial models for the treatment and control arms.
  • Update beta analysis priors using observed successes and failures.
  • Calculate a posterior probability that treatment benefit exceeds a clinical margin.
  • Convert the posterior decision rule into a set of count outcomes.
  • Sum binomial probabilities over that set to compute conditional power.
  • Diagnose errors caused by confusing conditional power with prior-averaged assurance.

From a Posterior Decision to Conditional Power

For a binary endpoint, the analysis after a trial can be simple: count the successes in each arm, update beta priors, and assess whether the posterior probability of clinically meaningful benefit is high enough. Planning requires a different calculation. Conditional Bayesian power is the probability, under a specified pair of true event rates, that the planned trial will meet that posterior decision rule. It averages over possible trial data, not over uncertainty about the true rates.

This calculation uses the conditional-power idea from the earlier material on conditional Bayesian power under a fixed treatment effect, but now makes the binary sampling model and beta updates explicit. It also differs from assurance: assurance averages success probability over a design distribution for the true rates, whereas conditional power fixes those rates at a particular scenario.

Definition: Let \(X_T\) and \(X_C\) be the numbers of successes among \(n_T\) treatment participants and \(n_C\) control participants. Under a fixed scenario with true success probabilities \(p_T\) and \(p_C\), conditional Bayesian power is the probability, over repeated trial outcomes generated at those rates, that the specified posterior decision rule declares treatment beneficial.

Model, Update, and Decision Rule

Assume participants have a fully observed binary endpoint, with success defined in advance so that a higher probability is better. Conditional on the fixed rates \(p_T\) and \(p_C\), outcomes are independent within and between arms, and each participant in an arm has the same success probability. Thus

$$ X_T\sim\operatorname{Binomial}(n_T,p_T), \qquad X_C\sim\operatorname{Binomial}(n_C,p_C). $$

For the analysis, assign independent beta priors \(p_T\sim\operatorname{Beta}(a_T,b_T)\) and \(p_C\sim\operatorname{Beta}(a_C,b_C)\), with positive shape parameters. Given observed counts \(x_T,x_C\), beta-binomial conjugacy gives

$$ p_T\mid x_T \sim \operatorname{Beta}(a_T+x_T,\ b_T+n_T-x_T), \qquad p_C\mid x_C \sim \operatorname{Beta}(a_C+x_C,\ b_C+n_C-x_C). $$

Choose a clinical benefit margin \(\delta\geq 0\) and a posterior probability threshold \(\gamma\), usually near 1. For a particular pair of counts, declare treatment beneficial when the posterior probability that the treatment success rate exceeds the control rate by more than \(\delta\) exceeds \(\gamma\). The distinction between “exceeds” and “equals” should be specified in the protocol; here the rule is strictly greater than \(\gamma\).

$$ q(x_T,x_C) = P(p_T-p_C>\delta\mid x_T,x_C), \qquad \text{declare benefit if }q(x_T,x_C)>\gamma. $$

With independent beta posteriors, this probability can be calculated by integrating over the treatment rate:

$$ q(x_T,x_C) = \int_{\delta}^{1} f_T(u\mid x_T)\, F_C(u-\delta\mid x_C)\,du, $$

where \(f_T\) is the treatment posterior density and \(F_C\) is the control posterior cumulative distribution function. The lower limit is \(\delta\) because \(u-\delta\) must be nonnegative; the control CDF is zero below zero. This integral can be evaluated numerically, or by suitable beta-distribution calculations. It is a posterior probability for a given dataset, not the power itself.

Why the Power Calculation Is a Finite Sum

For fixed sample sizes, there are only \(n_T+1\) possible treatment success counts and \(n_C+1\) possible control success counts. Each pair either satisfies the posterior decision rule or does not. The sampling probability of a pair is the product of the two binomial probabilities under the fixed scenario. Summing those probabilities over all pairs that pass the rule gives the exact conditional power:

$$ \operatorname{Power}(p_T,p_C) = \sum_{x_T=0}^{n_T}\sum_{x_C=0}^{n_C} I\{q(x_T,x_C)>\gamma\} \binom{n_T}{x_T}p_T^{x_T}(1-p_T)^{n_T-x_T} \binom{n_C}{x_C}p_C^{x_C}(1-p_C)^{n_C-x_C}. $$

Here \(I\{\cdot\}\) is 1 when the condition holds and 0 otherwise. The expression follows by partitioning trial outcomes into their mutually exclusive count pairs: the probability of decision success is the sum of the probabilities of precisely those pairs that trigger the decision. The product form requires independent arm outcomes under the specified model. If the design induces dependence, or the analysis rule includes additional features such as a shared nuisance parameter, the joint sampling probabilities or decision calculation must reflect them.

Worked Example: A Strict Posterior Threshold With Uniform Priors

Suppose each arm has \(n_T=n_C=2\) participants. Use independent \(\operatorname{Beta}(1,1)\) analysis priors, set \(\delta=0\), and declare benefit if \(P(p_T>p_C\mid x_T,x_C)>0.90\). Calculate conditional power at the hypothetical scenario \(p_T=0.80,\ p_C=0.20\).

For the count pair \((x_T,x_C)=(2,0)\), the posteriors are \(\operatorname{Beta}(3,1)\) and \(\operatorname{Beta}(1,3)\). The treatment posterior density is \(3u^2\), and the control posterior CDF is \(1-(1-u)^3\). Therefore

$$ P(p_T>p_C\mid 2,0) = \int_0^1 3u^2[1-(1-u)^3]\,du = 1-3\int_0^1u^2(1-u)^3\,du = 1-3\left(\frac{1}{60}\right) = 0.9500. $$

This pair passes the threshold. The other count pairs have posterior probabilities no greater than \(0.80\): for example, \((1,0)\) and \((2,1)\) each give \(0.80\), while equal counts give \(0.50\). Thus only \((2,0)\) triggers the decision.

Under the scenario rates, the probability of two treatment successes is \(0.80^2=0.64\), and the probability of zero control successes is \((1-0.20)^2=0.64\). Hence

$$ \operatorname{Power}(0.80,0.20) = P(X_T=2)P(X_C=0) = 0.64(0.64) = 0.4096. $$

The conditional power is 40.96%. This is the repeated-trial probability of crossing the stated posterior threshold if the two true success rates are 0.80 and 0.20; it is not the posterior probability that the treatment works.

Worked Example: Summing Several Passing Outcomes

Keep two participants per arm and independent \(\operatorname{Beta}(1,1)\) analysis priors, but use \(\delta=0\) and \(\gamma=0.75\). Find conditional power at the hypothetical scenario \(p_T=0.60,\ p_C=0.30\).

The relevant posterior probabilities are \(P(p_T>p_C\mid 1,0)=0.80\), \(P(p_T>p_C\mid 2,0)=0.95\), and \(P(p_T>p_C\mid 2,1)=0.80\). They exceed 0.75. The other count pairs do not: equal counts give 0.50, and the reverse-ordered pairs have posterior probabilities below 0.50. The decision region is therefore \((1,0),(2,0),(2,1)\).

The treatment count probabilities for \(x_T=1,2\) are

$$ P(X_T=1)=\binom{2}{1}(0.60)(0.40)=0.48,\qquad P(X_T=2)=(0.60)^2=0.36. $$

For control, \(P(X_C=0)=0.70^2=0.49\) and \(P(X_C=1)=2(0.30)(0.70)=0.42\). Summing the probabilities of the three passing pairs gives

$$ \operatorname{Power}(0.60,0.30) = (0.48)(0.49)+(0.36)(0.49)+(0.36)(0.42) = 0.2352+0.1764+0.1512 = 0.5628. $$

Conditional power is 56.28% at these scenario rates. Counting only the most favorable pair \((2,0)\) would give \(0.36(0.49)=0.1764\), substantially understating power because two additional outcomes also satisfy the rule.

Worked Example: A Positive Clinical Benefit Margin

Take one participant per arm, independent \(\operatorname{Beta}(1,1)\) analysis priors, a benefit margin \(\delta=0.20\), and a threshold \(\gamma=0.65\). Calculate power at the hypothetical scenario \(p_T=0.70,\ p_C=0.20\).

Only the count pair \((1,0)\) can pass. Its posteriors are \(p_T\mid 1\sim\operatorname{Beta}(2,1)\) and \(p_C\mid 0\sim\operatorname{Beta}(1,2)\). Their density and CDF are \(2u\) and \(F_C(v)=2v-v^2\) for \(0\leq v\leq1\). Thus

$$ q(1,0) = \int_{0.20}^{1}2u\{2(u-0.20)-(u-0.20)^2\}\,du = 0.6656. $$

This exceeds 0.65. For \((1,1)\) and \((0,0)\), the two posterior distributions are identical within each pair, so the probability that their difference exceeds a positive margin is less than 0.50. For \((0,1)\), even the probability of \(p_T>p_C\) is only \(1/6\), so the probability of exceeding 0.20 is smaller still. Neither pair can meet the threshold.

The probability of the sole passing pair under the scenario is

$$ \operatorname{Power}(0.70,0.20) = P(X_T=1)P(X_C=0) = (0.70)(1-0.20) = 0.5600. $$

The trial therefore has 56.00% conditional power for this rule and scenario. The margin changes the posterior event being evaluated; it is not a subtraction from the observed treatment-control difference after the trial.

Implementation, Diagnostics, and Alternatives

For a design with moderate sample sizes, a direct calculation is usually straightforward: enumerate all possible count pairs, compute the posterior probability for each, mark those that pass the rule, then sum their scenario sampling probabilities. For larger designs, the decision region can still be enumerated; numerical integration may be needed for posterior probabilities. A simulation can approximate the sum by repeatedly generating trial counts under the scenario and applying the same posterior rule, but it introduces Monte Carlo error. Exact enumeration is preferable when it is computationally feasible.

Check the calculation at several points. Posterior parameters must include the observed successes and failures in the correct arm. Each arm’s binomial probabilities should sum to one, and the total probability over all count pairs should also equal one. Confirm that the decision region uses the intended inequality, benefit direction, margin, and threshold. A useful unit test is a scenario where treatment and control are identical: the resulting decision probability should be consistent with the rule, priors, and sample sizes, not automatically assumed to equal a particular nominal level.

The main alternative is simulation-based operating-characteristic estimation. Simulation is flexible when the design includes features that make enumeration cumbersome, but its estimate has sampling variability and can be unstable when decision success is rare. Analytic or numerical enumeration computes the finite sum directly and avoids that Monte Carlo error. Neither approach changes the estimand: for conditional power, the true rates are fixed at the scenario values. Averaging the result over a distribution of rates instead answers an assurance question.

The calculation depends on the model and decision rule being appropriate for the planned trial. Unequal follow-up, missing outcomes, clustering, noncompliance, or varying participant risks may invalidate the simple independent-binomial sampling model unless explicitly incorporated. The posterior decision can also be sensitive to the analysis priors, especially for small samples. Recompute power under reasonable prior choices and clinically relevant rate scenarios rather than treating one result as universal. Finally, conditional power at a single scenario does not summarize performance across all plausible scenarios; scenario-based operating-characteristic assessment is needed for that purpose.

Common Pitfalls

  • Confusing posterior probability with power. A posterior probability such as 0.95 is evaluated for one realized dataset. Power is the probability, across repeated datasets at fixed true rates, that the posterior rule is met.
  • Using the analysis prior as the distribution of true rates. The beta analysis priors update the observed data. They do not define the fixed scenario in a conditional-power calculation.
  • Counting only a single “ideal” outcome. Every count pair that passes the decision rule contributes its sampling probability.
  • Ignoring the clinical margin. A rule about \(p_T-p_C>\delta\) is not the same as a rule about \(p_T>p_C\) when \(\delta>0\).
  • Reporting a scenario result as overall assurance. A conditional result applies to the stated \(p_T,p_C\); it is not averaged across uncertainty in those rates.
Key takeaway: Compute the posterior success probability for every possible count pair, identify which pairs satisfy the decision threshold, and sum their binomial sampling probabilities under the fixed scenario. That finite sum is conditional Bayesian power.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. With \(n_T=n_C=1\), independent \(\operatorname{Beta}(1,1)\) analysis priors, \(\delta=0\), and a threshold of 0.80, which count pair triggers the decision?
  2. For the setup in Question 1, calculate conditional power at \(p_T=0.60,\ p_C=0.25\).
  3. Explain why a conditional-power calculation does not average over the beta analysis priors.
  4. Suppose several count pairs pass the posterior rule. What must be summed to obtain conditional power?

Solutions. (1) The posterior for \((1,0)\) is \(\operatorname{Beta}(2,1)\) versus \(\operatorname{Beta}(1,2)\), giving \(P(p_T>p_C\mid1,0)=5/6=0.8333\), which passes. Equal-count pairs give 0.50, and \((0,1)\) gives \(1/6\), so only \((1,0)\) triggers. (2) The sole passing pair has probability \(p_T(1-p_C)=(0.60)(0.75)=0.4500\). (3) The true rates are fixed at the stated scenario values; the beta distributions are analysis priors used to form posterior decisions after each possible dataset. (4) Sum the joint sampling probabilities of all passing count pairs under the fixed true rates, using the product of the arm-specific binomial probabilities when the arms are independent.

Clinical Biostats