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

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.

Signature

RR = (a / n1) / (c / n2); y = log(RR); v = 1 / a + 1 / c - 1 / n1 - 1 / n2
Inputs
InputsDefinitionUnit
aNumber of patients randomised to drug A who had the event, for example hospital admission within 12 months; above 0, or 0.5 after a zero-cell correctioncount
n1Number of patients randomised to drug A in the trial, at least acount
cNumber of patients randomised to drug B who had the event; above 0, or 0.5 after a zero-cell correctioncount
n2Number of patients randomised to drug B in the trial, at least ccount
Output
RRRisk of the event on drug A divided by the risk on drug B in one trial; a value below 1 means fewer events on drug Aratio, above 0
yNatural log of RR, the effect estimate the trial contributes to pooling (y_i in HE-FM-ADMA-001)log risk ratio
vVariance of y, the square of its standard error (v_i in HE-FM-ADMA-001)squared log risk ratio

Function

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

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.

Try this function

Implementations

  • Excel

    Risk ratio, log risk ratio and variance of one pairwise meta-analysis trial in Excel

    With the counts in cells named EventsA, PatientsA, EventsB and PatientsB, Excel 365 spills the risk ratio, the log risk ratio and its variance into three adjacent cells. LN is the natural log.

    =LET(riskA,EventsA/PatientsA,riskB,EventsB/PatientsB,HSTACK(riskA/riskB,LN(riskA/riskB),1/EventsA+1/EventsB-1/PatientsA-1/PatientsB))
  • Excel

    Trial-by-row log risk ratios with the zero-cell rule for a pairwise meta-analysis in Excel

    With one trial per row, drug A events in B2, drug A patients in C2, drug B events in D2 and drug B patients in E2, the formula in F2 spills y into F2 and v into G2 and is copied down. It adds 0.5 to every cell, and so 1 to each arm total, when either arm has no events, and returns #N/A when neither arm has events or every patient in both arms has the event. The standard errors that HE-CF-ADMA-001 takes are SQRT of column G.

    =LET(eA,B2,nA,C2,eB,D2,nB,E2,k,IF(OR(eA=0,eB=0),0.5,0),IF(OR(eA+eB=0,AND(eA=nA,eB=nB)),NA(),HSTACK(LN(((eA+k)/(nA+2*k))/((eB+k)/(nB+2*k))),1/(eA+k)+1/(eB+k)-1/(nA+2*k)-1/(nB+2*k))))

Assumptions

  • Same arm order and outcome in every trial of a pairwise meta-analysis

    Drug A is group 1 (a, n1) and drug B is group 2 (c, n2) in every trial, the outcome has the same definition and time point throughout, and each randomised patient appears once in the total of the arm to which they were allocated. The log risk ratios then share one direction, so a negative pooled value favours drug A whichever trial it came from.

  • Inverse-variance use of the trial log risk ratio in a pairwise meta-analysis

    The pair (y, v) feeds the inverse-variance method, which gives each trial a weight of one over its variance. When events are few the Cochrane Handbook generally prefers the Mantel-Haenszel method for a fixed-effect analysis, and with rare events it advises against inverse-variance methods, including DerSimonian and Laird. At event rates below 1% the Peto one-step odds ratio method was the least biased and most powerful, under the conditions the Handbook states.

  • Zero-cell rule for the log risk ratio in a pairwise meta-analysis

    Both a and c are above zero. Where a zero makes the log or the variance impossible to compute, RevMan adds 0.5 to all four cells of that trial, so each arm total rises by 1. A trial with no events in either arm, or with every patient in both arms having the event, has an undefined risk ratio in RevMan and is left out; the Handbook describes excluding trials with no events in either arm as standard practice. The Handbook notes that the fixed correction biases the trial estimate towards no difference and over-estimates its variance.

Worked examples

  • Pairwise meta-analysis trial 1 log risk ratio, 30 of 200 against 45 of 200

    Trial 1 of the article's illustrative example admits 30 of 200 patients on drug A and 45 of 200 on drug B, risks of 0.15 and 0.225. The risk ratio is about 0.6667, the log risk ratio about -0.4055 and its variance about 0.04556, so the trial's fixed-effect weight is about 21.951, as in the article's table.

    a = 30; n1 = 200; c = 45; n2 = 200; RR = 0.6667; y = -0.4055; v = 0.04556
  • Pairwise meta-analysis trial 2 log risk ratio, 60 of 500 against 70 of 500

    Trial 2 admits 60 of 500 patients on drug A and 70 of 500 on drug B, risks of 0.12 and 0.14. The risk ratio is about 0.8571, the log risk ratio about -0.1542 and its variance about 0.02695, a weight of about 37.102.

    a = 60; n1 = 500; c = 70; n2 = 500; RR = 0.8571; y = -0.1542; v = 0.02695
  • Pairwise meta-analysis trial 3 log risk ratio, 12 of 100 against 25 of 100

    Trial 3, the smallest, admits 12 of 100 patients on drug A and 25 of 100 on drug B. The risk ratio is 0.48, the log risk ratio about -0.7340 and its variance about 0.10333, the largest benefit and the smallest weight, about 9.677, of the four trials.

    a = 12; n1 = 100; c = 25; n2 = 100; RR = 0.4800; y = -0.7340; v = 0.10333
  • Pairwise meta-analysis trial 4 log risk ratio, 90 of 800 against 96 of 800

    Trial 4, the largest, admits 90 of 800 patients on drug A and 96 of 800 on drug B. The risk ratio is 0.9375, the log risk ratio about -0.0645 and its variance about 0.01903, a weight of about 52.555, 43.3% of the fixed-effect total in the article. Pooling the four (y, v) pairs with HE-FM-ADMA-001 gives the article's fixed-effect log risk ratio of -0.2071, a risk ratio of 0.813.

    a = 90; n1 = 800; c = 96; n2 = 800; RR = 0.9375; y = -0.0645; v = 0.01903
  • Pairwise meta-analysis trial with no events on drug A after the 0.5 correction

    An illustrative small trial has no admissions among 50 patients on drug A and 4 among 50 on drug B, so the log and one over a cannot be computed. Adding 0.5 to all four cells, as RevMan does, gives 0.5 events in 51 patients and 4.5 in 51. The corrected risk ratio is about 0.1111, the log risk ratio about -2.1972 and its variance about 2.1830, a weight below 0.5 against about 52.555 for trial 4.

    a = 0.5; n1 = 51; c = 4.5; n2 = 51; RR = 0.1111; y = -2.1972; v = 2.1830

Common errors

  • Using the log odds ratio variance for a trial log risk ratio in a pairwise meta-analysis

    For trial 1 the log odds ratio variance, one over each of the four cells 30, 170, 45 and 155, is about 0.06789 against 0.04556 for the log risk ratio, so mixing the two cuts the trial's weight from about 21.951 to about 14.730. RevMan gives the two measures different standard errors, and the variance has to belong to the measure being pooled.

  • Reversing the arms of one trial in a pairwise meta-analysis

    If trial 3 of the article is entered with drug B as group 1, its log risk ratio becomes 0.7340 with an unchanged variance. The fixed-effect risk ratio moves from 0.813 to about 0.914, Cochran's Q rises from about 4.72 to about 8.94 and the DerSimonian and Laird random-effects risk ratio moves from 0.784 to about 0.958, so one reversed trial removes most of the pooled benefit and inflates the heterogeneity.

Sources

  • RevMan statistical algorithms for the per-trial log risk ratio and its standard error

    Deeks JJ, Higgins JPT. Statistical algorithms in Review Manager. Cochrane Statistical Methods Group; May 2022. Section Individual study estimates, dichotomous outcomes: the risk ratio of each study as (a/n1)/(c/n2) with the standard error of the log risk ratio as the square root of one over a plus one over c minus one over n1 and one over n2; the different standard error of the log odds ratio; and the empty-cell rule adding 0.5 to all cells, with the risk ratio undefined when a and c, or b and d, are both zero. The inverse-variance section weights each estimate by the reciprocal of its variance.

    View source →

  • Cochrane Handbook chapter 10 on log-scale entry and zero cells in pairwise pooling

    Deeks JJ, Higgins JPT, Altman DG, McKenzie JE, Veroniki AA (editors). Chapter 10: Analysing data and undertaking meta-analyses. Cochrane Handbook for Systematic Reviews of Interventions version 6.5. Cochrane; 2024. Section 10.3.3 (ratio measures entered as natural logarithms), section 10.4.1 (Mantel-Haenszel generally preferable to inverse variance for fixed-effect analyses with few events), section 10.4.4.1 (fixed 0.5 zero-cell correction, which biases estimates towards no difference and over-estimates variances), section 10.4.4.2 (studies with no events in both arms excluded) and section 10.4.4.3 (rare events).

    View source →

Canonical Identity

Log risk ratio and its variance from the two-by-two counts of one head-to-head trial | HealthEconomics.wiki