LabCanvas
Free account · save your work, full figure editorSign up free

Meta-analysis forest plot maker

Paste one row per study (events and totals in each group, means, SDs and Ns, or an effect with its 95% confidence interval or standard error) and the tool pools them by inverse-variance meta-analysis: the random-effects estimate (REML, DerSimonian–Laird or Paule–Mandel τ²) and the fixed-effect one (Mantel–Haenszel for counts), with heterogeneity (I², τ², Cochran’s Q), the 95% prediction interval and Egger’s test, drawn as a forest plot and a funnel plot. Ratios (risk ratios, odds ratios, hazard ratios) are pooled on the log scale.

What it does
Pools study effects by fixed- and random-effects meta-analysis and draws the forest plot (each study’s effect and 95% CI, squares sized by weight, the pooled diamond) and the funnel plot.
Formula
θ^=∑wiyi∑wi,wi=1vi+τ2SE(θ^)=1/∑wiI2=Q−(k−1)Q
Example
13 BCG vaccine trials (Colditz et al. 1994): random-effects (REML) risk ratio 0.489 (95% CI 0.344 to 0.696), τ² = 0.313, I² = 92.2%, Q(12) = 152.2; 95% prediction interval 0.134 to 1.79.

Last updated

FreeNo sign-upRuns in your browserData analysis

Loading Meta-analysis forest plot maker…

At a glance

Meta-analysis forest plot maker at a glance
InputOne row per study: events and totals, means/SDs/Ns, effect with 95% CI, or effect with SE
MeasuresRisk ratio, odds ratio, risk difference, Hedges’ g, mean difference, any ratio or difference
ModelsRandom effects (REML, DerSimonian–Laird, Paule–Mandel; Hartung–Knapp option), fixed effect (inverse variance, Mantel–Haenszel)
OutputPooled effect with 95% CI and P, I², τ², Q, prediction interval, Egger’s test, forest and funnel plots
AccuracyReproduces metafor’s published BCG results; matches statsmodels to 10⁻⁹
Runs inYour web browser; nothing is uploaded
PriceFree, no account needed

What it does

How to use the meta-analysis forest plot maker

  1. Choose what your studies reportEvents and totals, means/SDs/Ns, an effect with its 95% CI, or an effect with its SE, and the effect measure.
  2. Paste one row per studyStudy name first, then the numbers in the order of the columns. Paste straight from Excel; rows with a missing value are left out and listed.
  3. Read the pooled effectThe headline is the pooled effect with its 95% CI; check I² and the prediction interval for how much the studies disagree, then copy the table, the methods sentence or the plots.

How it works

Effect sizes. Each study gives an effect yi and its variance vi. Counts give the log risk ratio ln⁡[(a/n1)/(c/n2)] with v=1/a−1/n1+1/c−1/n2, the log odds ratio with v=1/a+1/b+1/c+1/d, or the risk difference; ½ is added to every cell of a study with a zero cell, and studies with no events in either group are left out of ratio measures. Means give Hedges’ g, the standardised mean difference with the small-sample correction J (as metafor’s escalc("SMD")), with v=1/n1+1/n2+g2/(2(n1+n2)), or the raw mean difference. An effect with a 95% CI gives v=((upper−lower)/(2×1.96))2, on the log scale for ratios.

Pooling. The fixed-effect estimate weights each study by 1/vi (for counts, the Mantel–Haenszel estimate is shown). The random-effects model adds the between-study variance τ2:

θ^=∑wiyi∑wi,wi=1vi+τ^2,SE(θ^)=1∑wi

τ2 is estimated by restricted maximum likelihood (REML, the default in metafor), by DerSimonian and Laird’s method of moments (1986) or by Paule–Mandel. The Hartung–Knapp option replaces the normal CI by a t interval with k−1 degrees of freedom, which keeps its coverage with few studies (IntHout et al. 2014).

Heterogeneity. Cochran’s Q=∑(yi−θ^FE)2/vi is tested against χk−12; I2=(Q−(k−1))/Q (floored at 0) is the share of the variation in effects due to real differences between studies rather than chance (Higgins et al. 2003). The 95% prediction interval, θ^±tk−2τ^2+SE2, is where the true effect of a new study would be expected (Riley et al. 2011).

Small-study effects. Egger’s test regresses yi/SEi on 1/SEi; an intercept far from 0 means an asymmetric funnel plot (Egger et al. 1997). It has little power with fewer than 10 studies.

Accuracy. The analysis and the plots are the LabCanvas Graph app’s own meta-analysis, run in your browser. On the BCG trials it reproduces metafor’s published REML results (log risk ratio −0.7145, SE 0.1798, τ² 0.3132, I² 92.22%, Q 152.23) and its DerSimonian–Laird ones, and on a meta-analysis of means it matches statsmodels’ combine_effects to 10⁻⁹ (scripts/forest-plot-maker-check.ts).

Sources: DerSimonian R, Laird N. Meta-analysis in clinical trials. Control Clin Trials 1986;7:177–188, doi:10.1016/0197-2456(86)90046-2. Higgins JPT, Thompson SG, Deeks JJ, Altman DG. Measuring inconsistency in meta-analyses. BMJ 2003;327:557–560, doi:10.1136/bmj.327.7414.557. Riley RD, Higgins JPT, Deeks JJ. Interpretation of random effects meta-analyses. BMJ 2011;342:d549, doi:10.1136/bmj.d549. Egger M, Davey Smith G, Schneider M, Minder C. Bias in meta-analysis detected by a simple, graphical test. BMJ 1997;315:629–634, doi:10.1136/bmj.315.7109.629. IntHout J, Ioannidis JPA, Borm GF. The Hartung-Knapp-Sidik-Jonkman method for random effects meta-analysis is straightforward and considerably outperforms the standard DerSimonian-Laird method. BMC Med Res Methodol 2014;14:25, doi:10.1186/1471-2288-14-25. Colditz GA, Brewer TF, Berkey CS, et al. Efficacy of BCG vaccine in the prevention of tuberculosis: meta-analysis of the published literature. JAMA 1994;271:698–702, doi:10.1001/jama.1994.03510330076038. Viechtbauer W. Conducting meta-analyses in R with the metafor package. J Stat Softw 2010;36(3):1–48, doi:10.18637/jss.v036.i03.

Worked example: does the BCG vaccine prevent tuberculosis?

The built-in data are the 13 BCG vaccine trials of Colditz et al. (1994), the standard example of meta-analysis software (metafor’s dat.bcg): tuberculosis cases and participants in the vaccinated and the control group of each trial.

One study by hand. Aronson 1948: 4 of 123 vaccinated and 11 of 139 controls developed tuberculosis. The risk ratio is (4/123)/(11/139)=0.411; its log is −0.889 with variance 1/4−1/123+1/11−1/139=0.326, SE 0.571, so the 95% CI is e−0.889±1.96×0.571 = 0.134 to 1.26.

Result of the tool (risk ratio, random effects, REML)
QuantityValue
Pooled risk ratio (95% CI)0.4894 (0.3441 to 0.6962), z = −3.97, P < 0.0001
Fixed effect, Mantel–Haenszel0.6353 (0.5881 to 0.6862)
τ² (between-study variance)0.3132
I²92.2% (95% CI 81.9% to 97.7%)
Cochran’s Q152.2 with 12 df, P < 0.0001
95% prediction interval0.134 to 1.79
Egger’s testintercept −2.11, P = 0.19

How to read it. On average the vaccine roughly halves the risk of tuberculosis (a 51% reduction). But the trials disagree far more than chance allows (I² = 92%), and the prediction interval runs from a strong benefit (0.13) to none (1.79): the effect depends on the setting. Colditz et al. traced much of it to latitude, which is why a single pooled number should not be read alone. Egger’s test does not show funnel asymmetry.

Which layout and measure to use
Your studies reportLayoutMeasure
Number of events and participants per groupEvents and totalsRisk ratio (or odds ratio, risk difference)
Mean, SD and N per group, same scaleMeans, SDs, NsMean difference
Means on different scalesMeans, SDs, NsHedges’ g
Odds, risk or hazard ratio with 95% CIEffect and 95% CIRatios (pooled on the log scale)
A coefficient or log ratio with its SEEffect and SEDifferences

Frequently asked questions

How do I make a forest plot for a meta-analysis?

Choose what your studies report, paste one row per study (name first), and pick the measure. The tool pools the studies and draws the forest plot with each study’s effect and 95% CI, squares sized by weight and the pooled diamond. Download it as a 300 or 600 dpi PNG or open it in the LabCanvas Graph app to style it.

Fixed effect or random effects?

Random effects is the usual choice: it assumes the true effect varies between studies and gives a wider, more honest CI when it does. Fixed effect assumes one true effect shared by all studies, which suits near-identical studies. With I² well above 0, random effects is the safer default.

What does I² mean?

The share of the variation in study effects that reflects real differences rather than chance. Roughly, 25% is low, 50% moderate and 75% high heterogeneity (Higgins et al. 2003). It does not say how large the differences are: τ² and the prediction interval do.

How do I pool odds ratios or hazard ratios from papers?

Use the effect and 95% CI layout with “Ratios”. The tool takes logs, gets each SE from the CI width (upper − lower on the log scale divided by 3.92), pools on the log scale and shows the result back as a ratio.

Why is the prediction interval wider than the confidence interval?

The confidence interval is about the average effect; the prediction interval is about the effect in a new study, so it adds the between-study variance τ². With high heterogeneity it can include no effect even when the average effect is clear.

How many studies do I need?

Two is the minimum to pool, but τ² is poorly estimated with fewer than about five studies (use the Hartung–Knapp option) and Egger’s test needs about ten.

Finish the meta-analysis figure

The LabCanvas Graph app runs the same meta-analysis with forest and funnel plots styled for journals, next to your PRISMA diagram and other figures. Your studies from this page open in it.

Open the Graph app