Tutorials › Bayesian Clinical Trials › Patient-Level And Basket-Level Variation

Hierarchical Models and Basket Trials · Tutorial 478 of 696

Patient-Level And Basket-Level Variation

Learn to identify patient-level sampling variation, between-basket treatment-effect variation, and the distinct uncertainty in estimating each basket’s effect.

Advanced 10 min read

What You'll Learn

  • Distinguish variation among patients from variation in true treatment effects across baskets.
  • Identify the likelihood and random-effects components that represent each source.
  • Derive how sampling error and basket heterogeneity combine in observed basket estimates.
  • Interpret variance components in binary and continuous endpoint models.
  • Recognize why variation in observed basket estimates is not itself a direct measure of heterogeneity.

Two Sources of Variation, Two Different Questions

A basket trial may enroll patients in several disease subgroups, or baskets. Outcomes vary among patients within a basket, even when they share the same underlying treatment effect. At the same time, the true treatment effect may differ from one basket to another. These are distinct sources of variation: patient-level sampling variation describes the randomness of observed patient outcomes given the model parameters, while between-basket treatment-effect variation describes differences among the basket-specific true effects.

Separating the two matters because a noisy estimate for one basket does not, by itself, imply that its true effect differs from other baskets. Conversely, a collection of precise basket estimates may still show genuine differences in treatment effect. A hierarchical model represents these sources in different components, rather than treating every observed difference as evidence of heterogeneity.

Definition: Patient-level sampling variation is the variability in patient outcomes generated by the outcome model conditional on its parameters, including the basket-specific treatment effect. Between-basket treatment-effect variation is the variability of the true basket-specific treatment effects around a common distributional center. The first is within baskets; the second is among baskets.

Where the Sources Appear in a Model

For a binary endpoint, let \(Y_{ij}\) be the response indicator for patient \(i\) in basket \(j\), with \(Y_{ij}=1\) for a response and \(Y_{ij}=0\) otherwise. Let \(x_{ij}\) indicate treatment assignment, and let \(\alpha_j\) represent the basket-specific baseline log odds. One illustrative model is

$$ Y_{ij}\mid p_{ij}\sim\operatorname{Bernoulli}(p_{ij}),\qquad \operatorname{logit}(p_{ij})=\alpha_j+x_{ij}\delta_j,\qquad \delta_j\sim N(\mu_\delta,\tau^2). $$

Conditional on \(p_{ij}\), the Bernoulli outcome is random. Its variance is \(p_{ij}(1-p_{ij})\), the patient-level component. The parameter \(\delta_j\) is the true treatment effect for basket \(j\), on the log-odds scale. The distribution of \(\delta_j\) across baskets has variance \(\tau^2\), the between-basket treatment-effect variance. The baseline term \(\alpha_j\) represents baseline risk differences; it is not the treatment-effect variance.

This specification assumes that outcomes are conditionally independent across patients given the model parameters, that the Bernoulli likelihood is appropriate, and that the basket effects follow the stated normal distribution. In a randomized trial, \(x_{ij}\) encodes assigned treatment; interpretation of \(\delta_j\) as a treatment contrast also relies on the trial’s design and the adequacy of the outcome model. Other link functions and outcome distributions can be used, but the distinction remains: the patient outcome distribution describes within-basket randomness, and the distribution of basket-specific effects describes between-basket variation.

For a continuous endpoint, a corresponding model might be

$$ Y_{ij}=\alpha_j+x_{ij}\delta_j+\varepsilon_{ij},\qquad \varepsilon_{ij}\sim N(0,\sigma^2),\qquad \delta_j\sim N(\mu_\delta,\tau^2). $$

Here \(\sigma^2\) is the residual variance among patients conditional on their basket and treatment effect; \(\tau^2\) is the variance of true treatment effects across baskets. This model assumes independent, normally distributed residuals with common variance and normally distributed basket effects. The assumptions are modeling choices, not consequences of having multiple baskets. If residual variability differs by arm or basket, a common \(\sigma^2\) may be inadequate.

Worked Example: Sampling Error in a Binary Basket

Suppose, hypothetically, that 20 treated patients in one basket have 12 responses. The estimated response probability is \(\hat p=12/20=0.60\). Under a binomial model, the estimated standard error of this sample proportion is

$$ SE(\hat p)\approx\sqrt{\frac{\hat p(1-\hat p)}{n}} =\sqrt{\frac{0.60(0.40)}{20}} =\sqrt{0.012} =0.1095. $$

The estimate is therefore subject to substantial patient-level sampling variation: a different sample of 20 patients from a basket with the same response probability could produce a different response proportion. The standard error is in response-probability units, so it is about 10.95 percentage points. It does not estimate the standard deviation of true treatment effects across baskets. In particular, this calculation contains no comparison with other baskets and does not estimate \(\tau\).

How Sampling Error and Heterogeneity Combine

Basket-specific estimates vary for two reasons: their underlying true effects may differ, and each estimate is noisy because it is based on a finite number of patients. A simple normal approximation makes the distinction explicit. Suppose an estimated basket effect \(\hat\delta_j\) has conditional sampling variance \(s_j^2\), and the basket effects have variance \(\tau^2\):

$$ \hat\delta_j\mid\delta_j\sim N(\delta_j,s_j^2),\qquad \delta_j\sim N(\mu_\delta,\tau^2). $$

The first variance, \(s_j^2\), is the sampling variance of the estimate within basket \(j\). The second, \(\tau^2\), is the variance among true effects. To find the marginal variance of the estimate, use the variance decomposition \(\operatorname{Var}(A)=E\{\operatorname{Var}(A\mid B)\}+\operatorname{Var}\{E(A\mid B)\}\). Here \(A=\hat\delta_j\) and \(B=\delta_j\), so the conditional mean is \(\delta_j\) and the conditional variance is \(s_j^2\). Therefore,

$$ \operatorname{Var}(\hat\delta_j) =E(s_j^2)+\operatorname{Var}(\delta_j) =s_j^2+\tau^2, $$

when \(s_j^2\) is treated as fixed. Thus, a wide observed spread of estimates can reflect large sampling errors, substantial effect heterogeneity, or both. It is not valid to label the entire spread as between-basket variation without accounting for the precision of each estimate.

Worked Example: Interpreting Continuous-Outcome Variances

Consider a hypothetical continuous-endpoint trial with 25 patients assigned to each arm in a basket. Suppose the residual standard deviation is \(\sigma=10\) outcome points in both arms, and the model assigns a between-basket treatment-effect standard deviation \(\tau=4\) points. Assume independent residuals and the continuous model stated above.

Within this basket, the estimated treatment contrast is the treated sample mean minus the control sample mean. Conditional on the basket’s true effect, its sampling variance is

$$ \operatorname{Var}(\hat\delta_j\mid\delta_j) =\frac{\sigma^2}{25}+\frac{\sigma^2}{25} =\frac{100}{25}+\frac{100}{25} =8\ \text{points}^2. $$

Its sampling standard error is \(\sqrt{8}=2.828\) points. Across baskets, the true effects have variance \(\tau^2=4^2=16\ \text{points}^2\). Consequently, the marginal variance of the observed contrast across baskets is \(8+16=24\ \text{points}^2\), with standard deviation \(\sqrt{24}=4.899\) points. The 2.828-point standard error describes uncertainty from the patients sampled within one basket; the 4-point standard deviation describes modeled variation in the true effects across baskets. Neither number can be substituted for the other.

Worked Example: Why Observed Spread Does Not Equal Heterogeneity

Suppose three hypothetical basket-effect estimates, all measured in outcome points, are \(2\), \(5\), and \(1\). Assume each has the same known sampling standard error of 2 points. The mean estimate is

$$ \bar{\delta}=\frac{2+5+1}{3}=\frac{8}{3}=2.667. $$

The sample variance of these three estimates is

$$ s_{\hat\delta}^2= \frac{(2-2.667)^2+(5-2.667)^2+(1-2.667)^2}{3-1} =\frac{0.444+5.444+2.778}{2} =4.333\ \text{points}^2. $$

This observed variance is close to the sampling variance of \(2^2=4\ \text{points}^2\) for each estimate. Under the equal-precision normal model, the expected observed variance is \(\tau^2+4\). A simple moment calculation would subtract 4, giving \(4.333-4=0.333\ \text{points}^2\) as a rough estimate of \(\tau^2\). With only three baskets, this subtraction is highly uncertain; it is not proof that heterogeneity is exactly 0.333, nor that it is absent. The example shows why noisy estimates must be distinguished from true-effect variation.

What a Variance Component Does—and Does Not—Say

The variance components answer different scientific and statistical questions. Patient-level variation concerns how much outcomes fluctuate among individuals under a given basket’s parameters. Between-basket treatment-effect variation concerns how widely true treatment effects differ across the modeled basket population. Posterior uncertainty about \(\delta_j\) or \(\tau\) is a third concept: it describes uncertainty about unknown parameters after observing data. A parameter can have a posterior distribution even if the model sets \(\tau=0\), and a positive \(\tau\) does not imply that every basket’s effect is estimated precisely.

For a binary endpoint, \(p_{ij}(1-p_{ij})\) is the conditional outcome variance for an individual response indicator. It is on the response-indicator scale, whereas \(\tau^2\) in the logistic model is on the squared log-odds scale. These variances should not be added directly: they are on different scales and refer to different random quantities. The simple addition \(s_j^2+\tau^2\) applies to estimates and effects expressed on the same scale under the stated normal approximation.

A further distinction is essential when baseline risks differ. Baskets can have different response probabilities even if their treatment effects are identical, because their baseline risks \(\alpha_j\) differ. Comparing raw response proportions across baskets therefore does not isolate treatment-effect heterogeneity. The model must represent baseline risk and treatment effects as separate quantities when both may vary.

Alternatives, Limitations, and Common Mistakes

ApproachWhat it assumes about true effectsHow it treats observed differences
Common-effect modelOne shared treatment effect; no between-basket effect varianceDifferences among estimates arise from sampling variation under the model
Basket-specific independent analysesEach basket has its own effect, without a shared distributionEstimates are analyzed separately; sampling error remains, but no common heterogeneity distribution is used
Hierarchical random-effects modelBasket effects vary around a distribution with variance \(\tau^2\)Observed differences reflect both sampling variation and true-effect variation

These approaches are not interchangeable. A common-effect model rules out between-basket treatment-effect variation; an independent analysis does not estimate a common distribution of effects; and a hierarchical model introduces assumptions about that distribution. Sparse data may provide little information to distinguish the components, especially when each basket has few patients or there are few baskets. Results can then depend materially on modeling assumptions and prior information. A hierarchical model cannot manufacture information that the trial does not contain.

A common mistake is to see different observed response rates and conclude that treatment effects differ across baskets. That reasoning confuses observed outcomes with true effects and ignores both patient-level randomness and baseline-risk differences. The correction is to identify the modeled quantity first: patient outcomes vary through the likelihood, basket-specific effects vary through the random-effects distribution, and estimates remain uncertain because data are finite.

Another mistake is to interpret \(\tau\) as a patient-level standard deviation or as the standard error of a basket estimate. It is neither. Its scale is the scale of the basket-specific treatment effect, and it describes the spread of true effects under the hierarchical model. The estimate’s standard error instead depends on the within-basket data and the outcome model.

Key takeaway: Locate each source of variation in the model before interpreting an observed spread. The likelihood governs patient-level sampling variation; the distribution of basket-specific treatment effects governs between-basket heterogeneity; posterior uncertainty concerns what is known about either component.

Check Your Understanding

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

  1. In a binary model, which component represents patient-level response randomness, and which represents variation in true treatment effects across baskets?
  2. A continuous basket-specific treatment estimate has sampling variance \(9\ \text{points}^2\), while the modeled between-basket variance is \(16\ \text{points}^2\). Under the normal approximation, what is the marginal variance of the estimate?
  3. Why can different observed response proportions across baskets occur even when treatment effects are identical?
  4. Does a posterior standard deviation for a basket effect equal the between-basket standard deviation \(\tau\)? Explain briefly.

Solutions. (1) The Bernoulli likelihood represents patient-level response randomness; the distribution of the basket effects, such as \(\delta_j\sim N(\mu_\delta,\tau^2)\), represents between-basket treatment-effect variation. (2) The marginal variance is \(9+16=25\ \text{points}^2\), assuming the stated normal model and a fixed sampling variance. (3) Finite patient samples fluctuate, and baskets may have different baseline risks; raw proportions need not be equal even when treatment effects are. (4) No. The posterior standard deviation measures uncertainty about a particular basket effect given the model and data; \(\tau\) is the standard deviation of true effects across baskets under the hierarchical distribution.

Clinical Biostats