Tutorials › Bayesian Clinical Trials › Worked Logistic Basket Analysis With Sparse Responses

Hierarchical Models and Basket Trials · Tutorial 499 of 696

Worked Logistic Basket Analysis With Sparse Responses

Learn to fit and interpret sparse basket-specific response rates using a logistic random-intercept model, including partial pooling, uncertainty, and practical checks.

Advanced 12 min read

What You'll Learn

  • Specify the binomial likelihood and normal random-intercept hierarchy for basket response data.
  • Interpret basket-level intercepts and response probabilities on both log-odds and probability scales.
  • Calculate conditional posterior modes and Laplace uncertainty for baskets with few responses.
  • Explain how partial pooling moderates extreme sparse-data estimates without making basket effects equal.
  • Recognize assumptions, diagnostics, limitations, and alternatives to the logistic hierarchy.

Why a Logistic Basket Model?

In a basket trial, each subgroup may contribute only a small number of binary outcomes. A basket with no observed responses has a maximum-likelihood response estimate of zero, but that estimate alone does not express how uncertain the underlying response probability is. At the other extreme, analyzing every basket independently can leave estimates highly variable. A logistic random-intercept model combines the binomial data with a distribution of basket effects: baskets with limited data are informed by the overall pattern, while baskets with more evidence can depart further from it.

The model is useful when the outcome is binary and the target is a response probability in each basket. Its borrowing depends on the assumed distribution of basket effects. It does not establish that the baskets have identical effects, nor does it guarantee that borrowing is appropriate in every application.

Model and Assumptions

Definition: For basket \(j=1,\ldots,J\), let \(y_j\) be the number of responses among \(n_j\) participants, and let \(p_j\) be the basket-specific response probability. The logistic random-intercept model is $$ y_j\mid p_j \sim \operatorname{Binomial}(n_j,p_j),\qquad \operatorname{logit}(p_j)=\theta_j,\qquad \theta_j\mid\mu,\tau \sim N(\mu,\tau^2), $$ where \(\operatorname{logit}(p)=\log\{p/(1-p)\}\), \(\mu\) is the population mean log-odds across baskets, and \(\tau>0\) is the between-basket standard deviation on the log-odds scale. Equivalently, \(p_j=\operatorname{logit}^{-1}(\theta_j)=1/(1+\exp(-\theta_j))\).

The binomial likelihood assumes that, within basket \(j\), participants have a common response probability and their binary outcomes are conditionally independent given that probability. The normal hierarchy assumes that the basket log-odds are exchangeable draws from one distribution, conditional on \(\mu\) and \(\tau\). Exchangeability means that the model does not assign a different prior status to a basket solely because of its label. It does not mean that the true basket response probabilities are equal.

A full Bayesian fit also assigns priors to the hyperparameters. For illustration, one possible specification is \(\mu\sim N(0,2.5^2)\) and \(\tau\sim\operatorname{HalfNormal}(0,1)\), where the half-normal prior has the distribution of the absolute value of a \(N(0,1)\) variable. These are example choices, not universal defaults: prior predictive implications should be checked against plausible response rates and heterogeneity. In the numerical calculations below, \(\mu=0\) and \(\tau=0.8\) are held fixed to make the basket-level calculation transparent. In a real analysis, uncertainty in these hyperparameters should generally be propagated into subgroup estimates.

What the Posterior Calculation Does

Conditional on \(\mu,\tau\), the posterior density for a basket’s log-odds is proportional to its binomial likelihood times its normal prior density. Ignoring constants that do not depend on \(\theta_j\), its log density is

$$ \ell_j(\theta_j) =y_j\theta_j-n_j\log(1+\exp(\theta_j)) -\frac{(\theta_j-\mu)^2}{2\tau^2}. $$

The posterior mode is the value of \(\theta_j\) that maximizes this expression. Differentiating gives the score equation; differentiating again gives the curvature. The inverse curvature at the mode provides a local variance approximation, known as the Laplace approximation.

$$ \ell'_j(\theta_j)=y_j-n_jp_j-\frac{\theta_j-\mu}{\tau^2}=0,\qquad -\ell''_j(\theta_j)=n_jp_j(1-p_j)+\frac{1}{\tau^2}. $$

The second derivative is negative for every finite \(\theta_j\), since \(n_jp_j(1-p_j)\geq 0\) and \(1/\tau^2>0\). Thus the conditional log posterior is strictly concave and has at most one mode. The Laplace approximation represents the posterior near that mode by a normal distribution with variance equal to the reciprocal curvature.

1
Write the data and model.
Record \(y_j\) and \(n_j\) for every basket, and state the likelihood, link, hierarchy, and prior assumptions.
2
Fit the joint posterior.
In a full analysis, estimate or sample the hyperparameters and basket effects jointly, using a suitable computation method.
3
Summarize subgroup uncertainty.
Transform posterior draws of \(\theta_j\) to \(p_j\), then report a probability-scale summary and a credible interval for each basket.
4
Check the assumptions and computation.
Assess fit to the observed response patterns, sensitivity to heterogeneity assumptions, and whether the posterior computations have converged.

Worked Basket Calculations

With \(\mu=0\) and \(\tau=0.8\), the prior standard deviation is \(0.8\) log-odds units and \(\tau^2=0.64\). The prior median probability is \(\operatorname{logit}^{-1}(0)=0.5\). These values are chosen only for the hypothetical illustrations below.

Worked Example: Four Responses Among Eight Participants

Suppose a hypothetical basket has \(y_j=4\) responses among \(n_j=8\) participants. The score equation is \(4-8p_j-\theta_j/0.64=0\). At \(\theta_j=0\), \(p_j=0.5\), so the score is \(4-8(0.5)-0=0\). The conditional posterior mode is therefore \(\hat{\theta}_j=0\), corresponding to a mode-based probability of \(0.5\).

The curvature at the mode is \(1/0.64+8(0.5)(0.5)=1.5625+2=3.5625\). The Laplace standard deviation is \(1/\sqrt{3.5625}=0.530\) log-odds units. A normal approximation gives a 95% interval for \(\theta_j\) of \(0\pm1.96(0.530)=[-1.039,1.039]\). Transforming the endpoints gives an approximate probability interval of \([0.261,0.739]\).

This interval is an approximate conditional posterior credible interval under the stated fixed hyperparameters. It is not a frequentist confidence interval, and it does not include uncertainty in \(\mu\) or \(\tau\). The probability \(0.5\) is the inverse-logit of the posterior mode, not necessarily the posterior mean of \(p_j\).

Worked Example: No Responses in a Sparse Basket

Now suppose a hypothetical basket has \(y_j=0\) responses among \(n_j=8\). The score equation becomes \( -8p_j-\theta_j/0.64=0\). A numerical solution is \(\hat{\theta}_j\approx-1.192\), for which \(p_j\approx0.233\). Substitution gives a score close to zero: \( -8(0.2329)-(-1.192)/0.64\approx-1.863+1.863\approx0\). The corresponding mode-based response probability is about \(0.233\), rather than the independent maximum-likelihood estimate of zero.

At this mode the curvature is \(1/0.64+8(0.2329)(0.7671)\approx1.5625+1.429\approx2.992\). Thus the Laplace standard deviation is \(1/\sqrt{2.992}\approx0.578\). The approximate 95% interval on the log-odds scale is \(-1.192\pm1.96(0.578)=[-2.325,-0.059]\). Transforming these limits gives an approximate probability interval of \([0.089,0.485]\).

The finite estimate arises because the normal prior gives positive density to finite log-odds, including values above the likelihood’s boundary maximum. The result is pulled toward the prior center, but the data still move the mode below zero. This calculation illustrates moderation by the specified hierarchy; it does not show that a zero-response basket truly has a response probability near the prior median.

Worked Example: One Response and Probability-Scale Interpretation

For another hypothetical basket, let \(y_j=1\) and \(n_j=8\), with the same fixed hyperparameters. Its score equation is \(1-8p_j-\theta_j/0.64=0\). At \(\theta_j\approx-0.871\), \(p_j\approx0.295\), and the score is approximately \(1-8(0.295)-(-0.871)/0.64=1-2.360+1.361\approx0.001\). The mode is therefore about \(-0.871\), corresponding to probability \(0.295\).

The curvature is \(1/0.64+8(0.295)(0.705)\approx1.5625+1.664\approx3.227\), giving a Laplace standard deviation of about \(1/\sqrt{3.227}=0.557\). The approximate 95% log-odds interval is \(-0.871\pm1.96(0.557)=[-1.962,0.220]\), or approximately \([0.123,0.555]\) after inverse-logit transformation.

The mode-based estimate lies between the observed proportion \(1/8=0.125\) and the prior median probability \(0.5\). That is consistent with partial pooling, but the posterior interval remains wide. In a full fit, posterior draws of \(\mu\) and \(\tau\) would also contribute to uncertainty; the conditional calculation understates total uncertainty when those hyperparameters are not known.

Derivation and Interpretation of Partial Pooling

The score equation shows how the observed count and the hierarchy jointly determine the mode:

$$ y_j-n_jp_j=\frac{\theta_j-\mu}{\tau^2} \quad\Longrightarrow\quad \theta_j=\mu+\tau^2(y_j-n_jp_j). $$

The left side of the first expression is the likelihood score in log-odds units; the right side is the prior penalty for moving away from \(\mu\). If the data provide little information, the likelihood curvature \(n_jp_j(1-p_j)\) is small relative to \(1/\tau^2\), and the posterior is more strongly influenced by the hierarchy. As information grows, the likelihood can support greater separation from \(\mu\). This is the mechanism behind partial pooling, not a rule that each estimate must move by the same amount.

The scale matters: \(\mu\) is the mean of basket log-odds in the hierarchy, not the logit of the arithmetic mean of the basket probabilities. Because the inverse-logit is nonlinear, \(\operatorname{logit}^{-1}(\mu)\) is the probability at the center of the log-odds distribution, not generally the average basket response probability. If an overall response rate is needed, define the target clearly and calculate it from posterior draws using the intended basket weights.

Diagnostics, Alternatives, and Limitations

Sparse outcomes make careful checking especially important. Examine whether the observed basket counts and response proportions are compatible with posterior predictive data generated from the fitted model. Look for systematic discrepancies across baskets, extreme patterns the model rarely reproduces, and evidence that one common normal distribution of log-odds is implausible. Also check computational diagnostics for posterior sampling, including convergence and adequate effective sample sizes. Compare conclusions under plausible hyperprior scales; when there are few baskets, the data may provide limited information about \(\tau\).

A strong pull toward the center can be consequential when a basket’s response pattern differs from the rest. That is a reason to examine fit and sensitivity, not a reason to discard the hierarchy automatically. Conversely, weakly identified heterogeneity or an overly permissive distribution can reduce borrowing and leave estimates close to separate-basket analyses. These patterns are reasons for scrutiny; they do not by themselves identify a single correct model.

ApproachWhat it assumes or providesImportant trade-off
Independent binomial analysesEach basket has its own probability without cross-basket borrowing.Simple and transparent, but sparse baskets can have unstable estimates or boundary estimates.
Shared-effect modelBaskets share one response probability.Uses all observations together, but cannot represent genuine between-basket differences.
Logistic random-intercept modelBasket log-odds vary around a common mean with standard deviation \(\tau\).Allows heterogeneity and partial pooling, but depends on the hierarchy and its priors.
Beta-binomial modelBasket probabilities follow a distribution directly on the probability scale.Also allows heterogeneity; its probability-scale distribution is not interchangeable with a normal distribution on log-odds.

The logistic hierarchy has limitations. A single normal distribution may not describe distinct clusters of baskets, and one random intercept cannot represent covariates or within-basket dependence not captured by the binomial likelihood. With few baskets, heterogeneity can be difficult to estimate, so subgroup estimates may depend meaningfully on prior assumptions. Finally, a posterior probability or interval describes uncertainty conditional on the model; it does not correct bias from outcome misclassification, selective enrollment, or an inappropriate response definition.

Common Mistakes

  • Reporting zero as certainty. Zero observed responses means the sample proportion is zero; it does not establish that the basket response probability is zero.
  • Calling a mode a posterior mean. The inverse-logit of the log-odds mode is a mode-based probability summary, not automatically the posterior mean of \(p_j\).
  • Ignoring the hyperparameters. Conditional intervals with fixed \(\mu,\tau\) omit uncertainty in those quantities. Use joint posterior draws when reporting full Bayesian uncertainty.
  • Assuming partial pooling means equal effects. The hierarchy permits different basket effects. Its degree of pooling depends on the data and the estimated or specified heterogeneity.
  • Reading an interval as a data-generating guarantee. A credible interval is a posterior probability statement conditional on the model and priors; it does not guarantee that the model is well specified.
Key takeaway: A logistic random-intercept model expresses basket response probabilities through normally distributed log-odds. For sparse baskets it can yield finite, partially pooled estimates with explicit uncertainty, but those estimates rely on the binomial likelihood, exchangeable hierarchy, and hyperparameter assumptions.

Check Your Understanding

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

  1. In the model, what does \(\tau\) measure, and on what scale?
  2. Why can a basket with zero observed responses have a positive posterior mode for its response probability?
  3. For the zero-response example, why is the interval \([0.089,0.485]\) approximate rather than an exact full-posterior interval?
  4. Does a shared-effect model allow basket-specific response probabilities to differ? How does that compare with the random-intercept model?
  5. Name one assumption that should be checked and one diagnostic that can help assess it.

Solutions. (1) \(\tau\) is the between-basket standard deviation of the log-odds \(\theta_j\). (2) The normal prior assigns density to finite log-odds; combining it with the likelihood produces a finite posterior mode even though the separate-binomial likelihood is maximized at probability zero. (3) It uses a local normal approximation around the conditional mode, transforms its endpoints, and holds \(\mu,\tau\) fixed; it is not the exact posterior interval with hyperparameter uncertainty. (4) A shared-effect model imposes one common probability, whereas the random-intercept model allows basket-specific probabilities centered hierarchically around a common log-odds mean. (5) For example, conditional independence and a common binomial probability within each basket can be assessed in part using posterior predictive checks of basket response counts.

Clinical Biostats