What an Effective Sample Size Measures
A hierarchical model lets information from one basket influence estimates for another. That influence is useful when baskets are sufficiently alike, but it can be hard to describe in patient counts. An effective sample size (ESS) expresses the precision of a subgroup estimate on the scale of an equivalent number of independent observations. It is a measure of uncertainty under a specified benchmark—not a count of patients actually enrolled or a direct measure of whether borrowing is appropriate.
There is no single, model-free ESS for every Bayesian analysis. The calculation depends on the outcome model, the parameter being estimated, the uncertainty measure being matched, and the reference analysis. This tutorial uses posterior-variance matching: compare the variance of the hierarchical posterior for a basket-specific parameter with the variance that independent data of a specified size would produce. The resulting number describes equivalence in variance only; it does not assert that the two posterior distributions have the same shape or center.
Variance Matching for a Normal Basket Endpoint
Suppose the endpoint is a continuous outcome, and basket \(k\) has \(n_k\) patients with sample mean \(\bar{x}_k\). Use the following benchmark model: conditional on the basket mean \(\theta_k\), patient outcomes are independent normal observations with known within-basket variance \(\sigma^2\). Then \(\bar{x}_k\) has sampling variance \(\sigma^2/n_k\). An independent analysis with a flat prior for \(\theta_k\) has posterior variance \(\sigma^2/n_k\).
If the hierarchical posterior variance is \(v_k\), define the variance-matched total ESS as \(\sigma^2/v_k\). The difference between this total and \(n_k\) is the equivalent amount of borrowed information, on the same sampling scale. This interpretation requires that the benchmark variance \(\sigma^2\) be appropriate and that the posterior variance be finite. If the hierarchical posterior is more uncertain than the independent benchmark, the difference is negative: it is not sensible to report that as a positive number of borrowed patients.
The borrowed ESS is an equivalent precision increment. It is not necessarily an integer. It also depends on the chosen reference variance: changing the benchmark changes the patient-equivalent scale. These definitions are especially transparent when the reference analysis has a flat prior and the within-basket variance is known. If the model uses a non-flat baseline prior, its precision must be accounted for separately rather than automatically attributed to other baskets.
Worked Example: A Normal Basket With a Known Hierarchical Prior
Consider a hypothetical basket with \(n_k=8\) patients, sample mean \(\bar{x}_k=12.0\) units, and known within-basket variance \(\sigma^2=16\) units squared. Suppose that, conditional on information from the other baskets, the prior for this basket’s mean is \(N(10,10/3)\). Use posterior-variance matching to calculate total and borrowed ESS.
The subgroup mean has sampling variance \(16/8=2\), so its likelihood precision is \(1/2=0.5\) per squared unit. The prior precision is \(1/(10/3)=0.3\) per squared unit. For a normal likelihood and normal prior, posterior precision is the sum of these precisions:
Thus \(v_k=1/0.8=1.25\) units squared. The mean is \((0.5\times12.0+0.3\times10)/0.8=11.25\) units, though the ESS calculation uses the posterior variance, not the posterior mean. The variance-matched total ESS is \(16/1.25=12.8\) patients, and the borrowed ESS is \(12.8-8=4.8\) patients. On this benchmark, the posterior uncertainty is equivalent to that from 12.8 independent observations with variance 16, of which 8 are in the target basket. The 4.8 is an information equivalence, not a claim that 4.8 other patients were observed or that the other baskets truly match this one.
Why the Precision Formula Works
The normal example follows from a general property of normal updating. A likelihood for the basket mean with variance \(\sigma^2/n_k\) contributes precision \(n_k/\sigma^2\). A normal prior with variance \(\tau^2\) contributes precision \(1/\tau^2\). With independent likelihood and prior contributions, the posterior precision is their sum. The equivalent independent sample size is the posterior precision multiplied by \(\sigma^2\), because each independent observation contributes \(1/\sigma^2\) precision.
Therefore, in this special case, \(\sigma^2/\tau^2\) is the borrowed ESS. This is an exact result when the prior is normal with known variance and represents information supplied independently of the target basket’s likelihood. It is not a universal shortcut for a random-effects model whose variance and mean are estimated from the basket data. In that setting, use the posterior uncertainty under the fitted model, including uncertainty in hyperparameters, and match it to a declared benchmark.
Using Marginal Posterior Uncertainty
In a fitted hierarchical model, \(\theta_k\) may have a marginal posterior distribution that averages over uncertainty in the overall mean, heterogeneity, and other model parameters. A practical variance-matching calculation uses the marginal posterior variance \(\operatorname{Var}(\theta_k\mid D)\), where \(D\) denotes all observed data. For a normal endpoint with the same known \(\sigma^2\) benchmark, substitute that posterior variance for \(v_k\). The resulting ESS includes the effects of estimating shared model quantities because those uncertainties are part of the marginal posterior.
In computation, estimate the variance from posterior draws \(\theta_k^{(1)},\ldots,\theta_k^{(M)}\):
Then calculate \(\sigma^2/\widehat{v}_k\) and subtract \(n_k\) for the borrowed equivalent. This requires posterior draws that adequately represent the marginal distribution; poor mixing or too few effective draws can make the variance estimate—and therefore the ESS—unstable. Check sampler diagnostics and assess whether the variance estimate is stable across runs or batches. This is a numerical check on the calculation, not evidence that the exchangeability assumptions are scientifically sound.
Worked Example: A Random-Effects Fit With Estimated Hyperparameters
Suppose a hypothetical continuous-outcome basket again has \(n_k=8\), and the benchmark within-basket variance is \(\sigma^2=16\) units squared. A random-effects model is fitted using this basket and other baskets, with uncertainty in the hierarchical parameters retained. Assume converged posterior draws give a marginal posterior variance for \(\theta_k\) of \(1.60\) units squared.
The independent benchmark variance for the target basket alone is \(16/8=2.00\) units squared. The fitted marginal variance is smaller, so the variance match yields:
Under this specified normal benchmark, the basket’s posterior variance is equivalent to the variance from 10 independent observations, or 2 equivalent observations beyond the 8 in the basket. This result summarizes uncertainty in \(\theta_k\); it does not identify which other basket contributed how much. The posterior mean and the evidence for clinical benefit are separate questions.
Binary Outcomes: A Local Information Approximation
For a binary endpoint, the normal formula using a fixed \(\sigma^2\) does not directly apply to the response probability \(p_k\). One local approximation uses the binomial sampling variance of a sample proportion near a reference value \(p^\ast\): \(p^\ast(1-p^\ast)/n\). If the hierarchical posterior variance for \(p_k\) is \(v_k\), a local variance-matched total ESS is \(p^\ast(1-p^\ast)/v_k\). The borrowed equivalent is this total minus \(n_k\).
This is an approximation, not an exact identity for a binomial hierarchy. It treats the variance function as approximately constant near \(p^\ast\), so it is most interpretable when posterior uncertainty is reasonably concentrated away from the boundaries 0 and 1. State the value used for \(p^\ast\), often the posterior mean, and do not treat the resulting ESS as an exact binomial sample size.
Worked Example: Local ESS for a Binary Basket
Suppose a hypothetical basket has \(n_k=20\) patients, of whom 8 respond, giving a sample proportion of \(8/20=0.40\). A hierarchical analysis gives posterior mean \(p^\ast=0.40\) and posterior variance \(v_k=0.0080\) for the basket response probability. Calculate a local variance-matched ESS.
At \(p^\ast=0.40\), the binomial variance factor is \(p^\ast(1-p^\ast)=0.40(0.60)=0.24\). The local total ESS is \(0.24/0.0080=30.0\). Subtracting the 20 patients in the target basket gives a local borrowed ESS of \(30.0-20=10.0\) patients.
For comparison, the independent sample-proportion variance at this reference value is \(0.24/20=0.0120\), larger than the hierarchical posterior variance of \(0.0080\). The calculation therefore expresses the reduced uncertainty as approximately 10 additional Bernoulli observations at response probability 0.40. Because the variance match is local, the result may change if another reference probability is used, and it does not imply that the hierarchical posterior equals a binomial posterior based on 30 responses or 30 patients.
Choosing and Reporting the Benchmark
An ESS is interpretable only when its benchmark is clear. For a continuous endpoint, report the assumed or reference within-basket variance, whether it is treated as known or estimated, the posterior variance used, and whether the reported quantity is total ESS or borrowed ESS. For a binary endpoint, report the reference probability and identify the calculation as a local approximation. If posterior draws are used, say that the variance is marginal over the hierarchical parameters.
| Quantity | What it summarizes | What it does not establish |
|---|---|---|
| Total ESS | Equivalent independent-sample precision under the stated benchmark | The actual number of patients contributing to the fit |
| Borrowed ESS | Total equivalent precision minus the target basket’s own sample size | That other baskets are exchangeable with the target basket |
| Posterior variance | Uncertainty about the basket parameter under the fitted model | Whether the parameter is clinically important or the model is well calibrated |
The independent basket analysis is a useful reference because it shows the uncertainty attributable to the target basket’s own data under a stated sampling model. Shared-effect and random-effects models provide different structures for sharing information, so the same basket and outcome can yield different ESS values under those models. An ESS comparison describes differences in posterior precision; it does not replace comparison of assumptions, fit, or clinical interpretation.
The central assumptions are that the within-basket sampling model is appropriate, the variance benchmark is relevant, the posterior variance is estimated reliably, and the model’s cross-basket structure is defensible. In a hierarchical analysis, the last assumption includes the scientific judgment that the baskets can be related through the chosen population distribution. ESS alone cannot verify that judgment. Posterior predictive checks and other model diagnostics remain important.
Common Misinterpretation
Incorrect reasoning: “The borrowed ESS is 4.8, so the target basket has 4.8 additional patients, and the other baskets must be sufficiently similar.” The calculation does not support either conclusion. It says only that, under the specified benchmark, the posterior variance matches the variance from 4.8 additional independent observations beyond the target basket’s own data. Similarity and model adequacy need separate scientific and statistical assessment. Also, a small or negative borrowed ESS can arise from the fitted posterior uncertainty and benchmark; it is not automatically a computational error.
Check Your Understanding
Answer each question, then check the brief solutions below.
- For a normal endpoint with known \(\sigma^2=9\), \(n_k=6\), and hierarchical posterior variance \(v_k=1.00\), calculate total and borrowed ESS.
- Why must a report state the reference variance used for a normal-outcome ESS?
- A binary basket has \(n_k=15\), posterior mean \(p^\ast=0.20\), and posterior variance \(0.0064\). Calculate the local total ESS and borrowed ESS.
- Does a borrowed ESS of 3.2 establish that other baskets are exchangeable with the target basket? Explain.
Solutions. (1) Total ESS is \(9/1.00=9.0\); borrowed ESS is \(9.0-6=3.0\). (2) The variance determines how much precision corresponds to one independent observation, so changing the benchmark changes the patient-equivalent scale. (3) The local variance factor is \(0.20(0.80)=0.16\); total ESS is \(0.16/0.0064=25.0\), and borrowed ESS is \(25.0-15=10.0\). (4) No. The number is an uncertainty equivalence under the fitted model and stated benchmark; it does not validate the model’s exchangeability assumptions.