Functions & Formulae

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

Large-sample normal confidence interval function

CI(theta_hat, SE, z) = [L, U]

Maps an estimate and its estimated sampling variance to an approximate confidence interval by treating the estimator as normally distributed, which asymptotic normality justifies in large samples even when patient-level data are skewed. In trial-based cost-effectiveness analysis the same operation is applied to a difference in mean cost or effect, to the ICER through the delta method, to the pair of differences through Fieller's method, and to incremental net benefit, which is linear in the two differences.

  • Wald large-sample confidence interval for an estimate

    L = theta_hat - z * SE; U = theta_hat + z * SE

    Subtracts and adds a multiple of the estimated standard error to the estimate. With z equal to 1.96, the 97.5th percentile of the standard normal distribution, the interval has approximately 95% coverage in large samples. The interval is symmetric by construction.

  • Delta-method confidence interval for an ICER

    R = Delta_C / Delta_E; SE_R = abs(R) * sqrt(SE_C^2 / Delta_C^2 + SE_E^2 / Delta_E^2 - 2 * Cov_CE / (Delta_C * Delta_E)); R_L = R - z * SE_R; R_U = R + z * SE_R

    Linearises the ratio of the two estimated differences around their point estimates to obtain a large-sample standard error for the ICER, then forms a symmetric Wald interval around the ratio. The function abs returns the absolute value, so the standard error stays positive when the ICER is negative. The method is also called the Taylor series method.

  • Fieller confidence limits for an ICER

    a = Delta_E^2 - z^2 * SE_E^2; b = -2 * (Delta_C * Delta_E - z^2 * Cov_CE); c = Delta_C^2 - z^2 * SE_C^2; R_L = (-b - sqrt(b^2 - 4 * a * c)) / (2 * a); R_U = (-b + sqrt(b^2 - 4 * a * c)) / (2 * a)

    Applies the normal approximation to the two differences rather than to their ratio. The limits are the values of R at which the squared difference between Delta_C and R times Delta_E equals z squared times its variance; rearranged, they are the roots of a quadratic in R with coefficients a, b and c. The roots bound the interval when a is positive.

  • Normal-approximation interval and probability for incremental net benefit

    INB = lambda * Delta_E - Delta_C; SE_INB = sqrt(lambda^2 * SE_E^2 + SE_C^2 - 2 * lambda * Cov_CE); INB_L = INB - z * SE_INB; INB_U = INB + z * SE_INB; z_INB = INB / SE_INB

    Incremental net benefit at a threshold lambda is linear in the two differences, so its variance follows directly and no ratio is involved. A Wald interval follows, and z_INB, the estimate divided by its standard error, gives the normal-approximation probability that net benefit is positive as the standard normal cumulative distribution function evaluated at z_INB. That probability is one point on the cost-effectiveness acceptability curve. The calculator returns z_INB; Excel NORM.S.DIST and R pnorm convert it to the probability.