Signature
k = lambda * q; p_star = c / k; E_p = alpha / (alpha + beta); INB_bar = k * E_p - c; E_pos = k * E_p * G_1 - c * G_0; EVPI_B = E_pos - max(INB_bar, 0)
| Inputs | Definition | Unit |
|---|---|---|
lambda | Cost-effectiveness threshold, above zero | currency per QALY |
q | QALYs gained by each responder, above zero and treated as known | QALYs per responder |
c | Extra cost per patient treated, whether or not the patient responds, treated as known | currency per patient |
alpha | First shape of the beta distribution for the response probability, above zero | none |
beta | Second shape of the beta distribution for the response probability, above zero | none |
G_1 | Probability that a Beta(alpha + 1, beta) variable exceeds p_star, entered in the same way | probability |
G_0 | Probability that a Beta(alpha, beta) variable exceeds p_star, entered from 1-BETA.DIST with cumulative TRUE, and equal to the probability of cost-effectiveness | probability |
k | Change in incremental net benefit per unit of response probability | currency per patient |
|---|---|---|
p_star | Response probability at which incremental net benefit is zero | probability when c is at least 0 and at most k |
E_p | Mean of the beta distribution, as in HE-FM-BETA-001 | probability |
INB_bar | Incremental net benefit at the mean response probability, which decides adoption on current evidence | currency per patient |
E_pos | Expected value of the larger of k p minus c and 0 over the beta distribution | currency per patient |
EVPI_B | Per-person expected value of perfect information about the response probability | currency per patient |
Function
Bayesian analysis function for a posterior and its decision summaries
Takes a prior distribution for an unknown model input, a likelihood and the observed data and returns the posterior distribution with the summaries a health technology assessment reads, such as a posterior mean, an expected value of perfect information and a model comparison statistic. The posterior is proportional to likelihood times prior, and HE-FN-BAD-001 gives the normalised form. Live records already hold the common conjugate updates, the beta for a probability in HE-FM-BETA-002, the normal for a treatment effect in HE-FM-BAD-001 and the Dirichlet for a transition row in HE-FM-DIRI-002. The posterior mean of HE-FM-BETA-002 is also the average of the prior mean and the trial proportion weighted by alpha_0 + beta_0 and n (derived). Posterior draws feed the acceptability curve HE-FM-CEAC-001 and EVPI from draws HE-FM-EVPI-002. This package adds the gamma update for an event rate, exact EVPI when incremental net benefit is linear in a beta probability, and the deviance information criterion. Notation follows the Bayesian Analysis article.
Computational function
Computational function: responder counts and a beta prior to exact EVPI and probability of cost-effectiveness
Takes the counts and the prior behind a response probability, the threshold, the QALY gain per responder and the extra cost, and returns the posterior, the probability of cost-effectiveness and exact EVPI. It applies the conjugate update HE-FM-BETA-002 and then HE-FM-BAYA-002. The two upper tails need the incomplete beta function, a numerical routine in Excel, R and Python, and enter the calculator line as the inputs
G_0andG_1.Inputs and outputs:
a_0andb_0are the beta prior shapes, above zero;ris the responder count, at least 0 and at mostn, andnthe patients in the new trial;lambdais the threshold;qis the QALY gain per responder, above zero;cis the extra cost per patient;G_0andG_1are the upper tails of Beta(alpha,beta) and Beta(alpha+ 1,beta) atp_star;alphaandbetaare the posterior shapes;kis the slope of incremental net benefit in the response probability;p_staris the response probability where it is zero;E_pis the posterior mean;INB_baris expected incremental net benefit;E_posis the expected positive part;EVPI_Bis per-person EVPI.Assumption: Binomial counts with one common response probability, a response probability as the only uncertain input, and two options, as in HE-AS-BAYA-004 and HE-AS-BAYA-005.
Worked example (Article's phase 2 prior and 18 responders among 40 patients): All figures are illustrative.
a_0 = 6; b_0 = 14; r = 18; n = 40; lambda = 20000; q = 0.5; c = 5000; G_0 = 0.05873868; G_1 = 0.07750095givealpha = 24; beta = 36; k = 10000; p_star = 0.5; E_p = 0.4; INB_bar = -1000; E_pos = 16.31; EVPI_B = 16.31, the article's Beta(24, 36), 0.059 and GBP 16.Excel:
=PriorAlpha+Eventsfor PostAlpha and=PriorBeta+AtRisk-Eventsfor PostBeta, then the cells of HE-IM-BAYA-002, with the last cell named EVPIFromCounts,=SlopeINB*MeanResp*TailPlusOne-ExtraCost*TailProb-MAX(MeanINB,0).R:
evpi_beta <- function(a0, b0, r, n, lambda, q, c) { stopifnot(lambda * q > 0, a0 + r > 0, b0 + n-r > 0); a <- a0 + r; b <- b0 + n-r; k <- lambda * q; x <- min(max(c / k, 0), 1); g0 <- 1-pbeta(x, a, b); g1 <- 1-pbeta(x, a + 1, b); ep <- a / (a + b); i <- k * ep-c; list(alpha = a, beta = b, p_ce = g0, inb = i, evpi = k * ep * g1-c * g0-max(i, 0)) }Python:
from scipy.special import betaincdef evpi_beta(a0, b0, r, n, lam, q, c):a, b, k = a0 + r, b0 + n-r, lam * qif k <= 0 or a <= 0 or b <= 0: raise ValueError("k and both shapes must be above zero")x = min(max(c / k, 0), 1)g0, g1 = 1-betainc(a, b, x), 1-betainc(a + 1, b, x)ep = a / (a + b); i = k * ep-creturn dict(alpha=a, beta=b, p_ce=g0, inb=i, evpi=k * ep * g1-c * g0-max(i, 0))The R and Python versions stop with an error when the slope or a shape is zero or below, and return EVPI of 0 when
cis at or below zero or at or abovek.Test (article's phase 2 prior): With the inputs above,
=ROUND(EVPIFromCounts,0)=16returns TRUE, against the article's numerical integration. Doubling or halving the cell returns FALSE.Test (article's flat prior): With
a_0 = 1; b_0 = 1and the same other inputs,=ROUND(EVPIFromCounts,0)=125returns TRUE, the article's GBP 125, withG_0 = 0.26635463; G_1 = 0.32198448.Common error (trial size in place of non-responders): Adding
ninstead ofnlessrtob_0gives Beta(24, 54) in place of Beta(24, 36), with EVPI of about GBP 0.04 instead of GBP 16.31 and a probability of cost-effectiveness of about 0.0003 instead of 0.059.Source: Society of Actuaries. Tables for Exam STAM, with excerpts from the appendices to Klugman SA, Panjer HH, Willmot GE. Loss Models: From Data to Decisions, 5th edition, dated 12 September 2018. Section A.6.1.2, for the limited expected value. Gelman A, Carlin JB, Stern HS, Dunson DB, Vehtari A, Rubin DB. Bayesian Data Analysis. 3rd edition. Boca Raton: Chapman & Hall/CRC; 2013. Section 2.4, for the conjugate beta update.
alpha = a_0 + r; beta = b_0 + n - r; k = lambda * q; p_star = c / k; E_p = alpha / (alpha + beta); INB_bar = k * E_p - c; E_pos = k * E_p * G_1 - c * G_0; EVPI_B = E_pos - max(INB_bar, 0)
Try this function
Implementations
Excel
Exact beta EVPI in seven cells with BETA.DIST
With named cells Threshold, QALYPerResponder, ExtraCost, PostAlpha and PostBeta, the formulas return SlopeINB, BreakEvenResp, MeanResp, MeanINB, TailProb, TailPlusOne and EVPIBeta in that order. MIN and MAX hold the break-even probability inside the range BETA.DIST accepts.
=Threshold*QALYPerResponder; =ExtraCost/SlopeINB; =PostAlpha/(PostAlpha+PostBeta); =SlopeINB*MeanResp-ExtraCost; =1-BETA.DIST(MIN(MAX(BreakEvenResp,0),1),PostAlpha,PostBeta,TRUE); =1-BETA.DIST(MIN(MAX(BreakEvenResp,0),1),PostAlpha+1,PostBeta,TRUE); =SlopeINB*MeanResp*TailPlusOne-ExtraCost*TailProb-MAX(MeanINB,0)
Assumptions
Incremental net benefit linear in one response probability
Each responder gains the same q QALYs and every treated patient costs the same extra c, so incremental net benefit is k p minus c. Uncertainty in q, c or any other input is outside the result, which is then EVPI for the response probability alone.
Two options and beta shapes above zero in exact EVPI
One new option faces one comparator, as in HE-FM-EVPI-002. alpha, beta, lambda and q are above zero, and the distribution of the response probability is exactly beta, as the conjugate update HE-FM-BETA-002 gives from a beta prior and binomial counts.
Both beta tails read at the same break-even probability
G_0 and G_1 are evaluated at the same p_star, held at 0 when c is at or below zero and at 1 when c is at or above k (Excel BETA.DIST returns #NUM! outside that range). In those two cases one option is best at every response probability and EVPI is zero (derived).
Worked examples
Article's Beta(24, 36) response probability at GBP 20,000 per QALY
Illustrative figures from the article. Rejection is preferred on expected net benefit, the probability of cost-effectiveness is 0.059, and EVPI is about GBP 16.31 per patient, the article's GBP 16 obtained there by numerical integration.
lambda = 20000; q = 0.5; c = 5000; alpha = 24; beta = 36; G_0 = 0.05873868; G_1 = 0.07750095; k = 10000; p_star = 0.5; E_p = 0.4; INB_bar = -1000; E_pos = 16.31; EVPI_B = 16.31
Article's flat prior posterior Beta(19, 23) at GBP 20,000 per QALY
The article's prior test. The probability of cost-effectiveness is 0.266 and EVPI about GBP 124.82 per patient, the article's GBP 125.
lambda = 20000; q = 0.5; c = 5000; alpha = 19; beta = 23; G_0 = 0.26635463; G_1 = 0.32198448; k = 10000; p_star = 0.5; E_p = 0.452381; INB_bar = -476.19; E_pos = 124.82; EVPI_B = 124.82
Adoption preferred under an illustrative Beta(36, 24) response probability
Illustrative case with the shapes swapped, so adoption is preferred. The expected positive part is about GBP 1,016.31 and removing the positive part of the mean, GBP 1,000, leaves EVPI of about GBP 16.31.
lambda = 20000; q = 0.5; c = 5000; alpha = 36; beta = 24; G_0 = 0.94126132; G_1 = 0.95376951; k = 10000; p_star = 0.5; E_p = 0.6; INB_bar = 1000; E_pos = 1016.31; EVPI_B = 16.31
Extra cost above the largest possible net gain in exact beta EVPI
Illustrative limiting case with an extra cost of GBP 12,000. Even a response probability of 1 gives a net loss, so both tails are 0 and EVPI is 0.
lambda = 20000; q = 0.5; c = 12000; alpha = 24; beta = 36; G_0 = 0; G_1 = 0; k = 10000; p_star = 1.2; E_p = 0.4; INB_bar = -8000; E_pos = 0; EVPI_B = 0
Common errors
Same beta tail used in both terms of exact EVPI
Using G_0 in place of G_1 turns the expected positive part into G_0 times the mean incremental net benefit. For the article's inputs that gives 0.05873868 times minus 1,000, about minus GBP 58.74, a negative value for a quantity that cannot be negative, against the correct GBP 16.31.
Normal closed form used for a skewed beta response probability
HE-FM-EVPI-004 assumes a normal incremental net benefit. At the same mean and standard deviation it gives about GBP 14.78 for Beta(24, 36) against the exact GBP 16.31, and about GBP 94.31 for an illustrative Beta(2.5, 7.5) with slope 8,000 and cost 1,000 against the exact GBP 58.53, about 61% too high.
Expected positive part reported as EVPI when adoption is preferred
When the mean incremental net benefit is positive the expected positive part includes that mean. For Beta(36, 24) it is about GBP 1,016.31, while EVPI is about GBP 16.31 once the GBP 1,000 is removed.
Sources
Society of Actuaries excerpts of Loss Models on the limited expected value of a beta distribution
Society of Actuaries. Tables for Exam STAM, with excerpts from the appendices to Klugman SA, Panjer HH, Willmot GE. Loss Models: From Data to Decisions, 5th edition, dated 12 September 2018. Section A.6.1.2, Beta, printed page 11, which gives F(x) = beta(a, b; u) with u = x / theta and E[(X min x)^k] = theta^k a(a+1)...(a+k-1) / ((a+b)(a+b+1)...(a+b+k-1)) times beta(a+k, b; u), plus x^k times 1 minus beta(a, b; u); printed page 2 defines the incomplete beta function. The expected positive part used here is E_p less this limited expected value at k = 1 and theta = 1, scaled by the slope (derived).
Spiegelhalter on EVPI over the posterior of incremental net benefit
Spiegelhalter DJ. Incorporating Bayesian ideas into health-care evaluation. Statistical Science. 2004;19(1):156-174. Page 169, equation 1, where the value of perfect information is 0 when INB(theta) is above 0 and minus INB(theta) when it is below 0, so that EVPI is E[max(-INB(theta), 0) | data], which may be calculated by MCMC or by a normal approximation. That form is the loss when adoption is preferred on current evidence, and subtracting the positive part of the mean in HE-FM-BAYA-002 covers rejection as well (derived).
Canonical Identity
Stable URI · Machine-readable · Resolvable · CC BY 4.0
