Functions & Formulae

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

Network consistency function

d_XY = d_AY - d_AX

Expresses every pairwise relative effect in a connected network through effects relative to a common reference treatment A, on a scale where effects add, such as the log odds ratio. Here d_XY is the effect of Y relative to X, the NICE Decision Support Unit convention. Consistency is the assumption that direct and indirect evidence estimate the same d_XY.

  • Bucher adjusted indirect comparison through a common comparator

    d_BC = d_AC - d_AB; V_BC = V_AC + V_AB

    Estimates the effect of C relative to B from trials of B against A and trials of C against A. The indirect estimate is the difference of the two direct effects, and its variance is the sum of their variances because the two sets of trials are independent. Working with within-trial contrasts preserves randomisation, unlike a comparison of active arms taken from different trials.

  • Indirect odds ratio and 95% interval from the log scale

    OR_BC = exp(d_BC); OR_BC_L = exp(d_BC - 1.96 * sqrt(V_BC)); OR_BC_U = exp(d_BC + 1.96 * sqrt(V_BC))

    Back-transforms an indirect log odds ratio and its variance into an odds ratio with a 95% confidence interval. The interval is built symmetrically on the log scale and becomes asymmetric on the odds ratio scale. The function exp is the exponential function and sqrt the square root.

  • Bucher inconsistency estimate and z statistic for a single loop

    omega = d_BC_dir - d_BC_ind; V_omega = V_BC_dir + V_BC_ind; z = (d_BC_dir - d_BC_ind) / sqrt(V_BC_dir + V_BC_ind)

    Compares a direct estimate of the effect of C relative to B with the indirect estimate formed from the A versus B and A versus C evidence, the inconsistency factor IF in the article. The inconsistency is their difference, its variance is the sum of the two variances, and z is referred to the standard normal distribution. The function sqrt is the square root.

  • Absolute event probability from a baseline risk and a network odds ratio

    p_k = p_0 * OR_k / (1 - p_0 + p_0 * OR_k)

    Applies a treatment effect from a log odds ratio network to a baseline probability on the reference treatment, taken from a separate baseline natural history model. On the logit scale the effect adds, logit(p_k) = logit(p_0) + d_k, with OR_k = exp(d_k); the stated form is the same relation solved for p_k without logarithms. The ARR against the reference is then p_0 minus p_k.