Tutorials › Bayesian Clinical Trials › Worked Example: Two-Arm Binary Adaptation

Adaptive and Platform Designs · Tutorial 569 of 696

Worked Example: Two-Arm Binary Adaptation

Follow binary outcomes through successive cohorts, update each arm’s beta posterior, and translate posterior superiority probabilities into probability-matching allocation rates.

Advanced 11 min read

What You'll Learn

  • Update a beta-binomial posterior from successes and nonresponses within each treatment arm.
  • Calculate the posterior probability that one arm’s response rate exceeds the other’s.
  • Convert posterior superiority probabilities into allocation probabilities for a new cohort.
  • Distinguish the chance of an assignment pattern from posterior probabilities about treatment response rates.
  • Identify assumptions and practical limitations of probability matching in a clinical trial.

From Binary Outcomes to Adaptive Allocation

In a two-arm binary-response trial, each participant has an outcome such as response or nonresponse. At an interim, the observed outcomes inform what is known about each arm’s response probability. Probability matching uses that posterior information to set allocation probabilities for the next cohort: an arm receives a share of assignments equal to its posterior probability of having the higher response probability.

The procedure is a rule for allocating future participants, not a declaration that one treatment is effective or a substitute for a prespecified final analysis. Its calculation is straightforward once the likelihood, prior distributions, and available outcomes are specified. Its interpretation depends on those modeling choices and on the trial’s allocation schedule.

Definition: For arm \(j\), let \(p_j\) be its probability of response and let \(s_j\) and \(f_j\) be its observed numbers of responses and nonresponses. Under a beta-binomial model, \(p_j\sim\operatorname{Beta}(a_{0j},b_{0j})\) initially, and the outcomes in that arm are conditionally independent Bernoulli observations with response probability \(p_j\). The posterior is \(\operatorname{Beta}(a_{0j}+s_j,b_{0j}+f_j)\). With independent priors for the two arms, define \(q_A=P(p_A>p_B\mid\text{observed data})\) and \(q_B=P(p_B>p_A\mid\text{observed data})\). Because continuous beta distributions assign probability zero to a tie, \(q_A+q_B=1\). Probability matching assigns the next participant to A with probability \(q_A\) and to B with probability \(q_B\).

Assumptions and the Posterior Update

The beta-binomial update assumes that each arm has a stable response probability over the outcomes being analyzed, and that outcomes are conditionally independent given the arm-specific probability. The beta prior is proper when both shape parameters are positive. Independent priors imply independent arm-specific posteriors when the likelihood also factors by arm. These assumptions may be questionable if response probabilities change over calendar time, participants differ in relevant ways, or outcomes are correlated.

For one arm, if the prior density is proportional to \(p^{a_0-1}(1-p)^{b_0-1}\), and the data contain \(s\) responses and \(f\) nonresponses, the likelihood is proportional to \(p^s(1-p)^f\). Multiplication gives a posterior density proportional to \(p^{a_0+s-1}(1-p)^{b_0+f-1}\), which is the beta density with updated shape parameters. The number of participants in that arm is \(s+f\); the response count and nonresponse count must both be included.

$$ p\mid\text{data}\sim\operatorname{Beta}(a_0+s,b_0+f), \qquad E(p\mid\text{data})=\frac{a_0+s}{a_0+b_0+s+f}. $$

Worked Example: Updating One Arm Across Three Cohorts

Suppose arm A has a \(\operatorname{Beta}(1,1)\) prior. In a hypothetical trial, its first cohort contributes one response. A second cohort contributes three responses and two nonresponses. A third cohort contributes four responses and two nonresponses. Calculate the posterior for \(p_A\).

The total number of responses is \(1+3+4=8\). The total number of nonresponses is \(0+2+2=4\). Thus the posterior is

$$ p_A\mid\text{data}\sim\operatorname{Beta}(1+8,1+4) =\operatorname{Beta}(9,5). $$

The posterior mean response probability is \(9/(9+5)=9/14\approx0.6429\). This is a posterior mean under the stated model, not a guarantee that the response probability equals 0.6429. In particular, both the three responses in the second cohort and all four responses in the third cohort contribute to the total of eight.

Calculating the Probability That an Arm Is Best

The key quantity for probability matching is a posterior probability comparing the two unknown response probabilities. It is not the probability that a particular participant will respond. For independent posteriors, it can be calculated by integrating the density of one arm against the cumulative distribution function of the other:

$$ q_A =P(p_A>p_B\mid\text{data}) =\int_0^1 f_A(x)F_B(x)\,dx, \qquad q_B=1-q_A. $$

Here \(f_A\) is the posterior density of \(p_A\), and \(F_B(x)\) is the posterior probability that \(p_B\leq x\). The expression follows by conditioning on \(p_A=x\): for that value, the probability that A is better is \(P(p_B<x)=F_B(x)\). Averaging over the posterior distribution of \(p_A\) gives the integral. In practice, this probability can be computed by numerical integration or posterior simulation; whichever method is used, its accuracy should be checked when the result will materially affect allocation.

Worked Example: A Simple Posterior Superiority Calculation

Suppose the current independent posteriors are \(p_A\sim\operatorname{Beta}(2,1)\) and \(p_B\sim\operatorname{Beta}(1,2)\). The density of \(p_A\) is \(2x\), and the cumulative distribution function of \(p_B\) is \(F_B(x)=1-(1-x)^2=2x-x^2\). Therefore,

$$ \begin{aligned} q_A &=\int_0^1 2x(2x-x^2)\,dx\\ &=\int_0^1 (4x^2-2x^3)\,dx\\ &=\frac{4}{3}-\frac{1}{2} =\frac{5}{6}\approx0.8333. \end{aligned} $$

The complementary probability is \(q_B=1/6\approx0.1667\). If the next participant is assigned using probability matching, A receives that participant with probability 0.8333 and B with probability 0.1667. This does not mean there is an 83.33% chance that a participant assigned to A will respond; it is the posterior probability, given these data and priors, that A’s response probability exceeds B’s.

Following Allocation and Updating Through Cohorts

In a cohort-based design, a common implementation calculates allocation probabilities at an interim and holds them fixed while the next cohort is assigned. The allocation probability is then recalculated after that cohort’s outcomes are available. To compute the probability of a particular assignment pattern, assume that assignments within the cohort are independent draws using the current probabilities. If the probabilities are recalculated participant by participant instead, the probability of a sequence must account for the changing probabilities.

Worked Example: Two Successive Cohorts and Probability Matching

Consider a hypothetical trial with independent \(\operatorname{Beta}(1,1)\) priors for A and B. In an initial cohort, one participant is assigned to each arm. A responds and B does not. Calculate the allocation probabilities for the next cohort, then update after that cohort.

After the initial cohort, the posteriors are \(p_A\sim\operatorname{Beta}(2,1)\) and \(p_B\sim\operatorname{Beta}(1,2)\). As calculated above, \(q_A=5/6\) and \(q_B=1/6\). Suppose the next cohort has six participants and the observed allocation is four to A and two to B. The probability of this allocation count, conditional on the current probabilities and independent assignments, is

$$ \binom{6}{4}\left(\frac{5}{6}\right)^4 \left(\frac{1}{6}\right)^2 =\frac{9375}{46656} \approx0.2009. $$

Suppose three of the four participants assigned to A respond, while one of the two assigned to B responds. Across the initial and subsequent cohorts, A has four responses and one nonresponse, and B has one response and two nonresponses. The updated posteriors are therefore

$$ p_A\mid\text{data}\sim\operatorname{Beta}(5,2), \qquad p_B\mid\text{data}\sim\operatorname{Beta}(2,3). $$

For these posteriors, \(f_A(x)=30x^4(1-x)\) and \(F_B(x)=6x^2-8x^3+3x^4\). Substituting into the comparison integral gives

$$ \begin{aligned} q_A &=30\int_0^1 x^4(1-x)(6x^2-8x^3+3x^4)\,dx\\ &=30\left(\frac{6}{7}-\frac{14}{8} +\frac{11}{9}-\frac{3}{10}\right)\\ &=\frac{37}{42}\approx0.8810. \end{aligned} $$

Thus, for the following cohort, the probability-matching allocation probabilities are \(37/42\approx0.8810\) for A and \(5/42\approx0.1190\) for B. They changed because the new responses and nonresponses changed both posterior distributions. The allocation count from the completed cohort describes what happened; it does not itself determine the next allocation without updating the posteriors.

Assignment Probabilities Are Not Treatment Probabilities

An allocation probability describes the randomization mechanism conditional on the current information. It is distinct from \(p_A\), \(p_B\), and the posterior probability that one arm is better. For example, if the current probability of assigning each participant to A is \(11/12\), then, under independent assignments with that probability held fixed, the chance that all six participants in a cohort are assigned to A is

$$ \left(\frac{11}{12}\right)^6 =\frac{1771561}{2985984} \approx0.5933. $$

This is a probability of an assignment pattern, conditional on the current randomization rule. It is not the probability of six responses or the probability that A is superior. In a probability-matching design, a state giving \(q_A=11/12\) could arise, for example, from \(p_A\sim\operatorname{Beta}(11,1)\) and \(p_B\sim\operatorname{Beta}(1,1)\), since \(P(p_A>p_B)=E(p_A)=11/12\). That calculation depends on the specified posteriors; the value \(11/12\) is not a generic allocation rate.

Diagnostics, Alternatives, and Limitations

Before using a calculated allocation probability, verify the data and model inputs. Check that each participant contributes the appropriate binary outcome, that the response and nonresponse counts sum to the number with observed outcomes, and that the prior parameters are the intended ones. Recalculate posterior shape parameters by arm and check that \(q_A+q_B=1\), up to numerical rounding. If numerical integration or simulation is used, check its precision, especially when one probability is close to zero or one.

Probability matching has a direct alternative in fixed allocation, such as assigning equal numbers to each arm regardless of interim outcomes. Fixed allocation is simpler and does not allow early results to shift enrollment toward a currently favored arm, though it does not adapt to posterior evidence in this way. A deterministic rule assigning everyone to the arm with the larger posterior probability is another contrast: it is more aggressive than probability matching and can leave little concurrent information on the other arm. Probability matching retains some chance of assigning to either arm whenever both superiority probabilities are positive, but that chance can become very small.

The allocation rule also inherits the limitations of the posterior model. A prior can influence the probabilities, particularly with little data. A constant-response-probability model may be misleading if outcomes change over time or if the enrolled participants differ systematically across cohorts. In addition, a probability-matching rule may produce substantial allocation imbalance by chance, or may repeatedly favor an arm on the basis of noisy early outcomes. These concerns should be considered in design and monitoring; the allocation probabilities alone do not establish treatment benefit or replace the planned analysis.

Common pitfall: “A has an 80% probability of being better, so 80% of the next cohort will necessarily receive A.” The correction is that 80% is the assignment probability for each independently randomized participant when the rule is held fixed. The realized cohort fraction is random; for a cohort of five, all five could be assigned to A or none could be, each with nonzero probability.

Check Your Understanding

Use the stated beta-binomial model and assume cohort allocation probabilities are held fixed during assignment unless a question says otherwise.

  1. With a \(\operatorname{Beta}(1,1)\) prior, an arm has six responses and four nonresponses. What is its posterior distribution?
  2. If \(p_A\sim\operatorname{Beta}(2,1)\) and \(p_B\sim\operatorname{Beta}(1,2)\) independently, what are the probability-matching allocation probabilities?
  3. If each of four participants is independently assigned to A with probability \(3/4\), what is the probability that exactly three are assigned to A?
  4. Explain why an allocation probability of 0.9 does not mean that the response probability in that arm is 0.9.

Solutions. (1) The posterior is \(\operatorname{Beta}(1+6,1+4)=\operatorname{Beta}(7,5)\). (2) The posterior superiority probabilities are \(q_A=5/6\) and \(q_B=1/6\), so those are the assignment probabilities. (3) The probability is \(\binom{4}{3}(3/4)^3(1/4)=27/64\approx0.4219\). (4) The 0.9 is the conditional probability of assigning a participant to that arm under the randomization rule. The arm’s response probability is a separate unknown parameter, represented by its posterior distribution.

Clinical Biostats