Tutorials › Bayesian Clinical Trials › Beta-Binomial Hierarchies For Binary Basket Outcomes

Hierarchical Models and Basket Trials · Tutorial 456 of 696

Beta-Binomial Hierarchies For Binary Basket Outcomes

Learn how to write and interpret the hierarchical binomial model that allows basket response rates to differ while sharing a common beta distribution.

Advanced 10 min read

What You'll Learn

  • Define basket-level binary outcomes and response counts for a beta-binomial hierarchy.
  • Write the conditional binomial likelihood across baskets with unequal sample sizes.
  • Distinguish basket-specific response probabilities from shared beta hyperparameters.
  • Reparameterize the shared beta distribution using its mean and precision.
  • Check the model assumptions and recognize when the hierarchy may be unsuitable.
  • Compare partial pooling with complete pooling and no pooling.

Why Use a Hierarchy for Basket Outcomes?

In a basket trial, several patient subgroups receive the same treatment, and the primary endpoint may be binary: each patient either responds by a prespecified time or does not. The scientific question may concern each basket’s response rate, while the analysis also recognizes that rates could be related across baskets. A beta-binomial hierarchy expresses that relationship without requiring the rates to be identical.

The model has two levels. At the data level, each basket has a response count given its own response probability. At the population level, the basket-specific probabilities are modeled as draws from a shared beta distribution. This structure is a form of partial pooling: each basket retains its own parameter, while the common distribution links the baskets.

Definition: For \(J\) baskets, let \(n_j\) be the number of evaluable patients and \(Y_j\) the number with a response in basket \(j\), for \(j=1,\ldots,J\). Let \(p_j\) be the basket-specific response probability. The beta-binomial hierarchical model is $$ Y_j\mid p_j\sim\operatorname{Binomial}(n_j,p_j),\qquad p_j\mid a,b\sim\operatorname{Beta}(a,b), $$ with the \(p_j\) independent across baskets conditional on the shared hyperparameters \(a,b\). Here \(a>0\) and \(b>0\) are the shared beta-distribution parameters.

The first line describes how outcomes arise within a basket, conditional on its response probability. The second line describes how the basket probabilities are related: each is modeled as drawn from the same distribution. In this tutorial, \(a\) and \(b\) are treated as specified hyperparameters. They are not basket-specific, whereas \(p_1,\ldots,p_J\) are. A model that assigns prior distributions to \(a\) and \(b\) would add another level and is not needed to write down this hierarchy.

Likelihood and Parameters

The binomial observation model assumes that, within basket \(j\), the \(n_j\) binary outcomes are independent Bernoulli observations with the same response probability \(p_j\). Thus, conditional on \(p_j\), the response count has probability mass function $$ P(Y_j=y_j\mid p_j)=\binom{n_j}{y_j}p_j^{y_j}(1-p_j)^{n_j-y_j},\qquad y_j=0,\ldots,n_j. $$

If basket counts are conditionally independent given their respective probabilities, the likelihood for the observed counts \(y_1,\ldots,y_J\), conditional on the basket probabilities, is

$$ L(p_1,\ldots,p_J\mid y_1,\ldots,y_J) =\prod_{j=1}^{J}\binom{n_j}{y_j}p_j^{y_j}(1-p_j)^{n_j-y_j}. $$

This is the conditional likelihood: its unknown basket-level parameters are \(p_1,\ldots,p_J\). The beta distributions specify the hierarchical model for these parameters. In particular, the joint density for the probabilities under fixed \(a,b\) is

$$ \pi(p_1,\ldots,p_J\mid a,b) =\prod_{j=1}^{J} \frac{p_j^{a-1}(1-p_j)^{b-1}}{B(a,b)},\qquad 0<p_j<1. $$

Here \(B(a,b)\) is the beta function, which normalizes the beta density. The shared hyperparameters \(a,b\) govern the distribution from which the basket probabilities are modeled as draws. The conditional likelihood and this joint density play different roles: the former describes the observed counts given the \(p_j\), while the latter describes the model for the \(p_j\).

How the Likelihood Factorizes

The product form follows directly from the assumptions. Conditional independence across baskets means that the probability of the vector of counts is the product of the basket-specific probabilities. Substituting the binomial mass function for each factor gives the likelihood above:

1
Specify one basket’s count model.
For basket \(j\), the probability of \(y_j\) responses is \(\binom{n_j}{y_j}p_j^{y_j}(1-p_j)^{n_j-y_j}\).
2
Use conditional independence.
Given the basket probabilities, the joint probability of all observed counts is the product of their individual probabilities.
3
Separate parameters from data.
The observed \(n_j\) and \(y_j\) determine the binomial coefficients and exponents; \(p_j\) are the basket-specific unknowns, and \(a,b\) specify their shared distribution.

This factorization does not say that response rates are equal. Rather, the count likelihood uses one \(p_j\) for each basket. Nor does the conditional likelihood by itself include the beta densities. To describe the full hierarchical model, both levels must be stated. Keeping these roles separate prevents a common ambiguity about which expression is the likelihood and which specifies the prior distribution on basket parameters.

Worked Example: Writing the Model for Unequal Basket Sizes

Suppose a hypothetical trial has three baskets. Their evaluable patient counts are \(n_1=10\), \(n_2=8\), and \(n_3=6\), with observed responses \(y_1=6\), \(y_2=4\), and \(y_3=1\). Specify the hierarchical model and its conditional likelihood.

Let \(p_1,p_2,p_3\) denote the three basket response probabilities. With shared hyperparameters \(a,b>0\), the model is $$ Y_1\mid p_1\sim\operatorname{Binomial}(10,p_1),\quad Y_2\mid p_2\sim\operatorname{Binomial}(8,p_2),\quad Y_3\mid p_3\sim\operatorname{Binomial}(6,p_3), $$ and \(p_1,p_2,p_3\mid a,b\) are independent \(\operatorname{Beta}(a,b)\) draws.

The conditional likelihood evaluated at the observed counts is $$ L(p_1,p_2,p_3) =\binom{10}{6}p_1^6(1-p_1)^4 \binom{8}{4}p_2^4(1-p_2)^4 \binom{6}{1}p_3(1-p_3)^5. $$ Since \(\binom{10}{6}=210\), \(\binom{8}{4}=70\), and \(\binom{6}{1}=6\), this is $$ L(p_1,p_2,p_3) =88200\,p_1^6(1-p_1)^4p_2^4(1-p_2)^4p_3(1-p_3)^5. $$ The data supply three basket-specific likelihood factors, not one common response probability. The common feature is the beta distribution for the three probabilities.

Interpreting the Shared Hyperparameters

An equivalent way to specify the beta distribution is through its mean \(m\) and precision \(\kappa\):

$$ m=\frac{a}{a+b},\qquad \kappa=a+b,\qquad a=m\kappa,\qquad b=(1-m)\kappa, $$

where \(0<m<1\) and \(\kappa>0\). Under this parameterization, \(m\) is the mean of the distribution for the basket probabilities, and \(\kappa\) controls its concentration. In particular, the variance of a draw \(p_j\) from this beta distribution is

$$ \operatorname{Var}(p_j\mid a,b)=\frac{m(1-m)}{\kappa+1}. $$

This is variation in the modeled basket probabilities, not the binomial sampling variation in patient responses. The two sources of variation belong to different levels of the hierarchy. For fixed \(m\), a larger \(\kappa\) places the distribution of \(p_j\) more tightly around \(m\); a smaller \(\kappa\) permits a wider range of basket probabilities.

Worked Example: Converting Mean and Precision to Beta Parameters

Suppose a hypothetical model uses a shared beta distribution with mean \(m=0.30\) and precision \(\kappa=10\). Find \(a,b\), and the variance of a basket probability under that distribution.

Using \(a=m\kappa\) and \(b=(1-m)\kappa\), $$ a=0.30(10)=3,\qquad b=(1-0.30)(10)=7. $$ Thus each \(p_j\) is modeled as a \(\operatorname{Beta}(3,7)\) draw, with mean \(3/(3+7)=0.30\). Its variance is $$ \operatorname{Var}(p_j\mid a,b) =\frac{ab}{(a+b)^2(a+b+1)} =\frac{3(7)}{10^2(11)} =\frac{21}{1100} \approx 0.01909. $$ The variance is on the probability scale, so its units are squared response-probability units. The value \(m=0.30\) describes the center of the shared distribution; it does not assert that every basket has response probability exactly 0.30.

Assumptions and Model Checks

The hierarchy is useful only when its assumptions are defensible for the trial and endpoint. Before using it, check that:

  • The endpoint is defined consistently. A response must have the same operational definition, assessment window, and handling of missing outcomes across baskets.
  • The binomial denominator is appropriate. Each \(n_j\) should count the patients whose binary outcomes are included for basket \(j\), with the same response probability applying to those patients in that basket under the model.
  • Within-basket outcomes are conditionally independent. Given \(p_j\), one patient’s response is assumed not to change another patient’s response probability. Important clustering or repeated observations would require a different data model.
  • The baskets are suitably exchangeable under the shared distribution. A common beta distribution assumes that basket probabilities can be treated as draws from the same population distribution. This need not mean that baskets have identical biology, but major systematic differences may make a single shared distribution implausible.
  • Patients and denominators are not silently pooled across baskets. Unequal \(n_j\) are allowed, but each count must remain paired with its own sample size and parameter.

A useful first diagnostic is to display \(y_j/n_j\) alongside \(n_j\) for every basket. Large differences in observed proportions can occur from binomial sampling, especially for small baskets, but extreme or systematic differences may indicate that a common beta distribution is not an adequate description. Also check for inconsistent endpoint ascertainment, influential baskets, and unmodeled design differences. These checks do not prove that the model is true; they help identify reasons to question its assumptions and assess sensitivity to alternative specifications.

Worked Example: Zero Responses in One Basket

Consider hypothetical counts \(y_1=0\), \(y_2=1\), and \(y_3=4\) from baskets of size \(n_1=n_2=n_3=5\). Write the conditional likelihood and explain what the zero count means for model specification.

The basket-specific response probabilities are \(p_1,p_2,p_3\). The conditional likelihood is $$ L(p_1,p_2,p_3) =(1-p_1)^5 \left[5p_2(1-p_2)^4\right] \left[5p_3^4(1-p_3)\right]. $$ The first factor follows from \(\binom{5}{0}p_1^0(1-p_1)^5\); the convention \(p_1^0=1\) gives the factor \((1-p_1)^5\). A basket with zero observed responses is therefore valid under the binomial likelihood and does not require setting its response probability to zero.

For illustration, at \(p_1=p_2=p_3=0.20\), the likelihood is $$ (0.8)^5\left[5(0.2)(0.8)^4\right]\left[5(0.2)^4(0.8)\right] =0.32768(0.4096)(0.0064) \approx 0.00085899. $$ This is the joint probability of these particular counts at those specified parameters. The zero count does not invalidate the hierarchy; it is a reminder that a sample proportion can be at a boundary even when the model parameter is not.

Relation to Pooling Alternatives

The beta-binomial hierarchy sits between two simpler modeling choices. The distinction concerns how the response probabilities are related, not how binary outcomes are defined.

ApproachBasket probabilitiesWhat is shared?Main limitation
Complete poolingOne common probability for all basketsThe response probability itselfCannot represent genuine basket-to-basket differences
No poolingSeparate probabilities with no shared distributionNothing across basketsDoes not use cross-basket structure to stabilize estimation
Beta-binomial hierarchySeparate \(p_j\) values modeled as beta drawsA common distribution with parameters \(a,b\)Depends on the shared-distribution assumption

A common mistake is to say that a shared beta distribution means all baskets have the same response rate. That is not the model: it assigns a separate \(p_j\) to each basket, with a common distribution governing how those probabilities are related. Conversely, this hierarchy is not no pooling, because the probabilities are linked by \(a,b\). The intended interpretation is partial pooling, consistent with the distinction between complete pooling, no pooling, and partial pooling.

A second pitfall is to treat \(a,b\) as if they were additional observed response counts. They are parameters of a distribution for the \(p_j\), not patient-level outcomes. A third is to state only the prior hierarchy and omit the binomial sampling model. Without both levels, the relationship between response counts, basket-specific rates, and shared hyperparameters is incomplete.

Key takeaway: State the beta-binomial hierarchy in two parts: \(Y_j\mid p_j\sim\operatorname{Binomial}(n_j,p_j)\) describes counts conditional on basket-specific probabilities, and \(p_j\mid a,b\sim\operatorname{Beta}(a,b)\) links those probabilities through shared hyperparameters. Keep the conditional likelihood distinct from the distribution assigned to the basket parameters.

Check Your Understanding

For each question, identify the model component requested. Brief solutions follow the questions.

  1. In a basket with 12 evaluable patients and 5 responses, what are \(n_j\) and \(y_j\), and what is the binomial likelihood factor?
  2. In the hierarchy, which quantities vary by basket, and which are shared?
  3. With \(m=0.25\) and \(\kappa=8\), calculate \(a\) and \(b\).
  4. Does a shared \(\operatorname{Beta}(a,b)\) distribution assert that all \(p_j\) are equal? Explain.
  5. Name one assumption that should be checked before using the conditional binomial model.

Solutions. (1) \(n_j=12\) and \(y_j=5\); the factor is \(\binom{12}{5}p_j^5(1-p_j)^7\). (2) The \(p_j\) vary by basket, while \(a,b\) are shared. (3) \(a=m\kappa=0.25(8)=2\), and \(b=(1-m)\kappa=0.75(8)=6\). (4) No. The \(p_j\) are separate draws from the same distribution, so they need not be identical. (5) For example, check whether patient responses within a basket are conditionally independent given \(p_j\), and whether the binary endpoint is defined consistently across baskets.

Clinical Biostats