Skip to main content
v2026.11,986 entries · CC-BY 4.0

How to Perform a Meta-Analysis: Steps, Formulas and a Worked Example

Seven steps to perform a meta-analysis, with a worked inverse-variance, Q, I² and τ² calculation and Excel, R and Python code to reproduce it.

Written and maintained by CASRAI Editorial Board

Published · Last updated

On this page

To perform a meta-analysis, you define a focused question and protocol, search and screen studies systematically, extract an effect estimate and its standard error from every study, convert them to one common effect measure, pool them with an inverse-variance weighted average under a fixed-effect or random-effects model, quantify heterogeneity, test robustness, and report the whole process against PRISMA 2020. The statistical core is small enough to do by hand, and this guide shows the arithmetic with illustrative numbers before giving Excel, R and Python code that reproduces it.

Definition in one paragraph

Meta-analysis is the statistical combination of results from two or more separate studies, yielding an overall statistic together with its confidence interval (Cochrane Handbook, chapter 10). It is carried out in two stages: a summary statistic is calculated for each study, then a weighted average of those statistics is taken (section 10.2.1). See also the meta-analysis dictionary entry.

How to perform a meta-analysis: the seven steps at a glance

Whether you search for how to perform a meta analysis, a meta-analysis or a meta-analysis of randomised trials, the sequence is the same. Statistical pooling is only step 4; the other six steps decide whether the pooled number means anything.

  1. Question and protocol. Fix the population, intervention or exposure, comparator and outcome before searching, and register the protocol (see how to register a systematic review on PROSPERO).
  2. Search and screen. Run reproducible searches in several databases and screen records against pre-set criteria, as set out in PRISMA and systematic review methodology.
  3. Extract data and choose an effect measure. Record, for each study, an effect estimate and its standard error (or the raw counts and means needed to compute them).
  4. Pool the estimates. Weight each study by the inverse of the variance of its effect estimate.
  5. Assess heterogeneity. Examine whether studies differ more than chance alone would explain.
  6. Check publication bias and robustness. Use funnel-plot methods only with enough studies, and repeat the analysis under alternative decisions.
  7. Report. Follow the PRISMA 2020 checklist and state the statistics in full.

Step 1: Define the question and write the protocol

A meta-analysis answers one clearly bounded question. Before any search, decide the participants, the intervention or exposure, the comparison and the outcome, and decide which study designs are eligible. Writing these down in a protocol, and registering it, prevents outcome and analysis choices from drifting once you have seen the data. The Cochrane Handbook says the studies you pool must be similar enough in participants, interventions, comparisons and outcomes that a combined answer is clinically meaningful; judging that similarity is a reasoning task, not a statistical one. A meta-analysis is a statistical step that can sit inside a systematic review, and a systematic review need not contain one; the difference is set out in systematic review vs meta-analysis.

Step 2: Search for and screen studies

Search more than one database, document the search strings and dates, and screen titles, abstracts and full texts against the eligibility criteria, ideally with two independent reviewers. PRISMA 2020 (Page et al., BMJ 2021;372:n71) is a 27-item checklist for reporting this process, including a flow diagram of records identified, screened and included. Keep the screening log, because you will report every number in it.

Step 3: Extract data and choose an effect measure

Meta-analysis is a two-stage process: first a summary statistic is calculated for each study, then a weighted average of those statistics is taken (Cochrane Handbook, section 10.2.1). Your extraction form therefore needs whatever allows a summary statistic and its standard error to be computed for every study. See systematic review data extraction forms for layout.

Choosing the effect measure

For binary outcomes, relative measures such as the risk ratio or odds ratio are generally more consistent across studies than the risk difference (Cochrane Handbook, section 10.4.3). For continuous outcomes, use the mean difference when every study measured the outcome on the same scale, and the standardised mean difference when studies used different scales (section 10.5.1); see standardised mean difference and Hedges g and the dictionary entry on effect size. Ratio measures are pooled on the log scale, so you carry the log estimate and its standard error into the next step.

Step 4: Pool the estimates (fixed-effect and random-effects)

The formulas, with every symbol explained

Let k be the number of studies, yi the effect estimate from study i and SEi its standard error. The Cochrane Handbook (section 10.3) weights each study by the inverse of the variance of its estimate, so larger, more precise studies count for more:

  • Weight: wi = 1 / SEi²
  • Pooled estimate: ȳ = Σ(wiyi) / Σwi
  • Standard error of the pooled estimate: SE = 1 / √Σwi, and the 95% confidence interval is ȳ ± 1.96 × SE
  • Cochran’s Q: Q = Σ wi(yi − ȳ)², compared with a χ² distribution on k − 1 degrees of freedom
  • I² = max(0, (Q − df) / Q), with df = k − 1
  • DerSimonian-Laird between-study variance: τ² = max(0, (Q − df) / (Σwi − Σwi² / Σwi))
  • Random-effects weight: wi* = 1 / (SEi² + τ²), then repeat the pooled estimate and standard error with wi*

The fixed-effect model assumes all studies estimate the same underlying intervention effect (section 10.3.1). The random-effects model assumes the effects differ but are related, and gives relatively more weight to smaller studies than the fixed-effect model does; when there is no heterogeneity the two give identical results (section 10.10.4). The Cochrane Handbook states that this choice should never be made on the basis of a statistical test for heterogeneity (section 10.10.4.1). Choose the model from the question and the clinical and methodological plausibility that effects are identical, and pre-specify it in the protocol. For REML and Hartung-Knapp alternatives to DerSimonian-Laird, see inverse-variance weighting in meta-analysis.

Worked example with real arithmetic

The five studies below are illustrative numbers, not real trials. Each y is a standardised mean difference and each SE its standard error.

Study y SE w = 1/SE² w × y w × (y − 0.2922)²
A 0.30 0.10 100.00 30.00 0.0061
B 0.55 0.15 44.44 24.44 2.9547
C 0.10 0.12 69.44 6.94 2.5643
D 0.45 0.20 25.00 11.25 0.6228
E 0.20 0.18 30.86 6.17 0.2622
Sum 269.75 78.81 6.4101
  1. Fixed-effect pooled estimate: 78.81 / 269.75 = 0.2922.
  2. Standard error: 1 / √269.75 = 0.0609, so the 95% CI is 0.2922 ± 1.96 × 0.0609 = 0.17 to 0.41.
  3. Q: 6.41 on df = 4, which gives P = 0.17.
  4. I²: (6.41 − 4) / 6.41 = 0.376, or 38%.
  5. τ² (DerSimonian-Laird): the denominator is Σw − Σw²/Σw = 201.63, so τ² = (6.41 − 4) / 201.63 = 0.0120.
  6. Random-effects weights 1 / (SE² + 0.0120) are 45.55, 29.03, 37.95, 19.25 and 22.55, summing to 154.32. The random-effects pooled estimate is 0.3019 with SE 0.0805, giving a 95% CI of 0.14 to 0.46.

Notice what happened: the point estimate barely moved (0.29 to 0.30) but the interval widened (width 0.24 to 0.32) because between-study variance is now acknowledged, and the large study A lost weight (from 37% to 30% of the total) while small study D gained (from 9% to 12%).

Step 5: Assess heterogeneity

A low P value for the χ² test of Q is evidence of heterogeneity, but the test has low power when there are few or small studies; I² describes the percentage of variability in effect estimates due to heterogeneity rather than chance, and the Handbook warns that simple I² thresholds can mislead (section 10.10.2). τ² is the between-study variance and τ its standard deviation, on the scale of the effect measure. Heterogeneity estimates are unreliable with few studies (section 10.10.4.5). A prediction interval, which describes where the effect in a new study might fall, is encouraged when there are about five or more studies and no funnel plot asymmetry (sections 10.10.4.2 and 10.10.4.3). In the example, I² is 38% from only five studies, so treat it as an imprecise estimate. If heterogeneity matters, explore it with the subgroup and meta-regression methods in subgroup and sensitivity analysis in meta-analysis.

Step 6: Check publication bias and robustness

Sensitivity analysis repeats the analysis with alternative decisions to ask whether the findings are robust to the decisions made in obtaining them (Cochrane Handbook, section 10.14). Typical alternatives are leaving out each study in turn, switching between fixed-effect and random-effects models, or restricting to studies at low risk of bias. For small-study effects, tests for funnel plot asymmetry should be used only when at least 10 studies are included (section 13.3.4.4), because power is low otherwise. See how to detect and assess publication bias.

The data table below collects the minimum-study thresholds that the Cochrane Handbook gives for the procedures you are most tempted to run on a small meta-analysis.

Interpretation: what the result means

A meta-analysis reports several numbers, and each answers a different question. The table below summarises how to read them, using the Cochrane Handbook (chapter 10) wording, with the worked example’s values from Step 4 for illustration.

Statistic What it tells you Reading guidance Worked example
Pooled estimate and 95% CI The weighted average effect and the range of values compatible with the data Judge the size and direction of the effect and the width of the interval, not only whether it excludes no effect 0.30 (0.14 to 0.46), random-effects
Q (chi-squared) P value Whether observed differences between studies are compatible with chance alone A low P value indicates heterogeneity; a non-significant result must not be taken as evidence of no heterogeneity, because power is low with few studies (section 10.10.2) Q = 6.41, df = 4, P = 0.17
I² The proportion of variability in effect estimates due to heterogeneity rather than chance Rough guide for randomised trials (section 10.10.2): 0% to 40% might not be important; 30% to 60% may represent moderate heterogeneity; 50% to 90% may represent substantial heterogeneity; 75% to 100% considerable heterogeneity. The Handbook says these thresholds can mislead, and that importance depends on the size and direction of effects and the strength of evidence for heterogeneity 38%, overlapping the lowest two bands, from only five studies
τ² (and τ) The estimated between-study variance of underlying effects; τ is its square root, the estimated standard deviation of underlying effects On the scale of the effect measure, so compare it with the effect size, not with I² bands τ² = 0.012, so τ is about 0.11
Prediction interval The spread of underlying effects, i.e. where the effect in a new study might fall Relies on a normal distribution and can mislead with few studies; suggested with about five or more studies and no clear funnel plot asymmetry (section 10.10.4.3) Not computed here; five studies is the borderline case

Step 7: Report the meta-analysis

Report the review against PRISMA 2020 and give each statistic in full. A results sentence in APA-style formatting, using the example above, reads:

A random-effects meta-analysis of five studies (DerSimonian-Laird estimator) gave a pooled standardised mean difference of 0.30, 95% CI [0.14, 0.46]; Q(4) = 6.41, p = .17, I² = 38%, τ² = 0.012.

Present the study-level estimates and the pooled result in a forest plot; how to read a forest plot explains the layout.

How to perform a meta-analysis in Excel, R or Python

Excel

Put y in column B and SE in column C, rows 2 to 6. Then:

D2: =1/C2^2                       (fill down)
E2: =D2*B2                        (fill down)
Pooled:  =SUM(E2:E6)/SUM(D2:D6)           -> 0.2922
SE:      =1/SQRT(SUM(D2:D6))              -> 0.0609
Q:       =SUMPRODUCT(D2:D6,(B2:B6-F1)^2)  (F1 holds the pooled value) -> 6.41
I2:      =MAX(0,(Q-4)/Q)                  -> 0.376
tau2:    =MAX(0,(Q-4)/(SUM(D2:D6)-SUMSQ(D2:D6)/SUM(D2:D6)))  -> 0.0120
P (Q):   =CHISQ.DIST.RT(Q,4)              -> 0.17

R

library(metafor)
yi  <- c(0.30, 0.55, 0.10, 0.45, 0.20)
sei <- c(0.10, 0.15, 0.12, 0.20, 0.18)
rma(yi = yi, sei = sei, method = "FE")   # fixed-effect
rma(yi = yi, sei = sei, method = "DL")   # random-effects, DerSimonian-Laird

The metafor package is covered in depth in meta-analysis in R with metafor.

Python

import math
y  = [0.30, 0.55, 0.10, 0.45, 0.20]
se = [0.10, 0.15, 0.12, 0.20, 0.18]
w  = [1/s**2 for s in se]
sw = sum(w)
pooled = sum(a*b for a, b in zip(w, y)) / sw
q  = sum(a*(b-pooled)**2 for a, b in zip(w, y))
df = len(y) - 1
i2 = max(0, (q-df)/q)
tau2 = max(0, (q-df) / (sw - sum(a*a for a in w)/sw))
w_re = [1/(s**2 + tau2) for s in se]
pooled_re = sum(a*b for a, b in zip(w_re, y)) / sum(w_re)
se_re = 1/math.sqrt(sum(w_re))
print(pooled, q, i2, tau2, pooled_re, se_re)

Assumptions and common mistakes when performing a meta-analysis

  • Ignoring the assumptions behind the model. Pooling assumes that the studies are independent (the same participants must not be counted twice, for example when one trial has several reports or arms are shared), that the effect estimates are on one comparable effect measure and scale, and that the chosen model fits the question: fixed-effect assumes one common true effect, random-effects assumes related but different effects (sections 10.3.1 and 10.10.4).
  • Choosing the model by the heterogeneity test. The Handbook says never to do this (section 10.10.4.1); decide on the question and pre-specify.
  • Running a funnel-plot asymmetry test on fewer than 10 studies (section 13.3.4.4).
  • Running meta-regression on a handful of studies. It should generally not be considered with fewer than ten studies, and at least ten per characteristic modelled (sections 10.11.4 and 10.11.5.1).
  • Pooling studies that ask different questions because the statistics allow it.
  • Treating I² bands as verdicts. Simple thresholds can mislead (section 10.10.2).
  • Pooling raw ratios instead of log ratios.

FAQ

How do you perform a meta-analysis step by step?

Define the question and protocol, search and screen, extract effect estimates with standard errors, pool them with inverse-variance weights, assess heterogeneity, test robustness and publication bias, then report against PRISMA 2020. The seven steps above expand each one.

How do you perform a meta-analysis in Excel?

Compute w = 1/SE² per study, then the weighted mean, Q, I² and τ² with the SUM and SUMPRODUCT formulas shown above. Excel has no built-in meta-analysis function, so the formulas are entered by hand.

How many studies do you need for a meta-analysis?

Two or more studies can be combined (Cochrane Handbook, chapter 10), but several procedures need more: about 5 for prediction intervals, 10 for funnel-plot asymmetry tests and 10 for meta-regression.

Fixed-effect or random-effects?

Fixed-effect assumes one common true effect; random-effects assumes related but different effects and gives smaller studies relatively more weight. Choose from the question, not from a heterogeneity test.

What software performs a meta-analysis?

Any environment that can compute weighted averages works; the metafor package in R, and Python or Excel with the formulas above, reproduce the same numbers. The meta-analysis dictionary entry gives the definition.

Sources

  • Cochrane Handbook for Systematic Reviews of Interventions, chapter 10, Analysing data and undertaking meta-analyses: cochrane.org (read 2026-11-12).
  • Cochrane Handbook, chapter 13, Assessing risk of bias due to missing results in a synthesis: cochrane.org (read 2026-11-12).
  • Page MJ et al. The PRISMA 2020 statement. BMJ 2021;372:n71. doi:10.1136/bmj.n71; prisma-statement.org.
  • DerSimonian R, Laird N. Meta-analysis in clinical trials. Controlled Clinical Trials 1986;7(3):177-188.

Data: Minimum number of studies Cochrane Handbook gives for common meta-analysis procedures

Study-count thresholds stated in Cochrane Handbook chapters 10 and 13 for procedures that are unreliable in small meta-analyses, compiled from the sections cited in each row.

Minimum number of studies Cochrane Handbook gives for common meta-analysis procedures
ProcedureMinimum studies (studies)Handbook section
Test for funnel plot asymmetry1013.3.4.4
Meta-regression (per characteristic modelled)1010.11.4, 10.11.5.1
Prediction interval (encouraged, with no funnel asymmetry; approximate)510.10.4.2-10.10.4.3

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about How to Perform a Meta-Analysis: Steps, Formulas and a Worked Example

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →