This is the definitive guide on how to do a meta-analysis. A meta-analysis is a statistical method that combines effect sizes from multiple independent studies to produce a single pooled estimate of a treatment effect or association. It uses inverse variance weighting, assesses heterogeneity via I-squared and tau-squared, and produces forest plots to visualize results. Meta-analysis is typically conducted within a systematic review following Cochrane Handbook methodology (Higgins et al., 2023).
Whether you are pooling clinical trial results, observational cohort data, or diagnostic accuracy studies, this step-by-step meta-analysis guide for beginners walks you through every decision point with the statistical reasoning behind it. Our biostatisticians have conducted meta-analyses across clinical medicine, public health, and pharmacology, the most common error we see is ignoring prediction intervals, which describe the range of true effects you would expect in a future study conducted in a new setting. This guide covers the complete meta-analysis methodology from defining outcomes through GRADE-rated certainty of evidence, with links to free calculators and example R code at every step. For the broader evidence synthesis process, see our guide to our complete systematic review guide.
Where Meta-Analysis Sits Inside a Systematic Review
The distinction between meta-analysis and systematic review is fundamental. A systematic review is the complete methodological framework, protocol registration, database searching, screening, data extraction, and quality appraisal. A meta-analysis is the optional statistical component that sits inside a systematic review when the included studies are sufficiently homogeneous to pool quantitatively. Not every systematic review includes a meta-analysis, and not every meta-analysis is embedded in a systematic review, though best practice favors the combination. For a deeper comparison, see systematic review vs meta-analysis explained.
In formal terms, a meta-analysis is a statistical synthesis method (Borenstein et al., 2009). It is a component of a systematic review. It requires effect size calculation from each included study. And it produces a forest plot, the defining visualization of pooled results. These four relationships anchor every decision in the nine-step process below.
When Is a Meta-Analysis Appropriate?
A meta-analysis is appropriate when the included studies are sufficiently similar in population, intervention, comparator, and outcome (PICO) to justify statistical pooling. The decision to pool is clinical and methodological before it is statistical.
Three conditions must be met. First, clinical homogeneity: the studies must address the same or closely related clinical question. Pooling a drug trial in pediatric asthma with a surgical trial in adult COPD produces a number, but not a meaningful one. Second, methodological similarity: studies should share broadly comparable designs (e.g., all RCTs, or all prospective cohorts). Mixing randomized controlled trials with cross-sectional studies introduces confounding that no statistical model can resolve. Third, sufficient studies: while two studies is the technical minimum, five or more are recommended for meaningful heterogeneity assessment, and ten or more are needed for reliable publication bias detection using Egger's test (Sterne et al., 2011).
When should you not meta-analyze? When the included studies differ so profoundly in design, population, or intervention that pooling them would obscure rather than clarify. In these cases, narrative synthesis, a structured qualitative summary, is more appropriate. The Cochrane Handbook explicitly warns against meta-analysis when "there is considerable variation in the results and the variation is not explained by study characteristics" (Higgins et al., 2023). If you determine that pooling is unjustified after examining your data, present the results in a structured table with individual study effect sizes rather than forcing a misleading pooled estimate.
Step 1, Define Your Outcomes and Effect Measures
The first step is selecting the outcomes to analyze and the effect measure to express each one. This decision shapes every downstream calculation.
Continuous Outcomes
For continuous outcomes (blood pressure reduction, pain scores, cognitive test performance), the primary options are the standardized mean difference and the weighted mean difference. The standardized mean difference is used when studies measure the same construct on different scales, for example, depression measured by both the PHQ-9 and the HAM-D. The two most common standardized mean difference variants are Cohen's d and Hedges' g. Hedges' g corrects Cohen's d for small samples by applying a correction factor that removes upward bias in studies with fewer than 20 participants per arm (Borenstein et al., 2009). For most meta-analyses, Hedges' g is preferred. When all studies use the same measurement scale, the weighted mean difference (WMD) preserves the original units and is easier to interpret clinically.
Binary Outcomes
For binary outcomes (mortality, treatment response, adverse events), the standard measures are the odds ratio (OR), risk ratio (RR), and risk difference (RD). Odds ratio calculation is the most common in meta-analysis because the OR has favorable mathematical properties, it is symmetric and unbounded, and can be computed from case-control studies where RR cannot. Risk ratio estimation is more intuitive clinically ("patients are 1.5 times more likely to respond") and is preferred for prospective studies. Risk difference expresses the absolute difference in event rates and is needed to calculate the number needed to treat.
| Outcome Type | Effect Measure | When to Use | Key Property |
|---|---|---|---|
| Continuous, same scale | Weighted Mean Difference | All studies use identical measurement tool | Preserves original units |
| Continuous, different scales | Hedges' g (standardized mean difference) | Studies measure same construct on different scales | Unitless, corrected for small samples |
| Binary | Odds Ratio | Case-control studies or when RR is inappropriate | Symmetric, can be computed from any 2x2 table |
| Binary | Risk Ratio | Prospective studies, clinical interpretability | Directly interpretable as relative risk |
| Binary | Risk Difference | Absolute effect needed (NNT calculation) | Scale-dependent, affected by baseline risk |
Choose your effect measure before extracting data, and register this choice in your protocol. Changing the effect measure after seeing results introduces selective reporting bias.
Step 2, Extract or Calculate Effect Sizes
With your effect measure defined, the next task is extracting or computing individual study effect sizes and their variances. Every meta-analysis requires effect size calculation from each included study before pooling can occur.
What Data to Extract
For continuous outcomes, extract sample sizes, means, and standard deviations for each group. For binary outcomes, extract the 2x2 table (events and non-events in intervention and control groups). When studies report only summary statistics, p-values, confidence intervals, or t-statistics, you can back-calculate effect sizes using established formulas. The Cochrane Handbook Chapter 6 provides the standard conversion equations (Higgins et al., 2023).
Handling Missing or Incomplete Data
Studies frequently omit the data you need. Some report medians and interquartile ranges instead of means and standard deviations. Others report only "p < 0.05" without a specific value. For median-to-mean conversion, methods by Wan et al. (2014) and Luo et al. (2018) provide validated approximations. For studies reporting only a p-value and sample size, you can convert the p-value to a t-statistic and then to a standardized mean difference, our convert p-value to confidence interval tool demonstrates this logic. When data cannot be extracted or estimated reliably, document the study as "included but not pooled" and explain why in your results section.
Converting Between Effect Measures
Sometimes individual studies report results in different formats. One randomized controlled trial reports means and SDs, another reports a t-test result, and a third reports only a p-value and direction of effect. You need to convert all of these into a common metric. Use our comprehensive effect size calculator to calculate Cohen's d and Hedges' g from means, t-statistics, F-statistics, or correlation coefficients. For binary outcomes, you can convert between OR, RR, and RD when you know the baseline event rate. Always report your conversion method in the statistical methods section.
Creating Your Data File
Organize extracted data in a structured spreadsheet with one row per study and columns for: study ID, year, sample sizes (intervention and control), effect size, standard error or variance, and any subgroup variables. This file becomes the direct input for your R or Stata analysis script.
Step 3, Choose Your Statistical Model
The choice between a fixed-effect model and a random-effects model is the most consequential statistical decision in your meta-analysis. This choice determines how study weights are calculated and what your pooled estimate actually means.
Fixed-Effect Model
The fixed effect model assumes that all included studies estimate the same true underlying effect. Variation across studies is attributed entirely to sampling error, the studies are conceptually identical replications. Under this assumption, larger studies receive proportionally more weight because they estimate the common effect with greater precision. The fixed-effect model uses inverse-variance weighting where each study's weight is the reciprocal of its within-study variance.
The fixed-effect model is appropriate when studies are functionally identical in population, intervention, and setting. In practice, this is rare. Multi-center pharmaceutical trials using the same protocol and the same drug dose in the same patient population come closest. For most clinical research questions, the fixed-effect assumption is implausible.
Random-Effects Model
The random-effects model assumes that the true effect varies across studies, each study estimates its own true effect, and these true effects are drawn from a distribution. A random effects meta-analysis accounts for both within-study sampling error and between-study variance (tau-squared). This model assigns more similar weights across studies because even small studies contribute information about the distribution of true effects.
The random-effects model accounts for between-study heterogeneity, making it the default recommendation for most meta-analyses in clinical and social science research (Borenstein et al., 2009). When tau-squared is zero (no between-study variance), the random-effects model collapses to the fixed-effect model, so it is never wrong to start with random-effects.
DerSimonian-Laird vs REML
The two most widely used estimators for tau-squared in random-effects models are the DerSimonian-Laird method (DerSimonian & Laird, 1986) and REML estimation (restricted maximum likelihood). DerSimonian-Laird is the historical default, computationally simple and implemented in most software. However, it underestimates tau-squared when the number of studies is small, producing confidence intervals that are too narrow. REML provides less biased variance estimates, especially with fewer than 20 studies, and is the default in the metafor package in R. For new meta-analyses, REML is the recommended estimator.
| Feature | Fixed-Effect | Random-Effects (DL) | Random-Effects (REML) |
|---|---|---|---|
| Assumption | One true effect | Distribution of true effects | Distribution of true effects |
| Weights | Inverse within-study variance only | Inverse within-study + between-study variance | Inverse within-study + between-study variance |
| Tau-squared estimation | Not applicable | Moment-based (simple, may underestimate) | Likelihood-based (less biased) |
| Best for | Identical protocols, same population | General use, adequate with many studies | General use, especially few studies |
For a detailed comparison with worked examples, read choosing your meta-analysis model.
Step 4, Run the Pooled Analysis and Generate Forest Plots
With effect sizes extracted and your model selected, you now run the pooled analysis. The core computation is inverse variance weighting, each study's effect size is multiplied by its weight (the inverse of its variance), summed across all studies, and divided by the total weight to produce the pooled effect estimate.
In a fixed-effect model, the weight for study i is:
w_i = 1 / v_i
where v_i is the within-study variance. In a random-effects model, the weight becomes:
w_i = 1 / (v_i + tau-squared)
where tau-squared is the estimated between-study variance. This addition of tau-squared to the denominator is what makes random-effects weights more uniform across studies, large and small studies contribute more similarly because tau-squared is constant.
The Forest Plot
A meta-analysis produces a forest plot, the signature output that displays individual study results and the pooled estimate on a single axis. Each study appears as a square (sized proportional to its weight) centered on its effect estimate, with a horizontal line representing the 95% confidence interval. The pooled estimate appears as a diamond at the bottom, with the diamond's width representing its confidence interval. A forest plot visualizes the pooled effect size, individual study contributions, and the degree of consistency across studies at a single glance.
For a thorough walkthrough of reading forest plots, see how to read a forest plot. To generate your own, use our free forest plot tool.
Prediction Intervals
Beyond the confidence interval for the pooled effect, every random-effects meta-analysis should report a prediction interval. The confidence interval describes the uncertainty around the average true effect. The prediction interval describes the range within which the true effect of a future study is expected to fall. A meta-analysis might show a statistically significant pooled OR of 0.65 (95% CI: 0.50-0.85), but the prediction interval might be 0.30-1.40, indicating that in some future settings, the intervention could actually be harmful. Prediction intervals are computed from tau-squared and provide far more clinically relevant information than confidence intervals alone. The metafor package in R reports them by default with the predict() function.
Example R Code
Below is a minimal R script for running a random-effects meta-analysis and generating a forest plot using the metafor package:
library(metafor)
# Data: yi = effect sizes, vi = variances
dat <- escalc(measure = "SMD", m1i = m1, sd1i = sd1, n1i = n1,
m2i = m2, sd2i = sd2, n2i = n2, data = mydata)
# Fit random-effects model (REML is default)
res <- rma(yi, vi, data = dat)
# Forest plot
forest(res, slab = dat$study, header = TRUE,
xlab = "Standardized Mean Difference")
# Prediction interval
predict(res)
This code computes Hedges' g (the default for measure = "SMD" in metafor), fits a REML random-effects model, and generates a publication-ready forest plot. Include scripts like this as supplementary material with your manuscript.
Step 5, Assess Heterogeneity
Heterogeneity is the degree to which the true effects vary across studies. Assessing statistical heterogeneity is mandatory, it determines whether your pooled estimate should be interpreted as a single value or as an average across a distribution of different effects.
I-Squared
The I-squared statistic quantifies the percentage of total variability across studies that is due to true heterogeneity rather than sampling error. I-squared measures statistical heterogeneity on a 0-100% scale. Cochrane classifies I-squared heterogeneity as low (0-40%), moderate (30-60%), substantial (50-90%), and considerable (75-100%) (Higgins et al., 2023). Note the overlapping ranges, interpretation depends on context, not rigid cutoffs. An I-squared of 60% in a pharmacological meta-analysis of identical drug doses may be concerning, while 60% in a behavioral intervention meta-analysis may be expected and acceptable.
Use our I-squared and tau-squared calculator to compute heterogeneity statistics from your data. For a detailed interpretation guide, see I-squared interpretation guide.
Tau-Squared
While I-squared tells you the proportion of variability due to heterogeneity, tau-squared estimates between-study variance in absolute terms. A tau-squared of 0.10 for a standardized mean difference meta-analysis means the standard deviation of true effects across studies is approximately 0.32 (the square root of tau-squared). This absolute value is essential for computing prediction intervals and for determining whether heterogeneity is clinically meaningful, not just statistically detectable.
Cochran's Q Test
Cochran's Q is a chi-squared test of the null hypothesis that all studies share the same true effect. A significant Q (p < 0.10 is the conventional threshold, not p < 0.05) indicates heterogeneity. However, Q has low power with few studies and excessive power with many studies, so it should be interpreted alongside I-squared and tau-squared, never in isolation.
Prediction Intervals Revisited
The prediction interval deserves emphasis here because it is the most underreported heterogeneity metric. A meta-analysis with I-squared = 80% tells you that most variability is not due to chance. But the prediction interval tells you the actual range of effects you would expect to see in a new study, which is what clinicians and policymakers actually need to know. Always report prediction intervals alongside I-squared and tau-squared.
Want your entire meta-analysis handled by experienced biostatisticians? Our team manages every step, from effect size extraction and model selection to forest plots and publication bias assessment. access professional research support now, or learn more about our meta-analysis services for researchers.
Step 6, Conduct Sensitivity and Subgroup Analyses
Sensitivity analysis and subgroup analysis explore the robustness of your pooled estimate and investigate potential sources of heterogeneity. These analyses separate a rigorous meta-analysis from a superficial one.
Leave-One-Out Analysis
Leave-one-out analysis systematically removes one study at a time and recalculates the pooled effect. If the pooled estimate changes substantially when a single study is removed, that study is highly influential and warrants scrutiny. Was it an outlier? Did it have a different population, different dose, or a high risk of bias? Use our leave-one-out analysis tool to run this analysis on your data. In R, the leave1out() function in metafor automates this:
leave1out(res)
Subgroup Analysis
Subgroup analysis stratifies studies by a categorical moderator (study design, geographic region, intervention dose, risk of bias) and computes separate pooled estimates for each subgroup. The test for subgroup differences examines whether the pooled effects differ significantly across categories.
Critical rule: pre-specify your subgroup analyses in your protocol before analyzing data. Post-hoc subgroups, invented after seeing the results, are hypothesis-generating only. Reviewers and editors will scrutinize unplanned subgroup analyses as potential data dredging. Limit yourself to 3-5 subgroups with a clinical or methodological rationale.
Meta-Regression
For continuous moderators (publication year, mean participant age, intervention duration), meta-regression analysis extends subgroup analysis by fitting the moderator as a continuous predictor. Meta-regression requires at least 10 studies to have adequate power, and results should be interpreted cautiously because it is an observational association across studies, not a within-study causal estimate. Use our meta-regression input tool to format your data for meta-regression in R.
In metafor, meta-regression is straightforward:
res_reg <- rma(yi, vi, mods = ~ year + dose, data = dat)
summary(res_reg)
Report the regression coefficient, its confidence interval, the residual I-squared (heterogeneity remaining after accounting for the moderator), and the R-squared analog (proportion of between-study variance explained).