Signature
a = mu_t - I / P; s_m = sigma_X * sqrt(m / (n_t * (n_t + m))); z = abs(a) / s_m; phi_z = exp(-z * z / 2) / sqrt(2 * 3.14159265); EVSI_I = s_m * (phi_z - z * Q_z); Delta = P * EVSI_I - m * c + d_on * m * mu_t
| Inputs | Definition | Unit |
|---|---|---|
mu_t | Posterior mean, at the interim look, of the expected incremental net monetary benefit of the new technology, the mean of one pair's observation | currency per patient |
I | One-time cost of switching to the new technology if it is adopted, zero or above | currency |
P | Number of patients whose treatment the adoption decision informs after the trial | patients |
sigma_X | Standard deviation of one pair's incremental net monetary benefit observation, taken as known | currency per patient |
m | Number of further pairwise allocations in the one-stage plan, above zero | patient pairs |
n_t | Effective sample size of the interim posterior, the prior effective sample size plus the pairs observed | patient pairs |
Q_z | Probability that a standard normal variable exceeds z, entered as an input from 1-NORM.S.DIST(z,TRUE) | probability |
c | Cost of making one more pairwise allocation | currency per pair |
d_on | Indicator equal to 1 when the rewards of trial participants enter the reward and 0 when they do not | none |
a | Interim posterior mean less the switching cost divided by the number of patients informed | currency per patient |
|---|---|---|
s_m | Standard deviation, across the results of m more pairs, of the posterior mean they would give, starting from interim effective sample size n_t | currency per patient |
z | Absolute value of a divided by s_m | standard deviations |
phi_z | Value of the standard normal density function at z | dimensionless |
EVSI_I | Expected value of sample information per patient of the m further pairs, taken about the threshold I/P | currency per patient |
Delta | One-stage expected gain of making m more pairwise allocations and then choosing, over stopping now | currency |
Function
Interim value of information function for the stop or continue decision in an ongoing trial
Maps the evidence held at an interim look of an ongoing trial, the size of the remaining sample, the population whose treatment the result will inform and the cost of continuing to the expected gain from continuing the trial over stopping it now. Vervaart and colleagues define the value of extending an ongoing study as the expectation, over the further data given the data already collected, of the largest posterior expected net benefit, less the largest expected net benefit given the data so far, so the baseline is the decision that would be made on the interim evidence (their equation 2). The general EVSI is HE-FN-EVSI-001, and for normal incremental net benefit the live formulas apply with interim inputs, the interim posterior mean in place of the prior mean in the closed form of HE-FM-EVSI-003 and the interim effective sample size in place of n0 in the preposterior variance of HE-FM-EVSI-002, with population scaling as in HE-FM-EVSI-004. The interim normal update is HE-FM-BAD-001, whose precision form gives the effective sample size form of Chick and colleagues when the prior variance is the sampling variance per pair divided by n0 and the data variance is that variance divided by the pairs observed. ENBS and its cost terms are HE-FN-ENBS-001 and HE-FM-ENBS-001 to HE-FM-ENBS-003, and the interim EVPI ceiling is HE-FM-EVPI-004 at the posterior standard deviation. This package adds the one-stage comparison of continuing with stopping in the model of Chick, Forster and Pertile with a switching cost and online learning, and its computational function runs the decision for one interim look. The net gain of continuing with the participants' opportunity loss is HE-FM-ENBS-001 for the remaining pairs, with the cost of HE-FM-ENBS-002 at n equal to 2m, a variable cost of c/2 per participant, a share of one half on the arm expected to be inferior and the cost of the further analysis in place of the committed fixed cost, so it is computed in the computational function and not restated. Group sequential stopping on clinical evidence by alpha spending (HE-FN-ASP-001) is a different rule. Notation follows the Adaptive Value of Information article.
Computational function
Computational function for the stop or continue decision at one interim look of a two-arm trial
Takes the design-stage prior for incremental net monetary benefit, the pairs observed and their mean at the interim look, the remaining pairs, the sampling standard deviation per pair, the patients informed and the costs, and returns the interim posterior, the per-patient and population EVSI of the remaining pairs, the offline gain of HE-FM-AVOI-001 with no switching cost, the net gain with the participants' loss and the decision. It chains the normal update of HE-FM-BAD-001 in effective sample size form, the preposterior variance of HE-FM-EVSI-002 with n_t in place of n0, the closed-form EVSI of HE-FM-EVSI-003 at the interim mean, HE-FM-AVOI-001, and HE-FM-ENBS-001 with the cost of HE-FM-ENBS-002 for the remaining pairs (n equal to 2m, a variable cost of c/2 per participant, a share of one half on the arm expected to be inferior and the analysis cost C_a in place of the fixed cost), so its inputs differ from the symbols of any one formula. The calculator takes Q_z from 1-NORM.S.DIST(z,TRUE) because it has no normal distribution function. The Excel, R and Python versions compute it and also scan every remaining size up to the maximum, continuing if any one-stage plan has a positive net gain, the KG* rule of Chick and colleagues.
Inputs and outputs:
mu_0is the design-stage prior mean of incremental net monetary benefit, in currency per patient, andn_0its effective sample size in pairs, above zero;m_1is the number of pairs observed by the interim look andxbar_1their mean incremental net monetary benefit;mis the number of remaining pairs, above zero;sigma_Xis the known standard deviation of one pair's observation;Pis the number of patients informed;cis the cost per pair andC_athe cost of the further analysis, in currency;Q_zis the standard normal upper-tail probability atz, a calculator input only;n_t,mu_tandsd_tare the interim effective sample size, posterior mean and posterior standard deviation;s_m,zandphi_zare the preposterior standard deviation, the standardised interim mean and the normal density at it;EVSIis per-patient EVSI of the remaining pairs andEVSI_popits population value;G_offis the offline one-stage gain with no switching cost;NGis the net gain with the participants' loss;gois 1 to continue and 0 to stop.Assumption: The prior and the pair observations are normal with known variance, outcomes are observed at once, there is no discounting and no switching cost. Fixed costs are treated as committed, as Forster and colleagues assume for ProFHER once the trial was commissioned, so only the remaining pairs and any further analysis are costed. The participant in each remaining pair on the arm expected to be inferior forgoes abs(mu_t), the participants' loss of HE-FM-ENBS-002 valued on the interim evidence; that valuation at an interim look is this package's application, since Fenwick and colleagues and Flight and colleagues value the loss on the information held before the study, and Flight and colleagues set it equal to the signed prior incremental net benefit, which equals its absolute value when that benefit is positive. Flight and colleagues note that the loss holds only if the new intervention cannot be used in practice before the trial ends and may be zero if it is potentially cost-effective and can be used while research is ongoing. It replaces the online learning term of HE-FM-AVOI-001 and is not added to it. A net gain of exactly zero gives go of 0, the strict inequality of the KG* rule. The check is one-stage, so a decision to continue also holds for the optimal sequential policy, while a decision to stop may come too early (HE-FM-AVOI-001).
Worked example (Article's interim look with a favourable signal): After 100 pairs with an illustrative mean of GBP 125, the design-stage prior of GBP 500 worth 25 pairs updates to a posterior mean of GBP 200 worth 125 pairs, the article's interim case. The remaining 100 pairs are worth about GBP 3.02 million, and after GBP 400,000 of sampling and GBP 20,000 for participants the net gain is about GBP 2.60 million, so the trial continues. The article's GBP 2.62 million is G_off, the offline gain that leaves the participants' loss out.
mu_0 = 500; n_0 = 25; m_1 = 100; xbar_1 = 125; m = 100; sigma_X = 10000; P = 20000; c = 4000; C_a = 0; Q_z = 0.3686578386; n_t = 125; mu_t = 200; sd_t = 894.427191; s_m = 596.284794; z = 0.33541; phi_z = 0.377121; EVSI = 151.14; EVSI_pop = 3022802; G_off = 2622802; NG = 2602802; go = 1Worked example (Article's interim look with an unfavourable signal): An illustrative interim mean of minus GBP 2,000 over 100 pairs gives the article's posterior mean of minus GBP 1,500. The remaining pairs are worth about GBP 22,772 in all and the net gain is about minus GBP 527,228; the scan in the code finds no smaller plan with a positive gain (the best, one pair, gives minus GBP 5,500), so the trial stops.
mu_0 = 500; n_0 = 25; m_1 = 100; xbar_1 = -2000; m = 100; sigma_X = 10000; P = 20000; c = 4000; C_a = 0; Q_z = 0.0059418946; n_t = 125; mu_t = -1500; sd_t = 894.427191; s_m = 596.284794; z = 2.515576; phi_z = 0.016857; EVSI = 1.14; EVSI_pop = 22772; G_off = -377228; NG = -527228; go = 0Worked example (No pairs observed yet, the article's design stage): With no data the interim posterior is the prior, and for 200 pairs the offline gain is about GBP 9.77 million, the article's design-stage ENBS, while the participants' loss of GBP 500 a pair lowers it to about GBP 9.67 million, a limiting case that checks the implementation.
mu_0 = 500; n_0 = 25; m_1 = 0; xbar_1 = 0; m = 200; sigma_X = 10000; P = 20000; c = 4000; C_a = 0; Q_z = 0.3954411615; n_t = 25; mu_t = 500; sd_t = 2000; s_m = 1885.618083; z = 0.265165; phi_z = 0.385161; EVSI = 528.55; EVSI_pop = 10570906; G_off = 9770906; NG = 9670906; go = 1Excel:
=PriorESS+FirstStagePairsin a cell named InterimESS,=(PriorESS*DesignPriorMean+FirstStagePairs*FirstStageMean)/InterimESSin InterimMeanINB,=SamplingSDPair*SQRT(RemainingPairs/(InterimESS*(InterimESS+RemainingPairs)))in PrepostSDRemaining,=PrepostSDRemaining*NORM.S.DIST(ABS(InterimMeanINB)/PrepostSDRemaining,FALSE)-ABS(InterimMeanINB)*(1-NORM.S.DIST(ABS(InterimMeanINB)/PrepostSDRemaining,TRUE))in EVSIRemaining and=PopBenefiting*EVSIRemaining-RemainingPairs*CostPerPair-FinalAnalysisCost-RemainingPairs*ABS(InterimMeanINB)in ContinueNetGain. For the scan, the sizes 1, 2 and onwards go in A2 downwards (named PairsGrid), B2 holds=PopBenefiting*(SamplingSDPair*SQRT(A2/(InterimESS*(InterimESS+A2)))*NORM.S.DIST(ABS(InterimMeanINB)/(SamplingSDPair*SQRT(A2/(InterimESS*(InterimESS+A2)))),FALSE)-ABS(InterimMeanINB)*(1-NORM.S.DIST(ABS(InterimMeanINB)/(SamplingSDPair*SQRT(A2/(InterimESS*(InterimESS+A2)))),TRUE)))-A2*(CostPerPair+ABS(InterimMeanINB))-FinalAnalysisCostfilled down (named GainGrid),=INDEX(PairsGrid,MATCH(MAX(GainGrid),GainGrid,0))returns the best size and=IF(MAX(GainGrid)>0,"Continue","Stop")the decision. Classic Excel functions only.R:
interim_voi <- function(mu0, n0, xbar1, m1, M, sigmaX, P, cpair, Ca) { nt <- n0+m1; mut <- (n0*mu0+m1*xbar1)/nt; m <- 1:M; s <- sigmaX*sqrt(m/(nt*(nt+m))); z <- abs(mut)/s; evsi <- s*(dnorm(z)-z*(1-pnorm(z))); ng <- P*evsi-m*cpair-Ca-m*abs(mut); k <- which.max(ng); list(mu_t = mut, NG_all = ng[M], best_m = m[k], NG_best = ng[k], decision = if (ng[k] > 0) "continue" else "stop") }Base R only; returns the interim mean, the net gain of all remaining pairs, the best one-stage size, its net gain and the decision.Python:
def interim_voi(mu0, n0, xbar1, m1, M, sigmaX, P, cpair, Ca): nd = statistics.NormalDist(); nt = n0+m1; mut = (n0*mu0+m1*xbar1)/nt; ng = [(P*s*(nd.pdf(abs(mut)/s)-abs(mut)/s*(1-nd.cdf(abs(mut)/s)))-m*cpair-Ca-m*abs(mut), m) for m in range(1, M+1) for s in [sigmaX*math.sqrt(m/(nt*(nt+m)))]]; best = max(ng); return mut, ng[-1][0], best[1], best[0], 'continue' if best[0] > 0 else 'stop'Needs the standard library modules math and statistics only, and returns the same five results as a tuple.Test (Effective sample size update equals the precision form of HE-FM-BAD-001): The interim mean from 25 prior pairs at GBP 500 and 100 observed pairs at GBP 125 equals the precision-weighted mean with prior variance 10,000 squared over 25 and data variance 10,000 squared over 100, GBP 200. Expected result TRUE. Excel check
=ABS((25*500+100*125)/125-(1/(1/(1E8/25)+1/(1E8/100)))*(500/(1E8/25)+125/(1E8/100)))<1E-9Test (Design-stage limiting case reproduces the article): With no pairs observed and 200 pairs planned, the offline gain equals the article's design-stage ENBS of about GBP 9,770,906. Expected result TRUE. Excel check
=ABS(20000*(SQRT(1E8*200/(25*225))*NORM.S.DIST(500/SQRT(1E8*200/(25*225)),FALSE)-500*(1-NORM.S.DIST(500/SQRT(1E8*200/(25*225)),TRUE)))-200*4000-9770906)<1Common error (Interim effective sample size left at the prior value): Keeping n_0 of 25 for the preposterior variance at the favourable interim look prices the remaining 100 pairs at about GBP 12.36 million instead of GBP 3.02 million and the net gain at about GBP 11.94 million instead of GBP 2.60 million, about four times the value of the remaining pairs, because the 100 pairs already observed are ignored (computed here for illustration).
Common error (Signed interim mean used for the participants' loss): At a posterior mean of minus GBP 1,500 the signed term adds GBP 150,000 to the gain instead of charging it, giving about minus GBP 227,228 instead of minus GBP 527,228, as if the participants on the new technology gained from it (computed here for illustration).
Source: Chick SE, Forster M, Pertile P. A Bayesian decision theoretic model of sequential experimentation with delayed response. Journal of the Royal Statistical Society Series B. 2017;79(5):1439-1462. Equations 2 and 3 for the interim posterior, equation 6 for the preposterior variance and equations 17 and 18 for the KG* rule. Flight L, Julious S, Brennan A, Todd S. Expected value of sample information to guide the design of group sequential clinical trials. Medical Decision Making. 2022;42(4):461-473. Methods, step 6, stage 5, equation 8 for the cost of sampling with analysis costs and the opportunity cost per participant on n/2 participants, and the discussion on when that cost holds. Fenwick E, Steuten L, Knies S, et al. Value of information analysis for research decisions, an introduction. Report 1 of the ISPOR Value of Information Analysis Emerging Good Practices Task Force. Value in Health. 2020;23(2):139-150. Section on estimating the value of specific research, for the opportunity cost of participants on the technology expected to be inferior. Forster M, Brealey S, Chick S, Keding A, Corbacho B, Alban A, Pertile P, Rangan A. Cost-effective clinical trial design, application of a Bayesian sequential model to the ProFHER pragmatic trial. Clinical Trials. 2021;18(6):647-656. Methods, implementation of the model, for fixed costs committed once the trial was commissioned.
n_t = n_0 + m_1; mu_t = (n_0 * mu_0 + m_1 * xbar_1) / n_t; sd_t = sigma_X / sqrt(n_t); s_m = sigma_X * sqrt(m / (n_t * (n_t + m))); z = abs(mu_t) / s_m; phi_z = exp(-z * z / 2) / sqrt(2 * 3.14159265); EVSI = s_m * (phi_z - z * Q_z); EVSI_pop = P * EVSI; G_off = EVSI_pop - m * c; NG = EVSI_pop - m * c - C_a - m * abs(mu_t); go = NG > 0
Try this function
Implementations
Excel
One-stage interim gain of continuing in Excel with named cells
With the inputs in cells named InterimMeanINB, SwitchCost, PopBenefiting, SamplingSDPair, RemainingPairs, InterimESS, CostPerPair and OnlineFlag, the first two formulas go in cells named GapINB and PrepostSDRemaining, and the third, in a cell named ContinueGainKG, returns Delta. NORM.S.DIST with FALSE gives the density and with TRUE the cumulative probability.
=InterimMeanINB-SwitchCost/PopBenefiting; =SamplingSDPair*SQRT(RemainingPairs/(InterimESS*(InterimESS+RemainingPairs))); =PopBenefiting*(PrepostSDRemaining*NORM.S.DIST(ABS(GapINB)/PrepostSDRemaining,FALSE)-ABS(GapINB)*(1-NORM.S.DIST(ABS(GapINB)/PrepostSDRemaining,TRUE)))-RemainingPairs*CostPerPair+OnlineFlag*RemainingPairs*InterimMeanINB
Assumptions
Normal interim posterior with known variance and outcomes observed at once
Each pair's incremental net monetary benefit is normal with known variance and the prior is normal, so the interim posterior is normal with mean mu_t and effective sample size n_t (equations 2 and 3 of Chick and colleagues), and the posterior mean after m more pairs is normal about mu_t with variance sigma_X squared over n_t times m over n_t plus m (their equation 6). Outcomes are taken to arrive at once and rewards are not discounted. With a delay, stopping still yields the outcomes of the pipeline patients, so the value of stopping in their equation 7 is itself an expectation over those outcomes, a case this formula does not cover.
Online and offline learning in the interim reward
With d_on of 1 the reward of each trial pair, its incremental net benefit, counts in addition to the P patients treated after the decision, which Chick and colleagues call online learning. With d_on of 0 the outcomes of participants do not enter the reward, which they note traditional trials assume implicitly. The participants' opportunity loss of HE-FM-ENBS-002, applied to the remaining pairs in HE-CF-AVOI-001, values the same participants another way, charging each pair the net benefit forgone by the participant on the arm expected to be inferior, so an analysis uses one convention or the other and not both.
One-stage look-ahead as a check on the optimal sequential rule
The comparison values plans that take m more pairs and then stop, the KG* approach in which Chick and colleagues continue only if some feasible one-stage plan has a greater expected reward than stopping, set out in their section 4 for unknown sampling variance and applied here with the variance known. The optimal sequential policy is the best of all policies, which include every one-stage plan, so a positive Delta for some m means that the optimal policy also continues, while a Delta of zero or below for every m does not prove that stopping is optimal. Chick and colleagues note that the optimal policy may have ties and that these can be broken by sampling more, at no loss of expected reward.
Worked examples
Article's interim look with a posterior mean of GBP 200
The article's illustrative interim look after 100 of 200 pairs has n_t of 125 pairs, sigma_X of GBP 10,000, 20,000 patients informed, GBP 4,000 a pair, no switching cost and offline learning. The remaining 100 pairs are worth about GBP 151.14 per patient, about GBP 3.02 million in all, and continuing beats stopping by about GBP 2.62 million, the article's figure.
mu_t = 200; I = 0; P = 20000; sigma_X = 10000; m = 100; n_t = 125; c = 4000; d_on = 0; Q_z = 0.3686578386; a = 200; s_m = 596.284794; z = 0.33541; phi_z = 0.377121; EVSI_I = 151.14; Delta = 2622802
Article's interim look with a posterior mean of minus GBP 1,500
With the same illustrative inputs and the interim posterior mean fallen to minus GBP 1,500, the remaining pairs are worth about GBP 1.14 per patient, about GBP 22,772 in all, and the one-stage gain is about minus GBP 377,228, so this plan does not beat stopping, as in the article.
mu_t = -1500; I = 0; P = 20000; sigma_X = 10000; m = 100; n_t = 125; c = 4000; d_on = 0; Q_z = 0.0059418946; a = -1500; s_m = 596.284794; z = 2.515576; phi_z = 0.016857; EVSI_I = 1.14; Delta = -377228
Interim one-stage gain with an illustrative switching cost of GBP 2 million
An illustrative switching cost of GBP 2 million, GBP 100 for each of the 20,000 patients informed, moves the adoption threshold to GBP 100, so a posterior mean of GBP 200 lies closer to it. The remaining pairs are then worth about GBP 191.22 per patient and the gain of continuing rises to about GBP 3.42 million (computed here for illustration).
mu_t = 200; I = 2000000; P = 20000; sigma_X = 10000; m = 100; n_t = 125; c = 4000; d_on = 0; Q_z = 0.4334076426; a = 100; s_m = 596.284794; z = 0.167705; phi_z = 0.393371; EVSI_I = 191.22; Delta = 3424413
Interim one-stage gain with online learning at a posterior mean of GBP 200
Counting the expected rewards of the 100 further pairs under online learning adds 100 times GBP 200, GBP 20,000, to the article's interim case, giving about GBP 2.64 million (computed here for illustration).
mu_t = 200; I = 0; P = 20000; sigma_X = 10000; m = 100; n_t = 125; c = 4000; d_on = 1; Q_z = 0.3686578386; a = 200; s_m = 596.284794; z = 0.33541; phi_z = 0.377121; EVSI_I = 151.14; Delta = 2642802
Common errors
Prior effective sample size used in place of the interim effective sample size
Computing s_m with the prior n0 of 25 in place of n_t of 125 treats the 100 pairs already observed as if they had not been, so the remaining 100 pairs are credited with about GBP 618.11 per patient instead of GBP 151.14, and the gain of continuing with about GBP 11.96 million instead of GBP 2.62 million (computed here for illustration).
Design-stage prior mean used at the interim look
Keeping the prior mean of GBP 500 when the interim posterior mean has fallen to minus GBP 1,500 gives a one-stage gain of about GBP 0.94 million, a signal to continue, where the interim evidence gives about minus GBP 377,228, a signal to stop (computed here for illustration).
Negative one-stage gain read as proof that stopping is optimal
A one-stage check looks only at plans that stop after m more pairs, so it can stop a trial too early. Flight and colleagues note that updating the EVSI with the interim data does not take account of all possible future interim analyses, and Chick and colleagues report the optimal sequential policy outperforming the one-stage policy in net gain where the prior mean lies in the sequential region.
Sources
Chick, Forster and Pertile on the expected rewards of stopping and continuing
Chick SE, Forster M, Pertile P. A Bayesian decision theoretic model of sequential experimentation with delayed response. Journal of the Royal Statistical Society Series B. 2017;79(5):1439-1462. Section 2.1, equations 2 and 3, the normal posterior for the expected incremental net monetary benefit with effective sample size n0 plus the pairs observed. Section 2.1.1, equation 6, the distribution of the posterior mean still to be obtained, normal about the current mean with variance sigma_X squared over n_t times u over n_t plus u, and equation 7, the reward of stopping, with the new technology adopted when P times the posterior mean exceeds the switching cost I. Section 2.1.2, equation 8a, Bellman's comparison of that reward with the reward of one more allocation, less its cost c, plus the online reward.
Chick, Forster and Pertile on one-stage plans, online learning and ties
Chick SE, Forster M, Pertile P. A Bayesian decision theoretic model of sequential experimentation with delayed response. Journal of the Royal Statistical Society Series B. 2017;79(5):1439-1462. Section 2.1, equation 4 and the text after it, where d_on of 1 includes the benefits to trial participants in addition to the P post-trial patients (online learning) and traditional trials set it to 0 implicitly. Section 2.2, where ties may be broken by picking the action that samples more, at no loss of expected reward. Section 3, equation 14, the Optimal Bayes One Stage policy, and section 4, equations 17 and 18, the KG* rule that continues if and only if a feasible one-stage plan has a greater expected reward than stopping, given there for unknown sampling variance with a Student t predictive distribution in place of the normal of equation 6.
Welch and colleagues on the switching cost in the value-based adoption rule
Welch C, Forster M, Ronaldson S, Keding A, Corbacho-Martín B, Tharmanathan P. The performance of a Bayesian value-based sequential clinical trial design in the presence of an equivocal cost-effectiveness signal, evidence from the HERO trial. BMC Medical Research Methodology. 2024;24:155. Methods, section on the Bayesian value-based model of a sequential clinical trial, where adoption of the new technology is recommended if P times the posterior mean exceeds the switching cost I, and the design stops the trial as soon as an extra pair of patients is not worth its additional cost.
Flight and colleagues on the normal loss method in a value-based design
Flight L, Brennan A, Wilson I, Chick SE. A tutorial on value-based adaptive designs, could a value-based sequential 2-arm design have created more health economic value for the Big CACTUS trial. Value in Health. 2024;27(10):1328-1337. Case study step 2, where the EVSI of the value-based fixed design is calculated with the standard normal loss function method and ENBS is EVSI minus trial costs.
Canonical Identity
Stable URI · Machine-readable · Resolvable · CC BY 4.0
