Effect measures and their variances
What a meta-analysis actually pools is a pair of numbers — an effect estimate and its variance. Which effect measures can be pooled, why ratio measures have to be combined on the log scale, where the variance comes from and how it becomes a weight, what to do about zero cells, and why switching effect measure makes the same set of trials look either consistent or wildly heterogeneous.
What a meta-analysis pools is a pair of numbers, not a set of conclusions
A meta-analysis looks like several studies’ conclusions being added together, but only two things are ever handed to the model: an effect measure (each study’s estimate of the effect) and its variance (how imprecise that estimate is). Everything else — sample size, length of follow-up, number of events — reaches the result only through the variance.
That has two consequences, and the rest of this page is about them:
- Choosing the effect measure is a real decision, not a formatting one. The same set of 2×2 tables expressed as RR, OR or RD gives a different pooled estimate and a different amount of heterogeneity.
- The variance is the weight. How much influence a study has relative to the others is decided entirely by its variance, and the variance is driven by the number of events, not the number of participants.
Six common effect measures, with different properties
| Measure | Data type | Scale used for pooling | When to choose it | Main trap |
|---|---|---|---|---|
| RR (risk ratio) | Binary | log | Prospective designs where risks can be estimated; the easiest for clinicians to read | Compressed by a ceiling effect when events are common; cannot be computed from a case-control study |
| OR (odds ratio) | Binary | log | Case-control designs, regression adjustment, rare events | Systematically exaggerates when events are common, and must not be read aloud as an RR |
| RD (risk difference) | Binary | identity | When you want NNT, or an absolute statement of benefit | Depends heavily on baseline risk; pooling across populations usually produces extreme heterogeneity |
| MD (mean difference) | Continuous, same instrument | identity | Every study used the same tool and the same unit | Cannot be pooled directly once units differ |
| SMD (standardised mean difference) | Continuous, different instruments | identity | Studies measured the same construct on different scales | The denominator is each study’s own SD, so a more homogeneous sample yields a larger SMD |
| HR (hazard ratio) | Time to event | log | Time-to-event data | HRs from studies with different follow-up lengths do not mean the same thing; the proportional hazards assumption has to hold in each study separately |
Why ratio measures have to be pooled on the log scale
This is not a convention. It follows from the shape of the sampling distribution.
A ratio is structurally asymmetric: downward it can only reach 0, upward it has no limit. “Halving the risk” is 0.50 and “doubling the risk” is 2.00. Clinically these are mirror images of each other, but on the number line one sits 0.50 away from 1 and the other sits 1.00 away. Take logs and the two become symmetric about 0.
A simulation makes it concrete: 100 participants per arm, an event rate of 0.20 in the control arm and 0.10 on treatment (so the true RR is 0.50), repeated over 40000 trials.
figures/scripts/B7-01-effect-size.RThe difference is not merely cosmetic. Using the same simulated data, build a 95% Wald interval each way:
- Directly on the original scale (RR ± 1.96 × SE): the intervals actually cover the truth 92.9% of the time
- On the log scale, then exponentiated back (exp(log RR ± 1.96 × SE)): 95.7%
The first falls about 2.1 percentage points short of its nominal 95%, and its lower limit can drop below 0 — a negative risk ratio. This is why the internals of every meta-analysis package work on the log scale: the yi that escalc() hands back is a log RR, not an RR, and the exponentiation happens only at the plotting and reporting step.
Where the variance comes from, and how it becomes a weight
For a log RR, the variance is
where and are the event counts in the two arms and , are the arm sizes. Note that the dominant terms are the reciprocals of the event counts, not of the sample sizes. A study that enrolled thirty thousand people but observed twenty events carries roughly the precision of a study that enrolled two hundred people and also observed twenty events. In meta-analysis, “a large study” always means a study with many events.
Under a fixed-effect model the weight is the reciprocal of the variance, normalised to a percentage:
Here it is computed on metadat::dat.bcg, the 13 controlled trials of BCG vaccination against tuberculosis (only some of which allocated participants at random; the allocation method is used as a subgroup variable on the heterogeneity page):
| Trial | Vaccinated | Control | RR | log RR | Var(log RR) | Weight (fixed-effect) |
|---|---|---|---|---|---|---|
| Aronson, 1948 | 4/123 | 11/139 | 0.411 | -0.889 | 0.3256 | 0.5% |
| Ferguson & Simes, 1949 | 6/306 | 29/303 | 0.205 | -1.585 | 0.1946 | 0.8% |
| Rosenthal et al, 1960 | 3/231 | 11/220 | 0.260 | -1.348 | 0.4154 | 0.4% |
| Hart & Sutherland, 1977 | 62/13598 | 248/12867 | 0.237 | -1.442 | 0.0200 | 8.2% |
| Frimodt-Moller et al, 1973 | 33/5069 | 47/5808 | 0.804 | -0.218 | 0.0512 | 3.2% |
| Stein & Aronson, 1953 | 180/1541 | 372/1451 | 0.456 | -0.786 | 0.0069 | 23.8% |
| Vandiviere et al, 1973 | 8/2545 | 10/629 | 0.198 | -1.621 | 0.2230 | 0.7% |
| TPT Madras, 1980 | 505/88391 | 499/88391 | 1.012 | 0.012 | 0.0040 | 41.4% |
| Coetzee & Berjak, 1968 | 29/7499 | 45/7277 | 0.625 | -0.469 | 0.0564 | 2.9% |
| Rosenthal et al, 1961 | 17/1716 | 65/1665 | 0.254 | -1.371 | 0.0730 | 2.2% |
| Comstock et al, 1974 | 186/50634 | 141/27338 | 0.712 | -0.339 | 0.0124 | 13.2% |
| Comstock & Webster, 1969 | 5/2498 | 3/2341 | 1.562 | 0.446 | 0.5325 | 0.3% |
| Comstock et al, 1976 | 27/16913 | 29/17854 | 0.983 | -0.017 | 0.0714 | 2.3% |
The largest trial (TPT Madras, 1980, 176782 participants) takes 41.4% of the weight on its own, while the trial with the smallest weight (Comstock & Webster, 1969) gets 0.31% — a difference of more than a hundredfold. “Smallest weight” is not the same as “fewest participants”: that trial enrolled 4839 people, which puts it in the middle of these 13 trials, and every trial that enrolled fewer people has a higher weight than it does. Its weight is low because it observed few events, not because it recruited few people. This is exactly why the size of the boxes on a forest plot is worth staring at, and it is also the quantity that the next page rewrites substantially by switching to a random-effects model.
Continuous outcomes: MD and SMD are not interchangeable
When every study measured the same thing with the same instrument (length of stay, systolic blood pressure, body weight), pool the mean differences directly. The unit survives, and the reader understands the result immediately.
When the studies measured one construct on different scales (three depression inventories, four pain scores), the unit has to be divided out first. The SMD does that by dividing each study’s mean difference by its own within-group standard deviation:
Running both on metadat::dat.normand1999 (9 trials of stroke units, with length of hospital stay as the outcome):
| Measure | Pooled estimate | 95% CI | I² |
|---|---|---|---|
| MD (days) | -15.1 | -32.6 to 2.4 | 99.0% |
| SMD | -0.537 | -1.142 to 0.068 | 95.5% |
Neither pooled estimate reaches statistical significance — both confidence intervals cross 0 — but that is not the point of the table. The point is that I² moves from 99.0% to 95.5%. Those two I² values must not be compared directly. I² is a proportion, and changing the effect measure changes both its numerator and its denominator at once: the units of τ² go from “days squared” to no units at all, and each study’s within-study variance is recomputed as well (the variance of an SMD carries an extra term for the uncertainty in the estimated standard deviation). So the drop cannot be read as “the real differences between studies got smaller” — answering that question means looking at an absolute quantity on a single scale (see the heterogeneity page).
Zero cells: a problem with no settled answer
When events are rare, some studies will have a zero in one cell. The log RR or log OR is then infinite, so is the variance, and the model simply stops.
metadat::dat.nielweise2007 is a clean example: 18 trials comparing antimicrobial-coated central venous catheters with standard ones, with catheter-related bloodstream infection as the outcome. 6 of them contain a zero cell, and 1 of those 6 has zeros in both arms. Four common ways of handling this give:
| Handling | Studies included | Pooled OR | 95% CI |
|---|---|---|---|
| 0.5 continuity correction (default) | 18 | 0.383 | 0.240–0.610 |
| drop zero-event studies | 12 | 0.439 | 0.268–0.719 |
| Mantel-Haenszel, no correction | 18 | 0.299 | 0.193–0.462 |
| Peto odds ratio | 18 | 0.331 | 0.227–0.482 |
Two things vary across this table at once, and they need separating when you read it. The first two rows are both random-effects models (REML) and differ only in how the zero cells are treated. The Mantel-Haenszel and Peto rows exist only as fixed-effect procedures, so they differ from the first two rows in the model and in the zero-cell handling. For a comparison that isolates the zero-cell handling, read the first two rows.
On one dataset, the pooled OR ranges from 0.299 to 0.439, a spread of more than 40%. All four appear in the published literature and none of them is wrong, but if a paper does not say which one it used, the number cannot be reproduced.
Change the effect measure and heterogeneity changes its face
One last consequence that is easy to miss: the choice of effect measure changes how inconsistent the studies appear to be. The same BCG trials, three measures:
| Measure | Pooled estimate | 95% CI | I² | τ² | Q |
|---|---|---|---|---|---|
| RR | 0.489 | 0.344–0.696 | 92.2% | 0.3132 | 152.2 |
| OR | 0.475 | 0.330–0.683 | 92.1% | 0.3378 | 163.2 |
| RD | -0.0252 | -0.0464–-0.0039 | 99.9% | 0.0014 | 276.5 |
figures/scripts/B7-01-effect-size.RThe reason is this: baseline tuberculosis incidence differs across these trial sites by orders of magnitude (an urban slum and a rural district are not remotely comparable). On a ratio scale the baseline rate cancels out, so as long as the vaccine’s relative protection is similar the trials look consistent. On a difference scale the baseline rate stays inside the effect measure, so sites with a high baseline naturally show a much larger risk difference — and because the variance of an RD is very small, that spread looks statistically certain.
Run it yourself
library(metafor)
library(metadat)
data(dat.bcg, package = "metadat")
# escalc() is the step that turns raw data into (yi, vi).
# The yi it returns is a log RR, not an RR -- pooling happens entirely in logs.
rr <- escalc(measure = "RR", ai = tpos, bi = tneg, ci = cpos, di = cneg,
data = dat.bcg, slab = paste(author, year, sep = ", "))
head(rr[, c("yi", "vi")])
# The same 2x2 tables as OR and RD: watch the pooled value and the heterogeneity move
or <- escalc(measure = "OR", ai = tpos, bi = tneg, ci = cpos, di = cneg, data = dat.bcg)
rd <- escalc(measure = "RD", ai = tpos, bi = tneg, ci = cpos, di = cneg, data = dat.bcg)
sapply(list(RR = rr, OR = or, RD = rd), function(d) rma(yi, vi, data = d)$I2)
# The weight is the reciprocal of the variance (fixed-effect)
fe <- rma(yi, vi, data = rr, method = "FE")
round(weights(fe), 1)
# -- Continuous outcomes: MD and SMD --
data(dat.normand1999, package = "metadat")
escalc(measure = "MD", m1i = m1i, sd1i = sd1i, n1i = n1i,
m2i = m2i, sd2i = sd2i, n2i = n2i, data = dat.normand1999)
escalc(measure = "SMD", m1i = m1i, sd1i = sd1i, n1i = n1i,
m2i = m2i, sd2i = sd2i, n2i = n2i, data = dat.normand1999) # small-sample corrected
# -- Zero cells: four ways of handling them --
data(dat.nielweise2007, package = "metadat")
d <- dat.nielweise2007
# (1) Default: add 0.5, but only to studies that contain a zero
rma(escalc("OR", ai = ai, n1i = n1i, ci = ci, n2i = n2i, data = d,
add = 1/2, to = "only0"))
# (2) No correction -- studies with a zero become NA and are dropped, which is the problem
rma(escalc("OR", ai = ai, n1i = n1i, ci = ci, n2i = n2i, data = d, add = 0))
# (3) Mantel-Haenszel: no correction needed
rma.mh(measure = "OR", ai = ai, n1i = n1i, ci = ci, n2i = n2i, data = d)
# (4) Peto: the choice when events are rare and the arms are similar in size
rma.peto(ai = ai, n1i = n1i, ci = ci, n2i = n2i, data = d)Verified with R 4.6.0, metafor 5.0.1 and metadat 1.6.0
import numpy as np
from statsmodels.stats.meta_analysis import combine_effects
# The 2x2 counts of metadat::dat.bcg, 13 trials, carried here so this
# block runs on its own.
tpos = np.array([4, 6, 3, 62, 33, 180, 8, 505, 29, 17, 186, 5, 27])
tneg = np.array([119, 300, 228, 13536, 5036, 1361, 2537, 87886, 7470, 1699,
50448, 2493, 16886])
cpos = np.array([11, 29, 11, 248, 47, 372, 10, 499, 45, 65, 141, 3, 29])
cneg = np.array([128, 274, 209, 12619, 5761, 1079, 619, 87892, 7232, 1600,
27197, 2338, 17825])
# statsmodels has no escalc(); the 2x2 tables must be converted by hand
a, n1, c, n2 = tpos, tpos + tneg, cpos, cpos + cneg # each study's 2x2 cells
log_rr = np.log((a / n1) / (c / n2))
var = 1 / a - 1 / n1 + 1 / c - 1 / n2 # event counts dominate
res = combine_effects(log_rr, var, method_re="dl")
print(res.summary_frame()) # still on the log scale; exponentiate yourself
print("pooled RR =", np.exp(res.mean_effect_re))
# Zero cells have to be handled manually, or log() returns -inf
zero = (a == 0) | (c == 0)
a_c, c_c = a.astype(float).copy(), c.astype(float).copy()
a_c[zero] += 0.5; c_c[zero] += 0.5 # the crudest possible approach -- see the three problems abovePython has no meta-analysis library as mature as metafor. statsmodels only accepts effect sizes and variances that have already been computed, so converting 2×2 tables, handling zero cells and applying the small-sample correction for SMD all have to be written by hand. In practice this topic is still R territory.
Reading the report
In a published meta-analysis, this page corresponds to the first few sentences of the “Statistical analysis” paragraph in the Methods. Four things to look for:
- Which effect measure was pooled, and whether a reason is given. “Pooled using a random-effects model” without saying whether the quantity pooled was an RR, an OR or an RD is a substantive omission. The reason should be mechanistic or clinical, not “because heterogeneity was lower”.
- How the raw data became effect sizes. If the paper reports only the pooled value without each study’s and event counts, no reader can check a single cell. A per-study table of 2×2 counts or effect sizes belongs in the supplement.
- Whether there were zero cells, and how they were handled. A meta-analysis of rare events that never mentions zero cells has usually accepted a package default without noticing.
- Whether an OR is being read as an RR. An abstract saying “risk reduced by X%” when the table contains odds ratios is the most common form of overstatement, especially when events are not rare.
Common misuses
| Misuse | Why it is wrong |
|---|---|
| Reading an OR straight off as “the risk is X times higher” | When events are not rare the OR sits systematically further from 1, which exaggerates the effect |
| Building a normal-approximation interval for a ratio on its original scale | The sampling distribution is right-skewed, coverage falls below nominal, and the lower limit can even go negative |
| Reporting only relative measures (RR, OR) and no absolute effect | The reader cannot judge whether it is worth doing clinically; RD and NNT answer that |
| Taking “a large study” to mean one with many participants | The weight comes from the variance, and the variance is driven mainly by the number of events |
| Silently deleting studies with a zero cell | Studies with zero events in one arm are usually the ones pointing most strongly, so deleting them drags the result towards the null |
| Applying a 0.5 continuity correction without saying so and without a sensitivity analysis | The amount added is arbitrary, and different approaches can move the pooled value by tens of percent |
| Pooling different instruments with an MD | Averaging numbers in different units is meaningless; that is what SMD is for |
| Treating the size of an SMD as pure treatment effect | The denominator is each study’s own population variability, so a more homogeneous sample yields a larger SMD |
| Running three effect measures and reporting whichever gives the lowest heterogeneity | Selective reporting; the scale should be chosen by mechanism, not by I² |
| Pooling reported HRs while ignoring differences in follow-up length | With different follow-up periods the studies’ hazard ratios are estimating different things to begin with |
Reproducing every number on this page
/opt/homebrew/bin/Rscript figures/scripts/B7-01-effect-size.RRead the figure
The answer comes from the same statistical output that produced this page's figures, not from a number typed in beside them.
Among these 13 BCG trials, the most lightly weighted one carries 0.31% of the weight. Why is it weighted so lightly?
Show the answer and why
Correct answer: Because it has almost no events - only 5 in the vaccine arm - and the variance of a log risk ratio is dominated by the reciprocals of the event counts
This trial enrolled 4839 people across both arms, which puts it in the middle of these 13 by size, and every trial smaller than it carries more weight. Smallest weight is not smallest trial. The weight is low because the events are few: the variance of a log risk ratio is the reciprocals of the two event counts minus the reciprocals of the two arm sizes, and the event terms dominate while the arm sizes only trim the result. 2498 is its vaccine arm; reading a weight as a share of people enrolled is the other half of the same misreading. In a meta-analysis a large trial always means a trial with many events, not a trial with many participants.
The same simulated trials get two kinds of 95% Wald interval: one built on the raw ratio scale, one built on the log scale and exponentiated back. What do the two actual coverage rates say?
Show the answer and why
Correct answer: The raw-scale version covers the truth only 92.93% of the time, short of nominal, and its lower limit can fall below 0
Built on the log scale and exponentiated back, the interval covers 95.74%, close to nominal; built directly on the ratio scale it covers 92.93%, two to three points short. The shape is exactly why: the raw risk ratios have a skewness of 1.01, a long tail to the right, so the normal approximation does not hold there, and a risk ratio minus nearly two standard errors can be negative, which would be a negative relative risk. Skewness is therefore not a cosmetic matter, it is the cause of the missing coverage. Packages work on the log scale throughout and exponentiate only for plotting and reporting.
Several of these 18 catheter trials contain a zero cell. Keeping all 18 and adding the usual 0.5 correction gives a pooled odds ratio of 0.383. What happens if the trials with a zero cell are simply dropped instead?
Show the answer and why
Correct answer: It moves towards 1, to 0.439, on the 12 trials that survive - the ones dropped are precisely those with no events in the treated arm, the strongest evidence of benefit
Dropping the zero-cell trials moves the pooled odds ratio from 0.383 to 0.439, that is, towards 1. The reason is that most of what gets dropped are trials with no events at all in the treated arm, and those carry the strongest signal of benefit. A zero is not an absence of information, it is a great deal of information. 0.299 is what Mantel-Haenszel returns: it needs no continuity correction and keeps all 18 trials, and it sits further from 1 than any of the corrected estimates, so the claim that dropping makes the effect look stronger has the direction backwards. As for nothing changing, this table is its own counterexample: one random-effects model, one thing varied, and the pooled value shifts by more than a tenth.
The same 9 stroke-unit trials give an I² of 98.97% when pooled as a mean difference and 95.49% when pooled as a standardised mean difference. What does that drop tell you?
Show the answer and why
Correct answer: Nothing at all. The 95.49% and the figure beside it live on two different scales, because switching the measure switches the units of τ² and the within-study variances along with it
I² is a ratio: τ² over τ² plus the typical within-study variance. Switching the measure switches numerator and denominator together. On the mean difference τ² is in days squared; on the standardised mean difference it has no units at all, the within-study variances are computed differently, and the standardised side carries an extra term for the uncertainty in the standard deviation it divided by. So 98.97% and 95.49% are not two marks on one ruler, and comparing them is meaningless. To ask whether the trials really differ less, look at an absolute quantity on one scale. As for 0.07, that is the upper limit of the standardised pooled estimate; the interval crosses 0, so the correct wording is that no difference was detected, not that the effect is nearly significant - nearly significant has no statistical meaning.
Change the effect measure on the same BCG trials and heterogeneity changes face: I² is 92.22% on the risk ratio scale and jumps to 99.94% on the risk difference scale. Why?
Show the answer and why
Correct answer: Because a risk difference keeps the baseline risk inside the effect measure, these trials sit in populations whose baseline rates differ by orders of magnitude, and the tiny variance of a risk difference makes that 99.94% inconsistency look extremely certain
On a ratio scale the baseline risk cancels out, so trials look consistent as long as the relative protection is similar - which is exactly why the risk ratio gives 92.22% and the odds ratio 92.07%, near-identical. Two low figures agreeing is not evidence that both understate; it is evidence that the effect is stable on that scale. A risk difference keeps the baseline: tuberculosis incidence in an urban slum and in a rural district differ by orders of magnitude, so risk differences spread far apart, and because most of them sit right on 0 with very narrow intervals, 99.94% is saying that the spread is large relative to within-study error, not that something was miscalculated. Choose the scale by asking on which one the mechanism is likely to travel across populations, then accept the heterogeneity that scale produces. Running all three and reporting the lowest I² is selective reporting.
A meta-analysis reports a pooled odds ratio of 0.475 in its table, and the abstract turns that into a roughly 50% reduction in tuberculosis risk. Is that a fair reading?
Show the answer and why
Correct answer: It is acceptable here, because tuberculosis is rare in these trials and the risk ratio of 0.489 nearly coincides with the odds ratio - but that is a property of the data, not of the odds ratio
An odds ratio tracks a risk ratio closely when events are rare and sits systematically further from 1 when they are common. Incidence is low in these trials, so 0.475 and the risk ratio of 0.489 nearly coincide, and the abstract does no real damage here. But what makes it safe is the rarity, not any licence to read an odds ratio as a risk ratio. In data with a control-arm event rate of thirty percent, the same odds ratio would correspond to a risk ratio noticeably closer to 1. The risk difference of -0.025 is a different animal altogether: it is the absolute quantity, answering how many cases a vaccinated cohort avoids, and it says nothing about whether a ratio is inflated - using it as proof of inflation compares two different rulers. The sensible practice is to report both the relative and the absolute measure.
Chapters that use this method
Watch next
【Biostatistics Corner】Meta-analysis 基礎篇
Understand What a Meta-Analysis is in Less Than 5 Minutes
An Introduction to Systematic Review and Meta-analysisSources and licences
This page is original writing