Functions & Formulae

Each applied formula has its own function page, with a signature, implementations, and tests.

Interim value of information function for the stop or continue decision in an ongoing trial

g(mu_t, n_t, m, sigma_X, P, c, I, d_on) = Delta

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.

  • One-stage expected gain of continuing over stopping at an interim look with a switching cost

    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

    Compares two expected rewards at an interim look in the model of Chick, Forster and Pertile, with outcomes observed at once and no discounting. Stopping now adopts the new technology only if P times the posterior mean exceeds the switching cost I, which is worth P times max(a, 0), with a the posterior mean less I divided by P. Continuing with m more pairs and then choosing is worth P times the expected positive part of a after updating, less the cost c of each pair, plus the participants' expected reward d_on times m times mu_t under online learning. The difference Delta is P times EVSI_I less the sampling cost plus that online term, where s_m is the preposterior standard deviation of HE-FM-EVSI-002 with n_t and m, and EVSI_I is the closed-form EVSI of HE-FM-EVSI-003 taken about the threshold I/P in place of zero. A positive Delta for some feasible m means that a one-stage plan beats stopping, the continuation condition of the KG* rule, which Chick and colleagues set out for unknown sampling variance (their section 4) and which here takes the normal distribution of their equation 6 as in their equation 14.