Functions & Formulae

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

Per-trial risk ratio input function for a pairwise meta-analysis of head-to-head trials

g(a, n1, c, n2) = (RR, y, v)

Maps the event counts and arm sizes of one head-to-head trial of drug A against drug B to the risk ratio, its natural log and the variance of that log, the per-trial inputs that an inverse-variance pairwise meta-analysis of a dichotomous outcome pools. The pooling steps are existing records: the fixed-effect estimate HE-FM-ADMA-001, Cochran's Q HE-FM-ADMA-002, I-squared HE-FM-ADMA-003, the DerSimonian and Laird between-study variance HE-FM-ADMA-004 and the random-effects mean HE-FM-ADMA-005, all run in one pass by HE-CF-ADMA-001 with each trial's standard error taken as the square root of v. Applying the pooled risk ratio to a baseline risk from another source in an economic model is HE-FM-ARR-002. Notation follows the Pairwise Meta-Analysis article.

  • Log risk ratio and its variance from the two-by-two counts of one head-to-head trial

    RR = (a / n1) / (c / n2); y = log(RR); v = 1 / a + 1 / c - 1 / n1 - 1 / n2

    Divides the risk of the event on drug A, a/n1, by the risk on drug B, c/n2, takes the natural log, and computes the variance of the log risk ratio as one over a plus one over c, minus one over n1 and one over n2. This is the square of the standard error of the log risk ratio in the RevMan statistical algorithms, and one over v is the trial's inverse-variance weight in HE-FM-ADMA-001. The formula is applied to each trial in turn, so the trial subscript i of the article is dropped; y and v become the y_i and v_i that the pooling records take.