Tutorials › Bayesian Clinical Trials › Worked Continuous Basket Analysis With A Normal Hierarchy

Hierarchical Models and Basket Trials · Tutorial 498 of 696

Worked Continuous Basket Analysis With A Normal Hierarchy

Work through continuous basket estimates under a normal hierarchy, from the likelihood and prior to partially pooled posterior means and intervals.

Advanced 10 min read

What You'll Learn

  • Specify a normal likelihood for subgroup treatment-effect estimates and a normal distribution for between-subgroup effects.
  • Derive the posterior mean and variance when the hierarchy’s mean and heterogeneity are fixed.
  • Calculate subgroup-specific posterior means and credible intervals from hypothetical trial estimates.
  • Propagate uncertainty in a shared hypermean into marginal subgroup intervals.
  • Compare hierarchical estimates with independent analyses and identify assumptions that can undermine borrowing.

Why Use a Normal Hierarchy for Continuous Effects?

A basket trial may estimate a continuous treatment effect separately for each disease subgroup. The subgroup estimates can differ because the underlying effects differ, because estimates are noisy, or both. A normal hierarchy represents both sources of variation: each observed estimate is uncertain around its subgroup’s true effect, and the subgroup effects vary around a shared mean.

The hierarchy gives partial pooling. A subgroup estimate is pulled toward the shared mean, with a greater pull when its standard error is large relative to the assumed between-subgroup variability. The calculation does not establish that all subgroups have the same effect. Rather, it encodes a model under which effects are related, while allowing them to differ.

Definition: For subgroup \(j=1,\ldots,J\), let \(y_j\) be an estimated treatment effect, with known or treated-as-fixed standard error \(SE_j\), and let \(\theta_j\) be the true subgroup effect. The continuous normal hierarchy is $$ y_j\mid \theta_j \sim N(\theta_j,SE_j^2),\qquad \theta_j\mid\mu,\tau^2 \sim N(\mu,\tau^2). $$ Here \(\mu\) is the shared mean effect and \(\tau\) is the between-subgroup standard deviation. Conditional on the subgroup effects, the estimates are assumed independent. The effects and estimates must use the same scale and units.

This formulation assumes that the subgroup estimates are approximately normal around their true effects, and that their reported standard errors adequately describe their sampling uncertainty. It also assumes that the normal distribution is a reasonable model for variation in subgroup effects. When \(\mu\) and \(\tau\) are fixed, the calculations below are conditional on those values; uncertainty in them is not automatically included.

Deriving the Partially Pooled Posterior

First consider one subgroup, with \(\mu\), \(\tau\), and \(SE_j\) fixed. The likelihood contributes precision \(1/SE_j^2\), while the normal prior for \(\theta_j\) contributes precision \(1/\tau^2\). Multiplying the normal likelihood and prior and collecting the terms involving \(\theta_j\) gives a normal posterior:

$$ \theta_j\mid y_j,\mu,\tau^2 \sim N(m_j,v_j),\qquad v_j=\left(\frac{1}{SE_j^2}+\frac{1}{\tau^2}\right)^{-1} =\frac{SE_j^2\tau^2}{SE_j^2+\tau^2}. $$

The posterior mean is the precision-weighted average of the estimate and the shared mean. Defining \(w_j=\tau^2/(\tau^2+SE_j^2)\), it can be written in either of the following equivalent forms:

$$ m_j = \frac{y_j/SE_j^2+\mu/\tau^2}{1/SE_j^2+1/\tau^2} = \mu+w_j(y_j-\mu) = w_jy_j+(1-w_j)\mu. $$

The weight \(w_j\) is between zero and one for positive \(SE_j\) and \(\tau\). If an estimate is precise relative to the heterogeneity (\(SE_j^2\) is small compared with \(\tau^2\)), \(w_j\) is close to one and the posterior mean stays near \(y_j\). If it is imprecise relative to the heterogeneity, the mean moves closer to \(\mu\). The posterior variance \(v_j\) is smaller than either \(SE_j^2\) or \(\tau^2\), since its precision is the sum of the likelihood and prior precisions.

Interpretation: With fixed \(\mu\) and \(\tau\), a 95% posterior credible interval for \(\theta_j\) is \(m_j\pm1.96\sqrt{v_j}\). Under the stated model and fixed hyperparameters, this interval contains 95% of the posterior probability for that subgroup’s effect. It is not a statement that there is a 95% frequentist probability that a fixed effect lies in the realized interval.

Worked Example: Three Subgroups With Fixed Hyperparameters

Suppose a hypothetical trial estimates mean change in a clinical score, in points, for three subgroups. A positive effect favours treatment. Assume the estimates are approximately normal with the stated standard errors, and assume independent estimation errors conditional on subgroup effects. For this calculation, take \(\mu=0\) points and \(\tau=1.5\) points as fixed.

SubgroupEstimate \(y_j\) (points)\(SE_j\) (points)
A2.01.0
B0.51.5
C-1.00.8

For each subgroup, \(\tau^2=2.25\) points squared. For A, \(w_A=2.25/(2.25+1.00)=0.6923\). Thus \(m_A=0+0.6923(2.0-0)=1.385\) points, and \(v_A=(1.00)(2.25)/(1.00+2.25)=0.6923\) points squared. The posterior standard deviation is \(\sqrt{0.6923}=0.8321\) points, giving the interval \(1.385\pm1.96(0.8321)\approx[-0.246,3.015]\) points.

For B, \(w_B=2.25/(2.25+2.25)=0.5000\). Therefore \(m_B=0.5000(0.5)=0.2500\) points and \(v_B=(2.25)(2.25)/(2.25+2.25)=1.125\) points squared. Its interval is \(0.2500\pm1.96\sqrt{1.125}\approx[-1.829,2.329]\) points.

For C, \(w_C=2.25/(2.25+0.64)=0.7785\). Therefore \(m_C=0.7785(-1.0)=-0.7785\) points and \(v_C=(0.64)(2.25)/(0.64+2.25)=0.4983\) points squared. Its interval is \(-0.7785\pm1.96\sqrt{0.4983}\approx[-2.162,0.605]\) points.

The estimates are not replaced by one common value: the posterior means remain subgroup-specific. B, whose standard error is largest relative to \(\tau\), is pulled most strongly toward zero. These intervals are conditional on the chosen \(\mu\) and \(\tau\); they do not include uncertainty about either hyperparameter.

Allowing Uncertainty in the Shared Mean

The fixed-hyperparameter calculation is useful for understanding shrinkage, but a shared mean may itself be uncertain. One simple extension keeps \(\tau\) fixed and assigns a normal prior \(\mu\sim N(m_0,A^2)\). Integrating out each \(\theta_j\) gives \(y_j\mid\mu\sim N(\mu,\tau^2+SE_j^2)\). Consequently, the data update the shared mean using these marginal variances.

After obtaining the posterior distribution for \(\mu\), the subgroup effect can be averaged over that posterior. Conditional on \(\mu\) and \(y_j\), its mean is \(\mu+w_j(y_j-\mu)\) and its variance is \(v_j\). The law of total variance then gives the marginal posterior variance:

$$ E(\theta_j\mid\mathbf y) = w_jy_j+(1-w_j)E(\mu\mid\mathbf y), \qquad \operatorname{Var}(\theta_j\mid\mathbf y) = v_j+(1-w_j)^2\operatorname{Var}(\mu\mid\mathbf y). $$

This expression shows why merely substituting a posterior estimate of \(\mu\) into the fixed-\(\mu\) interval is incomplete: it omits the second variance term. This extension still treats \(\tau\) as fixed. If \(\tau\) is uncertain, a complete Bayesian analysis must also average over its posterior rather than act as if one selected value were known.

Worked Example: Propagating Shared-Mean Uncertainty

Consider two hypothetical subgroup estimates of treatment benefit, in points: \(y_1=1.2\) and \(y_2=1.8\), each with \(SE_j=0.5\) points. Assume independent errors conditional on effects, \(\tau=1\) point fixed, and \(\mu\sim N(0,4)\), so \(A^2=4\) points squared. The likelihood for each estimate conditional on \(\mu\), after integrating out its subgroup effect, has variance \(\tau^2+SE_j^2=1.25\) points squared.

The posterior precision for \(\mu\) is \(1/4+2/1.25=1.85\) per point squared. Its posterior variance is \(1/1.85=0.5405\) points squared, and its mean is \(0.5405(1.2/1.25+1.8/1.25)=1.297\) points.

For either subgroup, \(w_j=1/(1+0.25)=0.8000\) and \(v_j=(1)(0.25)/(1+0.25)=0.2000\) points squared. The marginal posterior means are \(0.8(1.2)+0.2(1.297)=1.219\) points and \(0.8(1.8)+0.2(1.297)=1.699\) points. Each marginal variance is \(0.2000+(1-0.8)^2(0.5405)=0.2216\) points squared, with standard deviation \(0.4708\) points. The corresponding 95% intervals are approximately \([0.297,2.142]\) and \([0.777,2.622]\) points. These intervals include uncertainty in \(\mu\), but remain conditional on the assumed value of \(\tau\).

Comparisons, Checks, and Limits

Independent subgroup analyses use each \(y_j\) without borrowing: under the normal approximation, their posterior or interval calculations are based on that subgroup’s own likelihood and any separately specified prior. At the other extreme, complete pooling assumes a common effect for every subgroup. A normal hierarchy lies between these approaches: it allows subgroup differences while connecting estimates through \(\mu\) and \(\tau\). The choice is substantive as well as computational; it depends on whether related effects across the basket are plausible.

Worked Example: Comparing a Hierarchical and an Independent Estimate

Suppose a hypothetical subgroup has an estimated treatment effect of \(3.0\) points with \(SE=2.0\) points. For an illustrative conditional calculation, set \(\mu=1.0\) point and \(\tau=1.5\) points. Assume the normal likelihood and hierarchy are appropriate, with these hyperparameters treated as fixed.

The hierarchical weight is \(w=2.25/(2.25+4.00)=0.3600\). Thus the posterior mean is \(1.0+0.3600(3.0-1.0)=1.720\) points. The posterior variance is \((4.00)(2.25)/(4.00+2.25)=1.440\) points squared, so the conditional 95% interval is \(1.720\pm1.96(1.200)=[-0.632,4.072]\) points.

For comparison, an independent normal-approximation interval using the estimate and standard error alone is \(3.0\pm1.96(2.0)=[-0.920,6.920]\) points. In this example the hierarchical estimate is closer to the shared mean and its conditional interval is narrower. The comparison does not prove that borrowing is appropriate: it illustrates the consequence of the specified hierarchy and fixed hyperparameters.

Before interpreting results, check that the inputs and assumptions make sense. The treatment-effect definition, direction, and units should match across subgroups. Standard errors should reflect the analyses that produced the estimates, and the sampling errors should be reasonably approximated by normal distributions. If estimates share patients, controls, or other data, their errors may be correlated; a model that treats them as independent can misstate the information available. Likewise, markedly different outcome scales or incompatible subgroup definitions undermine the interpretation of one shared \(\mu\) and one \(\tau\).

The model’s prior implications matter. A small \(\tau\) concentrates subgroup effects near \(\mu\) and can produce strong shrinkage; a large \(\tau\) permits more variation and gives estimates more weight. Examine whether the assumed hierarchy and heterogeneity are plausible for the clinical setting, and assess sensitivity to defensible choices. When hyperparameters are estimated or assigned priors, their uncertainty should be propagated into the reported subgroup summaries.

Common mistake: “The posterior mean is between the subgroup estimate and the shared mean, so partial pooling proves the effects are similar.” That conclusion does not follow. The movement toward \(\mu\) is a consequence of the assumed normal hierarchy; evidence about differences also depends on uncertainty, heterogeneity, and model fit. Report subgroup-specific uncertainty and do not treat shrinkage or a ranking of posterior means as proof that subgroup effects are equal or different.

A normal hierarchy is useful when continuous subgroup estimates and their standard errors are available and a normal approximation is defensible. It is not a substitute for checking how the estimates were obtained, whether their errors are dependent, or whether the subgroups can reasonably be connected by a common distribution. In sparse or strongly non-normal settings, a normal approximation to the estimates may be inadequate, and a likelihood at the outcome level may be preferable.

Check Your Understanding

Answer each question, then compare with the solutions.

  1. With fixed \(\mu=0\), \(\tau=2\), \(y_j=3\), and \(SE_j=1\), calculate \(w_j\) and the posterior mean.
  2. For the same values, calculate the posterior variance and the conditional 95% credible interval.
  3. If \(SE_j^2\) increases while \(\tau\) stays fixed, what happens to the estimate’s weight \(w_j\)? Explain using its formula.
  4. Name one assumption that could make the independent-error normal hierarchy inappropriate for a basket analysis.

Solutions. (1) \(w_j=2^2/(2^2+1^2)=4/5=0.8000\), so \(m_j=0+0.8(3-0)=2.4\) units of the treatment effect. (2) \(v_j=(1)(4)/(1+4)=0.8000\) squared units, so the interval is \(2.4\pm1.96\sqrt{0.8}\approx[0.647,4.153]\) units. (3) \(w_j=\tau^2/(\tau^2+SE_j^2)\) decreases as \(SE_j^2\) increases, so the posterior mean gives less weight to the noisy estimate and more to \(\mu\). (4) For example, subgroup estimates may have correlated sampling errors because they share a control group; assuming conditional independence would then be inappropriate.

Clinical Biostats