Functions & Formulae

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

Probabilistic sensitivity analysis run that turns joint parameter draws into stored decision outputs

psa(f, theta_i, lambda, N) = (ENHB, P_CE, EL_new, EL_comp)

Maps a decision model f, the joint distribution of its uncertain inputs and a cost-effectiveness threshold lambda to the outputs stored for every draw and their summaries. Each of the N draws theta_i is one complete set of inputs, applied to every option so that incremental results keep their dependence, and the model returns each option's cost and QALYs in that draw. The summaries are live records and are not restated here. Expected net monetary and net health benefit from the draws are HE-FM-ENB-001 and HE-FM-ENB-002, the probability that each option is cost-effective and the acceptability frontier are HE-FM-CEAC-001 to HE-FM-CEAC-003, and per-person EVPI from the same draws is HE-FM-VOI-001 with the forms in HE-FM-EVPI-001 to HE-FM-EVPI-004. A probabilistic ICER is the two-option ratio HE-FM-ICER-001 taken on expected values (HE-AS-ICER-003). The Monte Carlo standard error of a mean output over independent draws is the standard deviation across draws divided by the square root of N, the form of HE-FM-ANTV-002 with one observation per draw, and the number of draws for a target standard error is HE-FM-ABM-003 (HE-FM-ABM-004 for a share of draws); antithetic pairs are HE-FN-ANTV-001. Why a run at the mean inputs differs from the mean of the runs is covered by HE-FM-EV-001 to HE-FM-EV-004, and input distributions by HE-FN-BETA-001, HE-CF-BETA-001, HE-FM-BETA-005 and HE-FM-DIRI-001. The probability of a wrong decision and the Monte Carlo error of that probability belong to the Decision Uncertainty page. This package adds the two-parameter Cholesky step that draws a correlated pair of normal inputs, the expected loss of each of two options with the identity that links the two losses to expected net health benefit, and a computational function that runs the whole analysis on a small fixed set of draws. Notation follows the Probabilistic Sensitivity Analysis article.

  • Two-parameter Cholesky step for a correlated pair of normal PSA draws

    L_21 = rho * s_2; L_22 = s_2 * sqrt(1 - rho^2); x_1 = mu_1 + s_1 * z_1; x_2 = mu_2 + L_21 * z_1 + L_22 * z_2

    Draws two parameters that were estimated together, such as the log of a baseline event rate and a log hazard ratio from one survival regression, so that their correlation rho is kept. Two independent standard normal values z_1 and z_2 are combined through the lower triangular Cholesky factor of the 2 by 2 covariance matrix, whose entries are s_1, L_21 and L_22. The first parameter uses z_1 alone and the second takes a share of z_1 through L_21, which carries the correlation, and the rest through L_22. By algebra (derived here from the factor) the drawn pair has standard deviations s_1 and s_2 and covariance rho s_1 s_2, because s_1 times L_21 equals rho s_1 s_2 and L_21 squared plus L_22 squared equals s_2 squared. With rho equal to zero the step reduces to two independent normal draws.

  • Expected loss of each of two options from five PSA draws of incremental net health benefit

    EL_new = (max(-INHB_1, 0) + max(-INHB_2, 0) + max(-INHB_3, 0) + max(-INHB_4, 0) + max(-INHB_5, 0)) / 5; EL_comp = (max(INHB_1, 0) + max(INHB_2, 0) + max(INHB_3, 0) + max(INHB_4, 0) + max(INHB_5, 0)) / 5; D_EL = EL_comp - EL_new

    With a new option and a comparator whose net health benefit is set to zero, the loss from adopting the new option in a draw is the incremental net health benefit forgone when it is negative, and the loss from keeping the comparator is the gain forgone when it is positive. EL_new and EL_comp average these losses over all five equally likely draws, the two-option case of the expected loss of each strategy in equation 3 of Alarid-Escudero and colleagues, whose expected loss curves give the loss of every option as HE-FM-CEAC-002 gives the probability of every option. For the option chosen on current evidence the loss is the mean opportunity loss of HE-FM-EVPI-001, so the smaller of the two equals the per-person EVPI of HE-FM-EVPI-001 and HE-FM-EVPI-002, and the larger is the figure that HE-ER-EVPI-001 warns must not be reported as EVPI. Their difference D_EL equals the mean incremental net health benefit, because the positive part of a number less the positive part of its negative is the number itself (derived, the two-option case of equation 4 of Alarid-Escudero and colleagues), so the option with the smaller expected loss is the option with the higher expected net health benefit (HE-FM-ENB-002).