Tutorials › Bayesian Clinical Trials › Hierarchical Models For Continuous Basket Endpoints

Hierarchical Models and Basket Trials · Tutorial 474 of 696

Hierarchical Models For Continuous Basket Endpoints

Build and interpret a normal hierarchical model for continuous basket effects, then calculate how subgroup precision and shared heterogeneity determine conditional shrinkage.

Advanced 12 min read

What You'll Learn

  • Specify a normal sampling model for continuous treatment-effect estimates and their basket-specific standard errors
  • Interpret the shared mean and between-basket standard deviation in a normal hierarchy
  • Derive conditional posterior means and variances when heterogeneity is positive
  • Handle the zero-heterogeneity case without using undefined precision expressions
  • Distinguish conditional shrinkage calculations from inference that averages over uncertain shared parameters
  • Recognize when scale, sampling assumptions, or exchangeability make borrowing questionable

Why Model Continuous Basket Effects Hierarchically?

A basket trial may estimate a continuous treatment effect separately for each disease subgroup. Examples include a difference in mean symptom score, a change in biomarker concentration, or a difference in a laboratory measurement. The estimate from a small basket is often imprecise, while a larger basket may be much more informative. A hierarchical model represents both the basket-specific effects and the idea that those effects may share information through a common distribution.

The model does not assume that every basket has the same treatment effect. Instead, it describes effects as varying around a shared mean, with the amount of variation represented by a heterogeneity parameter. This provides a structured middle ground between analyzing each basket entirely separately and imposing one common effect on all baskets.

Definition: For baskets \(j=1,\ldots,J\), let \(y_j\) be the estimated treatment effect in basket \(j\), on a common clinical scale, and let \(s_j\) be its standard error. Let \(\theta_j\) be the true basket-specific effect. A normal hierarchical model is $$ y_j\mid\theta_j \sim N(\theta_j,s_j^2),\qquad \theta_j\mid\mu,\tau \sim N(\mu,\tau^2). $$ The sampling errors are assumed independent across baskets conditional on the effects. The shared mean is \(\mu\), and the between-basket standard deviation is \(\tau\geq 0\). The variances \(s_j^2\) are treated as known in this normal summary-data model.

The sampling model says that an estimate is centered on its basket’s effect, with uncertainty described by its standard error. The hierarchy says that, conditional on the shared parameters, basket effects are distributed around \(\mu\). A positive \(\tau\) allows genuine differences among basket effects; \(\tau=0\) means all effects equal \(\mu\). The units of \(y_j\), \(s_j\), \(\theta_j\), \(\mu\), and \(\tau\) must agree. For example, if the treatment effect is measured in score points, then \(\tau\) is also measured in score points.

Assumptions and Model Inputs

Typically, \(y_j\) is a treatment-minus-control estimate within basket \(j\), so a positive effect may represent improvement if higher values are clinically favorable. The sign convention must be stated because a positive difference can instead indicate harm for outcomes where lower values are preferable. The normal sampling approximation is most defensible when the estimate is approximately unbiased and its sampling distribution is reasonably close to normal. The reported \(s_j\) should reflect the design and analysis used to obtain \(y_j\).

The model also requires that effects can meaningfully be compared on a common scale and that treating them as draws from one shared distribution is scientifically defensible. If baskets use different instruments, time points, or estimands, their estimates may not be directly comparable without a justified harmonization. Conditional independence of the sampling errors can fail, for example, when baskets share a control group and that dependence is not represented in the reported estimates. In such settings, the covariance among estimates belongs in the sampling model.

The normal hierarchy is often completed with prior distributions for \(\mu\) and \(\tau\). Those priors, and the uncertainty they represent, matter for the final posterior. The calculations below first condition on specified values of \(\mu\) and \(\tau\), which isolates how the hierarchy combines an individual estimate with the shared distribution. Such a conditional calculation is not, by itself, a full Bayesian analysis when the shared parameters are uncertain.

Worked Example: Forming a Basket-Level Estimate and Standard Error

Suppose a hypothetical randomized trial reports a continuous endpoint for one basket. The treatment group has \(n_T=36\), mean 5.8 points, and standard deviation 1.2 points. The control group has \(n_C=40\), mean 5.0 points, and standard deviation 1.0 point. Assume independent groups and use the usual large-sample normal approximation for the difference in means. Define the effect as treatment minus control.

The estimated effect is $$ y=5.8-5.0=0.800\text{ points}. $$ For independent group means, the estimated standard error is $$ s=\sqrt{\frac{1.2^2}{36}+\frac{1.0^2}{40}} =\sqrt{\frac{1.44}{36}+\frac{1.00}{40}} =\sqrt{0.0400+0.0250} =\sqrt{0.0650} =0.2550\text{ points}. $$

Thus the basket contributes the summary \(y=0.800\) points with \(s=0.2550\) points to the hierarchical model. The calculation assumes independent treatment and control observations and a suitable normal approximation for the difference in means. If the endpoint is analyzed with a different design or estimator, its corresponding estimate and standard error—not this formula—should be used.

Conditional Posterior and Shrinkage

For a basket with \(\tau>0\), the sampling likelihood and hierarchical distribution are both normal. Their product gives a normal conditional posterior for \(\theta_j\). The posterior mean is a precision-weighted combination of the basket estimate and the shared mean, and its posterior variance is smaller than either component variance.

To see the result, suppress the basket subscript temporarily. The conditional density for \(\theta\), up to a factor that does not depend on \(\theta\), is proportional to $$ \exp\left\{-\frac{1}{2}\left[\frac{(y-\theta)^2}{s^2}+\frac{(\theta-\mu)^2}{\tau^2}\right]\right\}. $$

Expanding the terms involving \(\theta\), the coefficient of \(\theta^2\) is \(1/s^2+1/\tau^2\), and the coefficient of \(-2\theta\) is \(y/s^2+\mu/\tau^2\). Completing the square therefore gives posterior variance \(v=(1/s^2+1/\tau^2)^{-1}\) and mean \(m=v(y/s^2+\mu/\tau^2)\). Equivalently, the mean can be written as a weighted average:

$$ \begin{aligned} \theta_j\mid y_j,\mu,\tau &\sim N(m_j,v_j),\qquad \tau>0,\\ v_j&=\left(\frac{1}{s_j^2}+\frac{1}{\tau^2}\right)^{-1} =\frac{s_j^2\tau^2}{s_j^2+\tau^2},\\ m_j&=v_j\left(\frac{y_j}{s_j^2}+\frac{\mu}{\tau^2}\right) =w_jy_j+(1-w_j)\mu,\\ w_j&=\frac{\tau^2}{\tau^2+s_j^2}. \end{aligned} $$

Here \(w_j\) is the weight on the basket estimate. A small \(s_j\) makes \(w_j\) large, so a precise estimate remains close to its observed value. A large \(s_j\) makes \(w_j\) smaller, so the conditional posterior mean moves closer to \(\mu\). Increasing \(\tau\) also increases the weight on the observed estimate: when basket effects are expected to vary substantially, the shared mean is less informative about any one basket. These statements concern the conditional posterior given \(\mu\) and \(\tau\).

Important boundary case: The precision derivation and the displayed formulas using \(1/\tau^2\) apply only when \(\tau>0\). At \(\tau=0\), the hierarchical distribution is degenerate: conditional on \(\mu\), \(\theta_j=\mu\) exactly, so its conditional variance is zero. If \(\mu\) is uncertain, however, the marginal posterior for \(\theta_j\) still has the posterior uncertainty in \(\mu\); it is not generally zero.

Worked Example: Conditional Shrinkage With Unequal Standard Errors

Consider three hypothetical baskets with treatment-effect estimates \(y_1=0.40\), \(y_2=0.10\), and \(y_3=0.35\) points, and standard errors \(s_1=0.15\), \(s_2=0.10\), and \(s_3=0.25\) points. For illustration, condition on \(\mu=0.30\) points and \(\tau=0.20\) points. These fixed values make the conditional calculation transparent; they are not claimed to be known in an actual trial.

For basket 1, \(s_1^2=0.0225\) and \(\tau^2=0.0400\). Thus $$ w_1=\frac{0.0400}{0.0400+0.0225}=0.6400,\qquad m_1=0.6400(0.40)+0.3600(0.30)=0.3640\text{ points}, $$ $$ v_1=\frac{(0.0225)(0.0400)}{0.0225+0.0400}=0.01440\text{ points}^2. $$ The conditional posterior standard deviation is \(\sqrt{0.01440}=0.1200\) points.

For basket 2, \(s_2^2=0.0100\), so $$ w_2=\frac{0.0400}{0.0400+0.0100}=0.8000,\qquad m_2=0.8000(0.10)+0.2000(0.30)=0.1400\text{ points}, $$ $$ v_2=\frac{(0.0100)(0.0400)}{0.0100+0.0400}=0.008000\text{ points}^2. $$ Its posterior standard deviation is \(0.08944\) points. Although its observed estimate is farthest from \(\mu\), its relatively small standard error gives it the largest weight on its own estimate.

For basket 3, \(s_3^2=0.0625\), giving $$ w_3=\frac{0.0400}{0.0400+0.0625}=0.3902,\qquad m_3=0.3902(0.35)+0.6098(0.30)=0.3195\text{ points}, $$ $$ v_3=\frac{(0.0625)(0.0400)}{0.0625+0.0400}=0.02439\text{ points}^2. $$ The posterior standard deviation is \(0.1562\) points. This least precise estimate is pulled most strongly toward the shared mean. All three calculations use the same \(\mu\) and \(\tau\); the different weights arise from their different standard errors.

Uncertain Shared Parameters and the Zero-Variation Limit

In a full Bayesian analysis, \(\mu\) and \(\tau\) are uncertain and have prior distributions. The posterior for a basket effect is then obtained by averaging its conditional posterior over the posterior distribution of the shared parameters: $$ p(\theta_j\mid y)=\int p(\theta_j\mid y,\mu,\tau)\,p(\mu,\tau\mid y)\,d\mu\,d\tau. $$ For positive \(\tau\), the conditional distribution inside this integral is the normal distribution derived above. When the posterior permits \(\tau=0\), the conditional distribution at that boundary is instead a point mass at \(\mu\). In either case, uncertainty about \(\mu\) and \(\tau\) must not be discarded when reporting full posterior summaries.

The shared hyperparameters also connect baskets: conditional on fixed \(\mu\) and \(\tau\), their effects are independent under this hierarchy, but integrating over uncertain shared parameters can induce posterior dependence. This matters when making joint statements about multiple baskets. It is one reason that separate conditional normal calculations are useful building blocks, not substitutes for the joint posterior.

Worked Example: The Boundary Case With an Uncertain Shared Mean

Use the three estimates and standard errors from the previous example, but now set \(\tau=0\). Suppose the prior for the common mean is \(\mu\sim N(0.30,0.20^2)\), and retain the independent normal sampling model. Because \(\tau=0\), each basket effect equals \(\mu\); the data update the common mean rather than producing separate basket effects.

The prior precision is \(1/0.20^2=25\). The data precisions are \(1/0.15^2=44.444\), \(1/0.10^2=100\), and \(1/0.25^2=16\), for total posterior precision $$ 25+44.444+100+16=185.444. $$ The posterior variance and mean of the common effect are $$ \operatorname{Var}(\mu\mid y)=\frac{1}{185.444}\approx 0.00539246\text{ points}^2, $$ $$ E(\mu\mid y)= \frac{25(0.30)+44.444(0.40)+100(0.10)+16(0.35)} {185.444} =\frac{40.878}{185.444} =0.2204\text{ points}. $$ Thus \(\mu\mid y\) has standard deviation \(\sqrt{0.00539246}\approx 0.073433\) points (0.07343 to five decimal places). Each \(\theta_j\) equals this same uncertain \(\mu\): conditional on a specified \(\mu\), its variance is zero, while after learning from the data its marginal posterior variance is approximately \(0.00539246\) points squared.

Interpretation, Comparisons, and Failure Modes

The hierarchical analysis is not the same as replacing all basket estimates with their simple average. It respects each basket’s standard error and allows effects to differ when \(\tau>0\). It is also distinct from an independent analysis, which estimates each effect without a shared distribution and therefore does not borrow information through \(\mu\) and \(\tau\). At the other extreme, the \(\tau=0\) model imposes a common effect. These approaches answer different modeling assumptions; data alone do not make them interchangeable.

A conditional posterior probability can be calculated from the normal distribution. For example, if positive effects are beneficial, then conditional on \(\mu,\tau\), \(P(\theta_j>0\mid y_j,\mu,\tau)=1-\Phi((0-m_j)/\sqrt{v_j})\), where \(\Phi\) is the standard normal cumulative distribution function. With uncertain hyperparameters, the relevant probability averages this conditional probability over their posterior distribution. It should be described as a posterior probability under the specified model, not as a frequentist confidence statement.

Common warning signs include estimates whose reported standard errors do not reflect shared controls or other cross-basket dependence, effects recorded on incompatible scales, and substantive knowledge that some baskets are unlikely to share a distribution. Strong shrinkage is not automatically evidence that a basket’s observed effect is erroneous; it follows from the model and the relative precision of the data and shared distribution. Likewise, weak shrinkage does not establish homogeneity. Estimates of \(\tau\) can be uncertain when there are few baskets, so posterior conclusions may depend materially on the prior for heterogeneity.

A frequent calculation error is to substitute \(\tau=0\) into the positive-\(\tau\) precision formula, which contains \(1/\tau^2\). That expression is undefined at zero. The correct reasoning is to use the degenerate model directly: conditional on \(\mu\), every \(\theta_j\) equals \(\mu\). If \(\mu\) is unknown, its posterior uncertainty remains and is shared by all basket effects.

1
Check the summaries.
Confirm that each \(y_j\) estimates the intended effect on a common scale and that \(s_j\) is appropriate for its sampling design.
2
State the hierarchy.
Specify the normal sampling distributions, the shared normal effect distribution, and the assumptions about independence and exchangeability.
3
Separate conditional and full inference.
Use the shrinkage formulas only for \(\tau>0\) conditional on \(\mu,\tau\); integrate over uncertain shared parameters for full posterior conclusions, and treat \(\tau=0\) as a degenerate case.

Check Your Understanding

Answer the questions, then check the solutions below.

  1. If two baskets have the same \(s_j\), \(\mu\), and \(\tau>0\), but one estimate is more extreme, which basket receives a larger weight on its own estimate?
  2. For \(s_j=0.10\) and \(\tau=0.20\), calculate the conditional weight \(w_j\) on \(y_j\).
  3. What does \(\tau=0\) imply about \(\theta_j\) conditional on \(\mu\), and what uncertainty can remain if \(\mu\) has a posterior distribution?
  4. Name two assumptions or features of the data that could make this model inappropriate without modification.

Solutions. 1. Neither: the weight depends on \(s_j\) and \(\tau\), not on how extreme \(y_j\) is. 2. \(w_j=0.20^2/(0.20^2+0.10^2)=0.0400/0.0500=0.8000\), so the observed estimate receives 80% of the conditional posterior-mean weight. 3. Conditional on \(\mu\), \(\theta_j=\mu\) exactly and has zero conditional variance; uncertainty in \(\mu\) remains in the marginal posterior for \(\theta_j\). 4. Examples include estimates on incompatible scales, unmodeled dependence from a shared control, a poor normal sampling approximation, or baskets that are not plausibly represented by one shared effect distribution.

Clinical Biostats