Tutorials › Bayesian Clinical Trials › Cost-Constrained Sample Size and Allocation

Sample Size, Power and Assurance · Tutorial 259 of 696

Cost-Constrained Sample Size and Allocation

Learn to maximize Bayesian assurance under a trial budget by linking arm allocation, sampling variance and the probability of meeting a posterior success rule.

Advanced 12 min read

What You'll Learn

  • Define assurance for a cost-constrained Bayesian trial design.
  • Derive the continuous cost-efficient allocation for two independent treatment arms.
  • Calculate assurance under a normal prior and known-variance likelihood.
  • Compare integer-feasible sample sizes under the same budget.
  • Identify when cost-optimal allocation may not maximize assurance.
  • Check design assumptions and conduct sensitivity analyses.

Why Cost and Allocation Belong in the Same Decision

A trial design is not chosen from sample size alone. When treatment and control participants have different recruitment costs, the same budget permits different numbers in each arm. The allocation affects the precision of the treatment-effect estimate, which in turn affects the probability that the trial will satisfy its Bayesian success rule. The design question is therefore: among feasible sample sizes and allocations, which gives the greatest assurance within the available budget?

Assurance is the prior-predictive probability of meeting a prespecified success criterion. It averages over both the design prior for the treatment effect and the sampling distribution of the future data. It differs from power calculated at one fixed treatment effect: assurance incorporates the design prior’s uncertainty about which effect will occur. This tutorial focuses on the cost and allocation calculation; the success rule and model must be specified before comparing designs.

Definition: For design \(d\), let \(Y\) denote the future data and let \(S(Y,d)\) be 1 if the prespecified Bayesian success criterion is met and 0 otherwise. The design’s assurance is \(A(d)=E_{\theta\sim\pi}\{P(S(Y,d)=1\mid\theta,d)\}\), where \(\pi\) is the design prior for the treatment effect. Equivalently, assurance is the probability of success under the joint distribution generated by the design prior and the trial’s sampling model.

For two independent arms, let \(n_T\) and \(n_C\) be the treatment and control sample sizes, and let \(c_T\) and \(c_C\) be their respective per-participant costs. With a variable recruitment budget \(B\), a feasible design must satisfy \(c_Tn_T+c_Cn_C\leq B\), as well as any minimum, maximum or integer constraints. Fixed costs should be subtracted from the available budget before applying this constraint. A design with larger total \(n_T+n_C\) need not be better: how participants are distributed between arms matters.

A Normal Model That Makes the Link Explicit

Consider a continuous endpoint where the arm means are independent normal observations with known standard deviations \(\sigma_T\) and \(\sigma_C\). Let \(\theta\) be the treatment-minus-control mean difference, so that positive values favour treatment, and suppose the design prior is \(\theta\sim N(\mu_0,\tau^2)\). The observed difference in sample means, \(D=\bar{Y}_T-\bar{Y}_C\), has sampling variance \(v=\sigma_T^2/n_T+\sigma_C^2/n_C\). These assumptions give a normal posterior with variance \(V\) and mean \(m\):

$$ V=\left(\frac{1}{\tau^2}+\frac{1}{v}\right)^{-1}, \qquad m=V\left(\frac{\mu_0}{\tau^2}+\frac{D}{v}\right). $$

As a specific success rule, suppose success requires the posterior probability that the treatment effect exceeds a clinically relevant threshold \(\delta\) to be at least \(q\): \(P(\theta>\delta\mid D)\geq q\). For a normal posterior, this is equivalent to \(m\geq\delta+z_q\sqrt V\), where \(z_q\) is the \(q\) quantile of the standard normal distribution. Under the prior-predictive distribution, \(m\) is normal with mean \(\mu_0\) and variance \(\tau^2-V\). Thus, for a fixed design, assurance can be calculated as:

$$ A(n_T,n_C) = 1-\Phi\left( \frac{\delta+z_q\sqrt V-\mu_0}{\sqrt{\tau^2-V}} \right), $$

where \(\Phi\) is the standard normal cumulative distribution function. This expression applies when \(V\) is fixed by the design and the posterior success rule is the one just stated. In other models, or with a different success rule, assurance may need to be evaluated by numerical integration or simulation.

Derivation: The posterior variance \(V\) is constant across possible trial outcomes for this known-variance normal model. The law of total variance gives \(\operatorname{Var}(\theta)=\operatorname{Var}\{E(\theta\mid D)\}+E\{\operatorname{Var}(\theta\mid D)\}\). Since \(E(\theta\mid D)=m\), \(\operatorname{Var}(\theta)=\tau^2\), and \(\operatorname{Var}(\theta\mid D)=V\), it follows that \(\operatorname{Var}(m)=\tau^2-V\). Also \(E(m)=\mu_0\). The success event is \(m\geq\delta+z_q\sqrt V\); taking its probability under \(m\sim N(\mu_0,\tau^2-V)\) yields the assurance formula.

Worked Example: Calculating Assurance for a Feasible Design

Worked Example: Calculating Assurance for a Feasible Design

Suppose the endpoint standard deviation is known to be 10 points in each arm, and the design prior is \(\theta\sim N(0,100)\), with \(\theta\) measured in points. Success is defined as \(P(\theta>2\mid D)\geq0.95\). Consider \(n_T=35\) and \(n_C=50\). Calculate its assurance under the model above.

The sampling variance of the difference in means is \(v=10^2/35+10^2/50=2.85714+2.00000=4.85714\) points squared. The posterior variance is \(V=(1/100+1/4.85714)^{-1}=4.63215\) points squared, so \(\sqrt V=2.15224\) points. With \(z_{0.95}=1.644854\), the posterior-mean threshold for success is \(2+1.644854(2.15224)\approx5.5401\) points.

The prior-predictive standard deviation of the posterior mean is \(\sqrt{100-4.63215}=\sqrt{95.36785}\approx9.76565\) points. Therefore, \(A=1-\Phi(5.5401/9.76565)=1-\Phi(0.5673)\approx1-0.7148=0.2852\).

The design’s assurance is approximately 0.285, or 28.5%. This is the prior-predictive probability of meeting the stated posterior success criterion, given the model and design prior. It is not a 28.5% probability that the treatment works, nor is it power at a single value of \(\theta\).

Continuous Cost Allocation and Its Limits

A useful first calculation is to find the allocation that minimizes sampling variance for a fixed variable-cost budget, before enforcing integer sample sizes. For independent arms, the variance is \(v=\sigma_T^2/n_T+\sigma_C^2/n_C\). Minimizing this expression subject to \(c_Tn_T+c_Cn_C=B\), with positive costs and sample sizes, gives the continuous allocation ratio:

$$ \frac{n_T}{n_C} = \sqrt{\frac{\sigma_T^2c_C}{\sigma_C^2c_T}}. $$

For equal endpoint variances, this reduces to \(n_T/n_C=\sqrt{c_C/c_T}\): the less costly arm receives more participants, but generally not in inverse proportion to cost. This ratio is a variance-minimizing result for the stated model and budget constraint. It is not a universal assurance-maximizing rule. In particular, assurance need not be a monotone function of precision for every prior, success criterion or model. The final decision should compare assurance itself over the feasible designs.

In the normal example above, with a prior centred below the success threshold, reducing \(V\) lowers the posterior-mean threshold \(\delta+z_q\sqrt V\) and increases the prior-predictive standard deviation \(\sqrt{\tau^2-V}\). Both changes increase the assurance in this particular setup. Consequently, minimizing \(v\) also maximizes assurance here. That conclusion relies on this model and rule; it should not be assumed for other decision criteria.

Worked Example: Comparing Allocations Under a Fixed Budget

Continue with equal known standard deviations of 10 points, prior \(\theta\sim N(0,100)\), and success rule \(P(\theta>2\mid D)\geq0.95\). Suppose treatment recruitment costs 2 budget units per participant, control recruitment costs 1 unit, and the budget is 120 units. Compare three feasible designs: \((n_T,n_C)=(35,50)\), \((30,60)\), and \((20,80)\).

Each uses the full budget: \(2(35)+50=120\), \(2(30)+60=120\), and \(2(20)+80=120\). For \((35,50)\), the calculation in the preceding example gives \(v=4.85714\), \(V=4.63215\), and assurance approximately 0.2852.

For \((30,60)\), \(v=100(1/30+1/60)=5.00000\). Then \(V=(1/100+1/5)^{-1}=4.76190\), and \(\sqrt V\approx2.18218\). The success threshold is \(2+1.644854(2.18218)\approx5.5894\); the posterior-mean predictive standard deviation is \(\sqrt{100-4.76190}\approx9.7590\). Assurance is \(1-\Phi(5.5894/9.7590)=1-\Phi(0.5728)\approx0.2833\).

For \((20,80)\), \(v=100(1/20+1/80)=6.25000\). Thus \(V=(1/100+1/6.25)^{-1}=5.88235\), and \(\sqrt V\approx2.42536\). The success threshold is \(2+1.644854(2.42536)\approx5.9889\), while the predictive standard deviation is \(\sqrt{100-5.88235}\approx9.7014\). Assurance is \(1-\Phi(5.9889/9.7014)=1-\Phi(0.6173)\approx0.2685\).

The 35/50 allocation has the highest assurance among these candidates. Although 30/60 and 40/40 would have the same sampling variance of 5 points squared, 40/40 would cost 120 units too; the comparison illustrates that equal total cost does not imply equal precision. The assurance differences are modest, so decision-makers should also consider the model assumptions and the consequences of the selected success threshold.

Worked Example: Unequal Variances and a Cost-Efficient Starting Point

Worked Example: Unequal Variances and a Cost-Efficient Starting Point

Suppose the known endpoint standard deviations are 12 points in treatment and 8 points in control. Per-participant costs are 3 units for treatment and 1 unit for control, and the variable-cost budget is 300 units. Use the continuous allocation result to find an integer design near the variance-minimizing ratio, then compare it with a feasible alternative.

The ratio is \(n_T/n_C=\sqrt{(12^2)(1)/(8^2\cdot3)}=\sqrt{144/192}=\sqrt{0.75}\approx0.8660\). Combining this ratio with \(3n_T+n_C=300\) gives approximately \(n_C=83.38\) and \(n_T=72.22\). The integer design \(n_T=72,n_C=84\) spends \(3(72)+84=300\) units and is close to that ratio.

Its sampling variance is \(v=144/72+64/84=2+0.76190=2.76190\) points squared. For illustration, retain the design prior \(N(0,100)\) and success rule \(P(\theta>2\mid D)\geq0.95\). Then \(V=(1/100+1/2.76190)^{-1}\approx2.6877\), \(\sqrt V\approx1.6394\), and the success threshold is \(2+1.644854(1.6394)\approx4.696\) points. The predictive standard deviation is \(\sqrt{100-2.6877}\approx9.864\), giving assurance \(1-\Phi(4.696/9.864)\approx1-\Phi(0.4759)\approx0.317\).

As a feasible alternative, allocate \(n_T=50,n_C=150\), also at cost \(3(50)+150=300\). Its sampling variance is \(144/50+64/150=2.8800+0.4267=3.3067\) points squared. This gives \(V\approx3.2008\), a success threshold of approximately \(2+1.644854\sqrt{3.2008}=4.943\) points, and predictive standard deviation \(\sqrt{100-3.2008}\approx9.839\). Assurance is approximately \(1-\Phi(4.943/9.839)=1-\Phi(0.5024)\approx0.308\). Under these illustrative assumptions, the near-optimal allocation has higher assurance.

How to Make the Design Comparison Dependable

In a real design, the continuous ratio is a starting point, not the final answer. Sample sizes must be whole numbers, and practical restrictions may impose minimum arm sizes, a cap on total recruitment, site-specific limits, or a minimum control group. A useful comparison evaluates every feasible integer allocation, or a sufficiently broad candidate set when enumeration is impractical. For each candidate, calculate assurance using the same prior, outcome model and success rule. If assurance is estimated by simulation, Monte Carlo error can obscure small differences; account for that error before claiming one design is better.

The comparison also depends on what “cost” means. Costs may include screening, treatment supply, monitoring, follow-up, and fixed study expenses. If costs differ across arms, use the cost per randomized participant appropriate to the budget, not an unrelated downstream cost. If attrition is expected, distinguish the number randomized from the number whose outcomes contribute information, and use assumptions consistent with the analysis model. A cost calculation cannot compensate for an incorrect model of the information supplied by participants.

Before relying on a selected design, check whether the result is robust to plausible changes in treatment effect prior, outcome variability, recruitment cost and success threshold. A design that barely meets a target assurance under one optimistic assumption may be fragile. Also inspect whether the selected allocation is operationally acceptable: a mathematically efficient ratio may be unsuitable if it leaves too few participants in an arm for safety monitoring or planned subgroup descriptions.

ApproachWhat it answersMain limitation
Cost-efficient variance allocationWhich continuous allocation minimizes sampling variance under a specified cost constraint?Does not itself guarantee maximum assurance under an arbitrary decision rule.
Equal allocationWhat if the trial assigns the same number to each arm?May spend the budget less efficiently when costs or variances differ.
Direct assurance comparisonWhich feasible design gives the greatest probability of satisfying the stated Bayesian success rule?Requires the model, prior and success rule, and may require computation for each candidate.

Common Pitfalls and Practical Limits

  • Optimizing total sample size alone. The same total \(n_T+n_C\) can yield different precision and cost. Calculate the arm-specific sampling variance and the actual budget use.
  • Treating the continuous ratio as the final design. Real participants come in whole numbers, and constraints can change the best feasible choice. Enumerate or compare integer candidates after deriving the ratio.
  • Calling cost-optimal allocation assurance-optimal in every setting. The variance-minimizing ratio is not a general theorem about all posterior criteria. Evaluate assurance directly when the assumptions that make assurance increase with precision do not hold.
  • Ignoring uncertainty in design inputs. Prior spread, standard deviations and costs are assumptions. Examine plausible scenarios rather than presenting one assurance estimate as certain.
  • Confusing assurance with the probability that a treatment is effective. Assurance concerns the chance that future data will satisfy a specified decision rule, averaged over the design prior. It is not a posterior probability about the true effect before the trial.

The method is limited by the quality of its inputs and model. Known variances, independent outcomes and a normal likelihood are convenient assumptions for the calculations shown, not universal features of clinical trials. More complex endpoints, uncertain nuisance parameters, covariate adjustment, or non-normal decision rules may require simulation. The same principle remains: define feasible designs, compute the success probability under each design’s assumed joint distribution, and compare assurance alongside cost and operational requirements.

Check Your Understanding

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

  1. If control costs twice as much per participant as treatment and the arm variances are equal, which arm receives more participants in the continuous variance-minimizing allocation?
  2. Under a fixed budget, why is the allocation with the largest total sample size not necessarily the allocation with the greatest assurance?
  3. For equal known standard deviations, a design has \(n_T=25,n_C=100\), with each standard deviation equal to 10. Calculate the sampling variance of the treatment-control mean difference.
  4. State one reason the continuous cost-efficient allocation may not be the final trial design.

Solutions. (1) Treatment receives more participants: \(n_T/n_C=\sqrt{c_C/c_T}=\sqrt{2}\), because treatment is the less costly arm. (2) Allocation affects the two arm contributions to sampling variance, and assurance depends on the resulting data distribution and success rule, not only on the total number enrolled. (3) \(v=100(1/25+1/100)=100(0.04+0.01)=5\) points squared. (4) Sample sizes must be integers, and operational limits or other constraints may rule out the continuous optimum; compare feasible integer designs instead.

Clinical Biostats