Tutorials › Bayesian Clinical Trials › Unequal Subgroup Sizes In Hierarchical Models

Hierarchical Models and Basket Trials · Tutorial 471 of 696

Unequal Subgroup Sizes In Hierarchical Models

Learn how subgroup sample size controls partial pooling, and how to distinguish the model’s shrinkage weight from the actual change in a subgroup estimate.

Advanced 11 min read

What You'll Learn

  • Derive the beta-binomial posterior mean and its sample-size-dependent shrinkage weight.
  • Compare posterior estimates from baskets of different sizes under a shared prior.
  • Separate the shrinkage weight from the realized amount of movement toward the center.
  • Apply the same sample-size principle in a normal-normal hierarchy.
  • Recognize assumptions and model problems that can make unequal-size comparisons misleading.
  • Compare partial pooling with complete pooling and no pooling.

Why Unequal Basket Sizes Matter

In a basket trial, subgroups can differ substantially in how many patients they contribute. When a hierarchical model partially pools subgroup estimates, a smaller basket generally receives more influence from the shared distribution than a larger basket does. This is not an arbitrary adjustment: with fewer observations, the subgroup-specific data are less informative relative to the prior distribution.

The key qualification is that a larger shrinkage weight does not guarantee a larger observed movement toward the shared center. The movement also depends on how far the subgroup’s observed estimate is from that center. We will separate these two ideas using the beta-binomial model, then check the same principle in a normal-normal model.

Binary Outcomes: The Size-Dependent Weight

Suppose there are \(J\) baskets. For basket \(j\), let \(n_j\) be the number of patients and \(y_j\) the number who respond. Assume, conditionally on the basket response probability \(p_j\), that responses are independent Bernoulli outcomes. Thus \(y_j\mid p_j\sim\operatorname{Binomial}(n_j,p_j)\). For this calculation, take a common beta prior \(p_j\sim\operatorname{Beta}(a,b)\), with \(a>0\) and \(b>0\). The prior mean is \(m=a/(a+b)\), and \(a+b\) is its concentration.

This is a conditional calculation for specified \(a\) and \(b\). Its simple form also describes a beta-binomial hierarchy conditional on those shared hyperparameters. It assumes a common prior distribution across baskets and the same definition of response and observation window in each basket.

Definition: In this beta-binomial model, the posterior mean for basket \(j\) is a weighted average of its observed response proportion \(r_j=y_j/n_j\) and the prior mean \(m\). The data weight is \(w_j=n_j/(n_j+a+b)\); the prior-center weight is \(1-w_j=(a+b)/(n_j+a+b)\). Smaller \(n_j\) gives a smaller data weight and a larger prior-center weight, holding \(a\) and \(b\) fixed.

The posterior distribution and mean follow from multiplying the binomial likelihood by the beta prior:

$$ p_j\mid y_j,n_j \sim \operatorname{Beta}(a+y_j,\ b+n_j-y_j), \qquad E(p_j\mid y_j,n_j)=\frac{a+y_j}{a+b+n_j}. $$

Writing \(y_j=n_jr_j\) and \(k=a+b\), the posterior mean can be rearranged as

$$ \frac{a+y_j}{a+b+n_j} = \frac{n_j}{n_j+k}r_j + \frac{k}{n_j+k}m = w_jr_j+(1-w_j)m. $$

Why the Smaller Basket Shrinks More

The derivation shows that the data weight depends on the basket size and the prior concentration. With \(k=a+b\) held fixed, \(w_j=n_j/(n_j+k)\) increases as \(n_j\) increases. Equivalently, the weight on the prior center decreases. The actual change in the estimate is

$$ r_j-E(p_j\mid y_j,n_j) = \frac{k}{n_j+k}(r_j-m). $$

This equation gives both the direction and the magnitude of the movement. If \(r_j\) is above \(m\), its posterior mean lies between \(m\) and \(r_j\); if it is below \(m\), the posterior mean also lies between them. For two baskets with the same observed proportion and the same distance from \(m\), the smaller basket moves farther toward \(m\). But if their observed proportions differ, the smaller basket need not move farther in absolute terms: a large basket very far from \(m\) can move more than a small basket close to \(m\).

Worked Example: Same Response Rate, Different Basket Sizes

Consider hypothetical baskets with observed response rates of 60% in both baskets: basket A has \(y_A=6\) responses among \(n_A=10\) patients, while basket B has \(y_B=24\) among \(n_B=40\). Use the shared prior \(\operatorname{Beta}(2,8)\), whose mean is \(m=2/10=0.20\) and concentration is \(k=10\). Assume the Bernoulli and common-prior conditions just stated.

For basket A, \(r_A=6/10=0.60\) and \(w_A=10/(10+10)=0.50\). Its posterior mean is

$$ \frac{2+6}{2+8+10} = \frac{8}{20} = 0.40 = 0.50(0.60)+0.50(0.20). $$

The estimate moves down by \(0.60-0.40=0.20\), or 20 percentage points. For basket B, \(r_B=24/40=0.60\) and \(w_B=40/(40+10)=0.80\). Its posterior mean is

$$ \frac{2+24}{2+8+40} = \frac{26}{50} = 0.52 = 0.80(0.60)+0.20(0.20). $$

Basket B moves down by \(0.60-0.52=0.08\), or 8 percentage points. The two observed rates are equally far from the prior mean, so the difference in movement is attributable to their different sizes under this specified model. These are posterior means, not claims that either basket’s true response probability equals its estimate.

Unequal Sizes and Unequal Observed Rates

When basket rates differ, it is useful to compute both the weight and the distance from the center. The weight describes how the model combines the data and prior; the realized movement is the product of the prior-center weight and the observed deviation. Comparing weights alone cannot establish which basket’s estimate moves more in percentage-point terms.

Worked Example: The Smaller Basket Does Not Always Move More

Use the same hypothetical \(\operatorname{Beta}(2,8)\) prior. Basket C has \(y_C=4\) responses among \(n_C=8\) patients, while basket D has \(y_D=12\) among \(n_D=30\). The observed rates are \(r_C=4/8=0.50\) and \(r_D=12/30=0.40\). Both exceed the prior mean \(m=0.20\), so both posterior means must lie between their observed rates and 0.20.

For basket C, \(w_C=8/(8+10)=8/18\). Its posterior mean and movement are

$$ E(p_C\mid y_C,n_C)=\frac{2+4}{2+8+8}=\frac{6}{18}=0.3333, \qquad 0.50-0.3333=0.1667. $$

For basket D, \(w_D=30/(30+10)=0.75\). Its posterior mean and movement are

$$ E(p_D\mid y_D,n_D)=\frac{2+12}{2+8+30}=\frac{14}{40}=0.3500, \qquad 0.40-0.3500=0.0500. $$

Here the smaller basket moves more: 16.67 percentage points rather than 5.00. That conclusion is not based on size alone, since basket C also starts farther from the prior mean. The general formula accounts for both factors.

A Short Derivation of the Size Effect

The beta-binomial expression makes the comparison especially direct. For fixed concentration \(k>0\), the data weight is \(w(n)=n/(n+k)\). If \(n_2>n_1>0\), then

$$ w(n_2)-w(n_1) = \frac{n_2}{n_2+k}-\frac{n_1}{n_1+k} = \frac{k(n_2-n_1)}{(n_2+k)(n_1+k)} >0. $$

Therefore the larger basket has the greater data weight and the smaller prior-center weight. The amount of shrinkage in the posterior mean, in absolute terms, is

$$ \left|r-E(p\mid y,n)\right| = \frac{k}{n+k}|r-m|. $$

For the same \(|r-m|\), this quantity decreases with \(n\). The result is conditional on a fixed shared prior concentration. In a full Bayesian analysis where the hyperparameters are uncertain, posterior inference averages over their uncertainty; simply substituting posterior averages of \(a\) and \(b\) into this formula need not give the exact marginal posterior mean.

The Same Principle in a Normal-Normal Model

For a continuous basket outcome, suppose patient-level observations in basket \(j\) are independent normal observations with known within-basket variance \(\sigma^2\), so \(\bar{x}_j\mid\theta_j\sim N(\theta_j,\sigma^2/n_j)\). Suppose also that \(\theta_j\sim N(\mu,\tau^2)\), with \(\mu\) and \(\tau^2\) treated as fixed for this calculation. The posterior mean combines the basket mean and the shared center:

$$ E(\theta_j\mid\bar{x}_j) = \frac{\tau^2}{\tau^2+\sigma^2/n_j}\bar{x}_j + \frac{\sigma^2/n_j}{\tau^2+\sigma^2/n_j}\mu. $$

The data weight increases with \(n_j\), because the sampling variance \(\sigma^2/n_j\) falls as the basket gets larger. Thus, under these assumptions, a small basket’s mean is pulled more toward \(\mu\). The formula also shows why unequal sizes matter even when the observed means are identical.

Worked Example: Continuous Outcomes With Unequal Sizes

Suppose two hypothetical baskets have observed means of 1.50 standardized outcome units. Assume \(\mu=0\), \(\tau^2=0.25\), and known within-basket variance \(\sigma^2=1\). Basket E has \(n_E=4\), and basket F has \(n_F=25\). The normal sampling and prior assumptions above are part of this illustration.

For basket E, the data weight is \(0.25/(0.25+1/4)=0.50\), so its posterior mean is

$$ 0.50(1.50)+0.50(0)=0.750. $$

For basket F, the data weight is \(0.25/(0.25+1/25)=0.25/0.29=0.8621\), so its posterior mean is

$$ 0.8621(1.50)+0.1379(0)=1.293. $$

Both means are measured in standardized outcome units. With the same observed mean and shared center, the smaller basket’s estimate is closer to the center.

Assumptions, Diagnostics, and Alternatives

Unequal-size shrinkage is a consequence of the assumed information structure, not a guarantee that borrowing is appropriate. In the binary example, the calculation treats responses as conditionally independent within each basket and uses a common beta distribution for basket probabilities. It also presumes comparable response definitions and follow-up. If these conditions are implausible, the resulting common center may be a poor reference for some baskets.

A useful diagnostic is to compare each basket’s observed rate, posterior mean, sample size, and distance from the fitted shared center. Check that the direction of shrinkage is sensible and that differences between baskets are not being hidden by a strong shared prior. In a fully Bayesian model, inspect whether posterior uncertainty in the shared parameters materially changes the basket estimates; conditional weights alone do not show that uncertainty. Unusually strong pulls or a center poorly aligned with clinically comparable baskets are reasons to question the modeling assumptions and examine sensitivity to the prior and hierarchy.

The main alternatives differ in how much information is shared. No pooling estimates each basket separately and does not use a common center. Complete pooling treats all baskets as having one response probability, removing basket-specific variation. Partial pooling retains basket-specific probabilities while connecting them through a shared distribution. Unequal-size shrinkage is characteristic of partial pooling: each basket contributes information according to its precision relative to the shared distribution.

ApproachHow baskets are relatedImplication for unequal sizes
No poolingBasket estimates are independentSmall baskets are not pulled toward a shared center
Complete poolingAll baskets share one probabilityThere is no basket-specific estimate to shrink
Partial poolingBasket probabilities vary around a shared distributionSmaller baskets generally have less data weight, conditional on the shared distribution

A common mistake is to say, “The smaller basket must have the larger posterior change because it has fewer patients.” Fewer patients imply a larger prior-center weight under the stated model, but the absolute change also depends on the observed rate’s distance from the center. Another mistake is to treat a displayed weight as a universal property of the basket: it depends on the prior concentration (or, in the normal model, the between-basket and within-basket variances). Always state the model and the center against which shrinkage is being measured.

Key takeaway: Under a shared hierarchical distribution, smaller baskets generally receive less data weight and more prior-center weight. This predicts stronger shrinkage for equal deviations from the center, not necessarily a larger realized movement when basket estimates start at different distances.

Check Your Understanding

Answer each question using the model and quantities stated. Solutions are included below the questions.

  1. Under a \(\operatorname{Beta}(1,4)\) prior, calculate the data weight for a basket of size 5 and one of size 20.
  2. For the same prior, a basket has \(n=10\) and observed response proportion \(r=0.50\). Calculate its posterior mean and the movement toward the prior mean.
  3. Two baskets have the same sample size, but one observed rate is farther from the prior mean. Which has the larger absolute posterior movement under the beta-binomial model?
  4. State one reason the conditional shrinkage formula may not equal the exact marginal posterior mean in a fully Bayesian hierarchy.

Solutions. (1) Here \(k=1+4=5\). The weights are \(5/(5+5)=0.500\) and \(20/(20+5)=0.800\), respectively. (2) The prior mean is \(m=1/5=0.20\). The posterior mean is \((1+10(0.50))/(5+10)=6/15=0.400\), so the movement is \(0.500-0.400=0.100\), or 10 percentage points. (3) With equal \(n\) and the same prior, the factor \(k/(n+k)\) is equal; the basket farther from the prior mean has the larger absolute movement. (4) The hyperparameters are uncertain, so the exact posterior mean averages the conditional posterior over their joint posterior distribution; substituting point summaries for them does not generally perform that integration.

Clinical Biostats