Functions & Formulae

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

Bootstrap standard error of a trial statistic from resampled data

SE_B = sd(theta_1, ..., theta_B)

Maps a statistic and the data that produced it to the standard deviation of the statistic across samples drawn with replacement from the data, each of the same size as the original sample. The empirical distribution of the observations, with mass 1/n on each, stands in for the unknown population distribution, so no normal shape is assumed. In trial-based economic evaluation the statistic is usually a mean cost, an incremental cost or incremental net benefit, and the resampling copies the trial design by drawing patients within each arm with their costs and effects kept together.

  • Monte Carlo bootstrap standard error from B replicates

    theta_bar = sum_(b=1)^B [theta_b] / B; SE_B = sqrt(sum_(b=1)^B [(theta_b - theta_bar)^2] / (B - 1))

    Estimates the bootstrap standard error as the standard deviation, with divisor B minus 1, of the statistic recalculated on B bootstrap samples. As B grows the estimate approaches the ideal bootstrap standard error over every possible resample. The replicate standard deviation is itself the standard error and is not divided by the square root of B.

  • Ideal bootstrap standard error of a sample mean

    x_bar = sum_(i=1)^n [x_i] / n; SE_inf = sqrt(sum_(i=1)^n [(x_i - x_bar)^2]) / n

    For a sample mean the ideal bootstrap standard error, the value over every possible resample, has a closed form derived by Efron and Tibshirani. It equals the usual standard error, s divided by the square root of n, multiplied by the square root of n minus 1 over n, so the bootstrap understates the usual value in small samples.

  • Variance of incremental net monetary benefit across paired bootstrap replicates

    Var_INMB = lambda^2 * Var_E + Var_C - 2 * lambda * Cov_EC; SE_INMB = sqrt(Var_INMB)

    Gives the bootstrap variance of incremental net monetary benefit from the variances of the differences in mean effect and mean cost and their covariance across replicates. Resampling each patient's cost and effect together keeps the covariance; resampling them separately forces it to zero, which understates the standard error when costlier patients have worse outcomes.

  • Coefficient of variation of a bootstrap standard error from B replicates

    CV_B = sqrt(CV_inf^2 + (E_delta + 2) / (4 * B))

    Efron and Tibshirani's approximation splits the variability of a bootstrap standard error into the sampling variability of the ideal value and the simulation noise from using B replicates. The second term shrinks as B grows, which is why 50 to 200 replicates are adequate for a standard error in most situations.