How to do a meta-analysis in Excel
A meta-analysis combines the results of several studies into one estimate, and shows how much the studies agree. This guide walks through every step on a classic example, 13 trials of the BCG vaccine against tuberculosis, first by formula and then with MIX, a free add-in that does it from Excel's ribbon.
1. Collect the data
A meta-analysis starts from a clear question and a systematic search for every study that answers it. That part happens before Excel. What reaches the spreadsheet is one row per study with the numbers you need to compute its effect.
Our example is the set of BCG vaccine trials summarized by Colditz and colleagues (JAMA 1994) and used as a worked example by Egger, Davey Smith and Altman in Systematic Reviews in Health Care. Each trial compared vaccinated and unvaccinated groups, and counted who developed tuberculosis. So each row holds four numbers: cases and group size in the vaccinated group, and the same in the control group.
| Trial | Vaccinated: TB / total | Control: TB / total |
|---|---|---|
| Canada 1933 | 6 / 306 | 29 / 303 |
| Northern USA 1935 (a) | 4 / 123 | 11 / 139 |
| … | … | … |
| Madras 1968 | 505 / 88,391 | 499 / 88,391 |
All 13 trials are built into MIX as the dataset "Colditz", so you can follow along without typing anything.
2. Choose the effect measure
Each study's result has to be expressed on the same scale before it can be combined. For yes-or-no outcomes like "developed tuberculosis", the usual choices are:
- Risk ratio (RR): the risk in the vaccinated group divided by the risk in the control group. An RR of 0.5 means half the risk.
- Odds ratio (OR): the same idea with odds instead of risks. Close to the RR when the outcome is rare.
- Risk difference (RD): the risk in one group minus the risk in the other, in absolute terms.
For continuous outcomes, such as blood pressure, you'd use the mean difference, or the standardized mean difference when studies measured the outcome on different scales. Here we use the risk ratio. Ratios are combined on the log scale, where they are roughly normal, and turned back into ratios at the end.
3. Fixed or random effects
Combining means taking a weighted average, where more precise studies get more weight. The two standard models differ in what they assume:
- Fixed effect: every study estimates one and the same true effect, and differences between them are chance. Weights are the inverse of each study's variance.
- Random effects: the true effect varies from study to study, for example with the population or setting, and the analysis estimates the average of those effects. The between-study variance, τ² (tau squared), is added to each study's variance before weighting, so small studies count relatively more and the confidence interval is wider.
When studies differ in who, where and how, random effects is usually the honest choice. You'll see below that the BCG trials differ a lot.
4. The calculation in plain Excel
You can do a basic meta-analysis with ordinary formulas. With the vaccinated cases and total in columns B and C, and the control cases and total in D and E, add these columns for each study (row 2 shown):
| Column | What | Formula |
|---|---|---|
| F | log risk ratio | =LN((B2/C2)/(D2/E2)) |
| G | its variance | =1/B2-1/C2+1/D2-1/E2 |
| H | fixed-effect weight | =1/G2 |
The fixed-effect pooled log risk ratio is =SUMPRODUCT(H2:H14,F2:F14)/SUM(H2:H14),
with standard error =1/SQRT(SUM(H2:H14)). Take EXP() of the estimate
and of the estimate ± 1.96 standard errors to get the risk ratio and its 95% confidence
interval. Random effects needs a few more steps: Cochran's Q, then τ² by the
DerSimonian–Laird formula, then new weights 1/(variance + τ²).
It works, but it is easy to get a range or a sign wrong, and a forest plot built from Excel's chart tools takes a long time. That's the part MIX automates. (If you want to build the chart yourself, How to make a forest plot in Excel shows how.)
The same analysis in MIX
MIX is an add-in that adds a MIX tab to Excel's ribbon. MIX Lite is free and includes the BCG dataset. It runs on Windows with Excel 2007 or later.
- Download MIX Lite, run the setup, and open Excel.
- On the MIX tab, click MIX → Start MIX, then Data wizard.
- Choose the built-in dataset Colditz (reference: Egger et al., binary data, 13 studies) and load it.
- Under Exploration, open Data set to see the 13 trials as a normal Excel sheet.
- Open Settings and set the effect measure to the risk ratio and the model to random effects.
- Under Synthesis, open Synthesis for the pooled result and heterogeneity statistics, and Synthesis forest plot for the plot.
You can change the settings at any time, and MIX recalculates. Every table and plot is a regular Excel sheet or chart, so you can copy it into a report or restyle it.
Read the result
The pooled risk ratio is 0.49, with a 95% confidence interval from 0.34 to 0.70. On average, vaccinated people had about half the risk of tuberculosis: a reduction of roughly 51%, and at least 30% at the edge of the interval.
Look at the heterogeneity statistics next. They answer "do the trials agree?":
- Cochran's Q = 152.2 on 12 degrees of freedom. If the trials all estimated the same effect, Q would be close to 12. It's far larger, so the differences are not chance.
- I² = 92%: the share of the variation between trials that reflects real differences rather than chance. Above 75% is usually called considerable.
- τ² = 0.31: the variance of the true log risk ratios between trials.
The forest plot shows it at a glance. Some trials found risk ratios near 0.2, while the largest one, in Madras, found no effect at all (1.01). With a fixed-effect model the pooled risk ratio would be 0.65 (0.60 to 0.70), with an interval that's too narrow for trials this different. The random-effects result is the one to report here. Heterogeneity and I², explained goes deeper into these numbers, the prediction interval, and how to find out why the trials differ.
5. Report it
A good report states the question and search, the effect measure and model, the pooled estimate with its confidence interval, the heterogeneity statistics and a forest plot, and follows the PRISMA reporting guideline. For the analysis software, cite MIX:
Bax L, Yu LM, Ikeda N, Tsuruta H, Moons KGM. Development and validation of MIX: comprehensive free software for meta-analysis of causal research data. BMC Medical Research Methodology 2006;6:50.
Try it on your own computer
MIX Lite is free for any use, with no account or license key, and includes the BCG dataset and many other textbook examples. MIX Pro adds your own datasets.
Windows · Excel 2007 or later, 32- and 64-bit
Data: Colditz GA et al. Efficacy of BCG vaccine in the prevention of tuberculosis. JAMA 1994;271(9):698–702, as tabulated in Egger M, Davey Smith G, Altman DG (eds). Systematic Reviews in Health Care: Meta-analysis in Context. BMJ Books, 2001. Results computed with the DerSimonian–Laird random-effects model and checked against R's metafor package.