Skip to content

Methods and checksMethods

How every result is reached and what it was checked against, app by app.

Methods and checks pages

Inverse-variance meta-analysis of study estimates: fixed effect or DerSimonian–Laird random effects, version 2.0.1

stats-meta-analysis@2.0.1: this version's equations with their symbols, each constant's value, their sources and whether each was read, a worked example where the record holds one, its level and what it was checked against, the number of cases, and what was not checked. This version's record is not rewritten; a correction is added under Changes.

What this page can and cannot show

Level: Checked against a reference; statsmodels 0.15.0 and printed Higgins 2003/2009 values; p treats within-study variances as known. Reference kind: an outside program, mpmath, mpmath 1.4.1; an outside program, statsmodels combine_effects; SciPy, statsmodels 0.15.0; scipy 1.18.1; the source's own worked example, printed values; mpmath for the unprinted values and the propagation, mpmath 1.4.1; a reference program this project wrote itself, second implementation (Python 3.13; NumPy, SciPy distribution functions and mpmath only), 2026-11-14, mpmath 1.4.1 at 80 decimal digits, rounded once to double; the normal and t quantiles from SciPy 1.18.1's distribution functions; not an outside program.

Checked by this project, not independently reviewed. Every method on this page has its equations, constants, sources and cases on record, and its cases agree with the stated reference within the stated tolerance. A reader can follow each method's worked example by hand; that shows the stated method gives the stated answer for one set of inputs, and does not test the code. The other cases and their values are not printed, so a reader cannot re-run these checks. No independent scientist has yet reviewed them.

Every version of this method · Every method · What the levels mean

Version 2.0.1

Level: Checked against a reference; statsmodels 0.15.0 and printed Higgins 2003/2009 values; p treats within-study variances as known. Reference kind: an outside program, mpmath, mpmath 1.4.1; an outside program, statsmodels combine_effects; SciPy, statsmodels 0.15.0; scipy 1.18.1; the source's own worked example, printed values; mpmath for the unprinted values and the propagation, mpmath 1.4.1; a reference program this project wrote itself, second implementation (Python 3.13; NumPy, SciPy distribution functions and mpmath only), 2026-11-14, mpmath 1.4.1 at 80 decimal digits, rounded once to double; the normal and t quantiles from SciPy 1.18.1's distribution functions; not an outside program. stats-meta-analysis@2.0.1

Built, not hosted. Generated from a snapshot of the library's records taken on 2026-11-25, as committed on 2026-11-25. A later snapshot replaces this one, so these records and this page can change.

Verification statement: Equations as in Deeks and Higgins's RevMan algorithms (May 2022 edition read 11 November 2026; August 2010 edition re-read at source 14 November 2026, the same), and Higgins 2003 and 2009. Compared with statsmodels 0.15.0 combine_effects (DerSimonian–Laird) on 68 cases: fixed-effect values where τ² truncates, and none where its uncentred sums lose digits. Also compared with Higgins 2009 Table 1 and seven rows of Higgins 2003 Tables 1–2 at printed precision, and with an 80-digit second implementation in Python by a separate agent of the same model family (112 cases run, 109 in the fixture, 3 left out; 28 at the edges). Prediction interval on t(k − 2) (Higgins 2009, eq. 12). p treats within-study variances as known.

From one estimate and its standard error per study, on a difference or log-ratio scale, the inverse-variance fixed-effect or DerSimonian–Laird random-effects pooled estimate with its SE, Wald interval, z and p, Cochran's Q with its p, I², and in random mode τ², τ and, from five studies, a prediction interval; each study's interval and weight.

  • How results are reported: none: full double precision
  • Uncertainty: Wald intervals from the inverse-variance SE, treating within-study variances as known; in random mode the uncertainty in τ̂² is not carried into the interval; its coverage is not checked
  • Every reply through it says: A non-small Q p or an I² of zero does not show that the studies agree: Q has low power when studies are few or small. I² describes heterogeneity relative to the studies' precision, not its size. The model was chosen by the caller, not from these statistics. Q's p and the z test's p are approximate: they treat within-study variances as known. With few studies the z-based interval can be too narrow, very likely so with two or three.
  • Computes through this project's own routines: the Wald intervals' z quantile; the z test's two-sided p; Q's p on k − 1 df; the prediction interval's t quantile on k − 2 df
  • Reference, as its record states it: statsmodels 0.15.0 combine_effects (DerSimonian–Laird), Higgins 2003 and 2009's printed values and an 80-digit second implementation in Python
  • Level confirmed by this project's ruling of 21 November 2026

What this page can and cannot show

What was checked

193 cases in 4 files, linked by this exact version.

Run through the tool at build against an outside program, mpmath, mpmath 1.4.1; an outside program, statsmodels combine_effects; SciPy, statsmodels 0.15.0; scipy 1.18.1; the source's own worked example, printed values; mpmath for the unprinted values and the propagation, mpmath 1.4.1; a reference program this project wrote itself, second implementation (Python 3.13; NumPy, SciPy distribution functions and mpmath only), 2026-11-14, mpmath 1.4.1 at 80 decimal digits, rounded once to double; the normal and t quantiles from SciPy 1.18.1's distribution functions; not an outside program: 147 agree within the tolerance the file states, 46 refuse as the case expects, 0 differ, 0 were not run.

  • File 1, 47 cases

    • Where the expected values came from: an outside program, mpmath mpmath 1.4.1
    • Recorded on: 2026-11-14
    • Reference: mpmath, mpmath 1.4.1; licence BSD-3-Clause
    • Tolerance as the file states it: relative 1e-12 against the 50-digit transcription (near zero, 1e-15 absolute below 1e-3 in the value's unit); on the log scale (SE, τ in ln(1), τ² in ln(1)^2) 1e-13 absolute; counts, df, names, codes, statuses and tau2Truncated exact
  • File 2, 27 cases

    • Where the expected values came from: an outside program, statsmodels combine_effects; SciPy statsmodels 0.15.0; scipy 1.18.1
    • Recorded on: 2026-11-14
    • Reference: statsmodels combine_effects; SciPy, statsmodels 0.15.0; scipy 1.18.1; licence BSD-3-Clause
    • Tolerance as the file states it: relative 1e-12 (near zero, 1e-14 absolute below 1e-2 in the value's unit); on the log scale (SE, τ in ln(1), τ² in ln(1)^2) 1e-12 absolute; p-values relative 1e-10 (1e-300 absolute below 1e-290); counts, df, names, codes, statuses and tau2Truncated exact (Drybench's 1e-12, M4 (ii))
  • File 3, 10 cases

    • Where the expected values came from: the source's own worked example, Higgins, Thompson and Spiegelhalter 2009 (PMC2667312, read 11 November 2026) Table 1 and §7; Higgins et al. 2003 (PMC192859, read 11 November 2026) Tables 1 and 2
    • Recorded on: 2026-11-14
    • Reference: printed values; mpmath for the unprinted values and the propagation, mpmath 1.4.1; licence BSD-3-Clause
    • Tolerance as the file states it: each case states its own: printed values at half a unit of their print plus twice the first-order propagation of the inputs' rounding; the rest relative 1e-12 against mpmath; counts, names, codes and statuses exact
  • File 4, 109 cases

    • Where the expected values came from: an outside program, second implementation (Python 3.13; NumPy, SciPy distribution functions and mpmath only) 2026-11-14
    • Recorded on: 2026-11-14
    • Reference: second implementation (Python 3.13; NumPy, SciPy distribution functions and mpmath only), 2026-11-14; licence BSD-3-Clause
    • Tolerance as the file states it: every number relative 1e-9 (absolute 1e-12 below 1e-3, as rounding residue on a pooled estimate or z that is 0 by symmetry; p absolute 1e-307 below 1e-297); counts, flags, statuses, codes and strings exact

Apart from the worked example, the cases and their values are not printed here. This shows agreement with this project's recorded cases. It does not show that a method suits your work, and it is not a qualification.

What was not checked

The DerSimonian–Laird estimator is named as given in Deeks and Higgins's RevMan algorithms (the August 2010 edition, re-read at source on 14 November 2026; the May 2022 edition, read once by the builder on 11 November 2026 and not re-read): DerSimonian and Laird 1986 is not read. Hartung–Knapp, REML and Paule–Mandel, intervals for τ² or I², inputs from counts or from means and SDs, and SEs derived from published intervals are not offered. The prediction interval's multiplier is a judgement among three published choices (t on k − 2, t on k − 1, z); Higgins 2009's Table 1 cannot tell t(k − 2) from t(k − 1) or z; the Whitehead and Whitehead estimator of that table is taken as the DerSimonian–Laird moment estimator from the numbers, not from a read source. Higgins 2009 Table 1's printed P = 0.02 (Q = 16.73 on 13 df gives 0.21) and its "credible interval" for a classical interval are source anomalies, not asserted. Coverage of the intervals is not checked. The copy's claims rest on the Cochrane Handbook 6.5.1, chapter 10: §10.10.2 (the χ² test's low power with few or small studies; "a non-significant result must not be taken as evidence of no heterogeneity"), §10.10.4.4 (the Wald interval "can yield overly narrow confidence intervals … particularly when there are few studies") and §10.10.4.5 ("very likely to be too narrow" with two or three studies), §10.10.4.1 ("The choice between a fixed-effect and a random-effects meta-analysis should never be made on the basis of a statistical test for heterogeneity"), §10.10.4.4 (I² = Tau²/(Tau² + the typical within-study variance), which equals the Q form under DerSimonian–Laird: I² is relative to the studies' precision) and MECIR C63, Box 10.10.b ("use of simple thresholds to diagnose heterogeneity should be avoided").

Definition or model

A closed form: the result follows from the inputs by the equations alone.

Equations

Equation 1

wᵢ = 1/SEᵢ²
θ̂_IV = Σwᵢθ̂ᵢ / Σwᵢ
SE(θ̂_IV) = 1/√Σwᵢ (weights carried relative to the smallest SE and estimates centred on the first study's: Our derivation, the same quantities without overflow or cancellation)
Symbol Meaning and unit
θ̂ᵢ study estimate on the analysis scale (in the estimates' unit, or ln of the ratio), as-given
wᵢ inverse-variance weight; the reply's weight is 100% × wᵢ/Σwⱼ with the model's weights (wᵢ fixed, wᵢ′ random), 1/as-given^2
SEᵢ its standard error (in the estimates' unit, or ln of the ratio), as-given

Source: Deeks JJ, Higgins JPT, on behalf of the Statistical Methods Group of The Cochrane Collaboration. Statistical algorithms in Review Manager 5. August 2010, section p. 6, the inverse-variance weights and eqs (7) and (8), August 2010 (Review Manager 5), the PDF served at this address, read at check on 14 November 2026: the same equations at the same pages as the May 2022 edition (Statistical algorithms in Review Manager, SHA-256 dc6a98e3ba02109daa5512946539b72af57fc1fe3ce5a9a2ed2f3c89cc25e712), which was read once, by the builder, on 11 November 2026 and not re-read; read in full on 2026-11-14 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning edaa41107798. Free to read (free to read; no licence statement (held for legal review)), checked 2026-11-14. No erratum found (searched the document's title page and the Cochrane page that serves it), 2026-11-14.

Equation 2

Q = Σwᵢ(θ̂ᵢ − θ̂_IV)², summed from the deviations (never as Σwθ² − (Σwθ)²/Σw), χ² on k − 1 df under no differences, in both models
Q's p = P(χ²_{k−1} ≥ Q)
Symbol Meaning and unit
Q Cochran's Q
k studies

Source: Deeks JJ, Higgins JPT, on behalf of the Statistical Methods Group of The Cochrane Collaboration. Statistical algorithms in Review Manager 5. August 2010, section p. 6, Q_IV, its χ² reference and I²; Higgins et al. 2003, the I² definition with negatives set to 0, August 2010 (Review Manager 5), the PDF served at this address, read at check on 14 November 2026: the same equations at the same pages as the May 2022 edition (Statistical algorithms in Review Manager, SHA-256 dc6a98e3ba02109daa5512946539b72af57fc1fe3ce5a9a2ed2f3c89cc25e712), which was read once, by the builder, on 11 November 2026 and not re-read; read in full on 2026-11-14 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning edaa41107798. Free to read (free to read; no licence statement (held for legal review)), checked 2026-11-14. No erratum found (searched the document's title page and the Cochrane page that serves it), 2026-11-14.

Equation 3

I² = 100% × (Q − df)/Q with negative values put equal to 0, so that I² lies between 0% and 100%
reported as 0 whenever Q ≤ k − 1, Q = 0 included (Our convention: the source's limit at Q = 0)
Symbol Meaning and unit
df k − 1

Source: Higgins JPT, Thompson SG, Deeks JJ, Altman DG. Measuring inconsistency in meta-analyses. BMJ 2003;327:557–560, section the paragraph defining I² ("Negative values of I2 are put equal to zero"), and Tables 1 and 2, version of record, PMC full text (PMC192859); read in full on 2026-11-11 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning 7419421ba25b. Free to read (free to read on PMC; © 2003 BMJ Publishing Group, no Creative Commons licence), checked 2026-11-11. No erratum found (searched Europe PMC: the record's comment and correction list (PMID 12958120): one comment (Acta Orthop 2016), no erratum, Crossref: update and relation metadata for 10.1136/bmj.327.7414.557), 2026-11-11.

Equation 4

a prediction interval only from k ≥ 5 studies
below, withheld (TOO_FEW_STUDIES)
Symbol Meaning and unit
k studies

Source: Deeks JJ, Higgins JPT, Altman DG, McKenzie JE, Veroniki AA, Simmonds M (editors). Chapter 10: Analysing data and undertaking meta-analyses. Cochrane Handbook for Systematic Reviews of Interventions version 6.5.1, 2026, section §10.10.4.3: "can be very problematic when the number of studies is small … we encourage their use when the number of studies is reasonable (e.g. five or more"; §10.10.4.4 for RevMan's z multiplier with Wald intervals, version 6.5.1, chapter last updated November 2026; read in full on 2026-11-11 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning a9233f8a9667. Free to read (free to read; no licence statement (held for legal review)), checked 2026-11-11. No erratum found (searched the chapter page's version and update line), 2026-11-11.

Equation 5

τ̂² = max((Q − (k − 1)) / (Σwᵢ − Σwᵢ²/Σwᵢ), 0), the denominator computed as Σwᵢ(S − wᵢ)/S with S = Σwᵢ (Our derivation: the same quantity without cancellation when one weight dominates)
wᵢ′ = 1/(SEᵢ² + τ̂²)
θ̂_DL = Σwᵢ′θ̂ᵢ / Σwᵢ′
SE(θ̂_DL) = 1/√Σwᵢ′
with τ̂² = 0 the weights and results are the fixed-effect ones
Symbol Meaning and unit
τ̂² between-study variance (in the caller's unit squared); the reply's tau2Truncated is true when Q < k − 1 and τ̂² was set to 0, as-given^2

Source: Deeks JJ, Higgins JPT, on behalf of the Statistical Methods Group of The Cochrane Collaboration. Statistical algorithms in Review Manager 5. August 2010, section p. 8, the DerSimonian and Laird τ̂², the random-effects weights and eqs (13) and (14), and the note that Q ≤ k − 1 gives τ̂² = 0, August 2010 (Review Manager 5), the PDF served at this address, read at check on 14 November 2026: the same equations at the same pages as the May 2022 edition (Statistical algorithms in Review Manager, SHA-256 dc6a98e3ba02109daa5512946539b72af57fc1fe3ce5a9a2ed2f3c89cc25e712), which was read once, by the builder, on 11 November 2026 and not re-read; read in full on 2026-11-14 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning edaa41107798. Free to read (free to read; no licence statement (held for legal review)), checked 2026-11-14. No erratum found (searched the document's title page and the Cochrane page that serves it), 2026-11-14.

Equation 6

interval θ̂ ± z₍₁₊ₗ₎/₂ × SE (the source prints the deviate as "Φ(1 − α/2)", read as the quantile Φ⁻¹(1 − α/2))
Z = θ̂/SE with the two-sided normal p
on 'log-ratio' the estimate and limits are exponentiated
each study's own interval likewise from its SE
Symbol Meaning and unit
l the caller's level

Source: Deeks JJ, Higgins JPT, on behalf of the Statistical Methods Group of The Cochrane Collaboration. Statistical algorithms in Review Manager 5. August 2010, section p. 8, Confidence intervals; p. 9, Test for presence of an overall intervention effect, August 2010 (Review Manager 5), the PDF served at this address, read at check on 14 November 2026: the same equations at the same pages as the May 2022 edition (Statistical algorithms in Review Manager, SHA-256 dc6a98e3ba02109daa5512946539b72af57fc1fe3ce5a9a2ed2f3c89cc25e712), which was read once, by the builder, on 11 November 2026 and not re-read; read in full on 2026-11-14 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning edaa41107798. Free to read (free to read; no licence statement (held for legal review)), checked 2026-11-14. No erratum found (searched the document's title page and the Cochrane page that serves it), 2026-11-14.

Equation 7

random mode, k ≥ 5: μ̂ ± t₍ₖ₋₂₎ √(τ̂² + SE(μ̂)²), μ̂ = θ̂_DL and SE(μ̂) = SE(θ̂_DL), t at (1 + l)/2 for the caller's level l, with the DerSimonian–Laird τ̂² above. The Cochrane Handbook 6.5.1 §10.10.4.3 prints k − 1 and RevMan with Wald intervals uses z, so values differ from both
Symbol Meaning and unit
t₍ₖ₋₂₎ Student's t quantile on k − 2 df

Source: Higgins JPT, Thompson SG, Spiegelhalter DJ. A re-evaluation of random-effects meta-analysis. J R Stat Soc A 2009;172(1):137–159, section §5.4, eqs (11) and (12): "the 100(1−α/2)% percentile of the t-distribution with k−2 degrees of freedom"; the floor of five studies from the Cochrane Handbook §10.10.4.3 ("we encourage their use when the number of studies is reasonable (e.g. five or more"), version of record, Europe PMC full text (PMC2667312) and its equation images; read in full on 2026-11-11 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning b869c16d63b0. Free to read (Creative Commons Attribution 2.5 as stated, with a line saying it does not permit commercial exploitation (held for legal review)), checked 2026-11-11. No erratum found (searched Europe PMC: the record's comment and correction list (PMID 19381330), Crossref: update and relation metadata for 10.1111/j.1467-985X.2008.00552.x), 2026-11-11.

Conventions

What each mode computes:

  • model = fixed: The inverse-variance weighted mean of the study estimates, one common effect assumed; no τ², τ or prediction interval: the fixed model has no between-study variance.
  • model = random-dersimonian-laird: The mean of a normal distribution of study effects, each study weighted by 1/(SE² + τ̂²) with τ̂² by DerSimonian–Laird; not a common effect.
  • scale = difference: Estimates pooled as given, in their own unit.
  • scale = log-ratio: Ratios pooled on the natural log; the estimate and limits are returned as ratios, the SE, τ and τ² on the log scale.

Constants

Constants: none used.

Worked example

Worked example: one case of stats-meta-analysis@2.0.1, from its inputs through each step to the answer. Values are written as a person writes them; the working carries more digits, so your own figure may differ in the last digit shown.

Inputs

  • model = random-dersimonian-laird
  • scale = difference
  • independence = independent
  • level = 0.95
  • studies.names[0] = A
  • studies.names[1] = B
  • studies.names[2] = C
  • studies.estimates[0] = 0
  • studies.estimates[1] = 2
  • studies.estimates[2] = 4
  • studies.standardErrors[0] = 1
  • studies.standardErrors[1] = 1
  • studies.standardErrors[2] = 1

Steps

  1. w = 1, from studies.standardErrors; by equation 1.
  2. theta-iv = 2, from studies.estimates, w; by equation 1.
  3. q = 8, from studies.estimates, theta-iv, w; by equation 2; gives heterogeneity.q.
  4. i2 = 75 %, from q; by equation 3; gives heterogeneity.i2.
  5. tau2 = 3, from q, w; by equation 5; gives heterogeneity.tau2.
  6. theta-dl = 2, from studies.estimates, tau2; by equation 5; gives estimate.
  7. se-dl = 1.1547005, from tau2; by equation 5; gives standardError.
  8. z = 1.7320508, from theta-dl, se-dl; by equation 6; gives z.

The working, as the case writes it:

By hand: SEs all 1, so wᵢ = 1 and Σw = 3. θ̂_IV = (0 + 2 + 4)/3 = 2
SE = 1/√3
Q = 4 + 0 + 4 = 8 on 2 df
I² = (8 − 2)/8 = 75 %
DL denominator 3 − 3/3 = 2, τ̂² = (8 − 2)/2 = 3
wᵢ′ = 1/(1 + 3) = 1/4, so θ̂_DL = 2, SE = 1/√(3/4) = 2/√3, τ = √3, z = 2/(2/√3) = √3, weights 1/3 each (Deeks and Higgins 2022, pp. 6 and 8).

Answer

  • heterogeneity.q = 8
  • heterogeneity.i2 = 75 %
  • heterogeneity.tau2 = 3
  • estimate = 2
  • standardError = 1.1547005
  • z = 1.7320508

Where these values came from: an outside program, mpmath mpmath 1.4.1; mpmath 1.4.1 at 50 digits.

At build the tool returned this answer within the tolerance the file states: relative 1e-12 against the 50-digit transcription (near zero, 1e-15 absolute below 1e-3 in the value's unit); on the log scale (SE, τ in ln(1), τ² in ln(1)^2) 1e-13 absolute; counts, df, names, codes, statuses and tau2Truncated exact.

Who worked this case: not recorded.

What it refuses, and its input ranges

  • LENGTHS_DIFFER (invalid input): the names, estimates and standard errors differ in length
  • NONPOSITIVE_ON_LOG (invalid input): a ratio at or below 0 on 'log-ratio'
  • SE_RANGE_NOT_REPRESENTABLE (invalid input): a standard error below 1e-75 or above 1e75: double precision cannot then square and weight every SE (their ratio is then at most 1e150, so every relative weight is at least 1e-300; Drybench's A4 ruling of 11 November 2026, item 2; the code is a placeholder until Drybench names it)

Flags and notes a reply may carry

A note a reply may carry:

  • RANDOM_EFFECTS: τ is on the scale of the effects. A τ² of 0 does not show that the studies agree.

Changes

2026-11-21-stats-meta-analysis@2.0.1-1

2026-11-21 · stats-meta-analysis@2.0.1 · Corrections to our methods

  • What was wrong: The shared normal distribution function returned no number for the z test's p at very large |z|: its continued fraction never met its stopping test there. The library's result check then refused the whole reply as RESULT_OUTSIDE_DOUBLE_RANGE, so the pooled estimate, its SE and interval were lost where only p, below 1e-300, should have been withheld.
  • Affected: stats_meta_analysis in version 2.0.0, only where the pooled estimate is very many SEs from zero (|z| sporadically from about 3e6, regularly from about 2.2e8): 528 of the 28,458 calls of the audit probe, which spans z and Q from 1e7 to 1e300 in both models. No number it served moved; those calls were refusals.
  • What changed: In 2.0.1 the normal tail at such z is the 0 it rounds to (the incomplete gamma's leading factor rounds to 0 and the fraction, at most 1/(x−a+1) for a ≥ 1 (8.2.2), at most 1/x for a ≤ 1 (8.10.1); below 1 in both, is not run), so those calls are computed, with p withheld as P_BELOW_FLOOR. Every value the function returned as a number is unchanged in every bit, and every case of the method's fixtures keeps its output hash.
  • How it was found: An audit probe of every served tool reaching the shared function, 21 November 2026, re-run on the fix: the 528 replies are the ones the probe's limit-patched run gave.
  • Cases added: stored reference values (the shared function's regressions); the probe's replies before and after the fix are compared call by call. The fixtures carry with a declared closure change.

Tools that use it

Cite this version

Inverse-variance meta-analysis of study estimates: fixed effect or DerSimonian–Laird random effects. Drybench; stats-meta-analysis@2.0.1; https://www.drybench.com/methods/m/stats-meta-analysis/2.0.1 (accessed [date]).