
Meta-analysis is a quantitative method of research synthesis that has been originally developed to evaluate results in medical research. In medicine, meta-analyses are frequently used to come to conclusions about the treatment effects of medical instances to various diseases and the strength of their side effects. The main idea behind it is that a researcher collects all relevant studies and evaluates them using a meta-analysis. The results in the individual articles can be quite different. Therefore, doing a meta-analysis is very useful to understand what the true effect is.
In 1990, meta-analysis started to spread into economics and other social sciences, where it found numerous use cases. Some examples here include evaluating the effects of natural resources on economic growth, the impact of tuition on university enrollment, effects of daylight saving on energy consumption, etc. The renaissance of meta-analysis came in the 2010s when it became the conventional approach in empirical economics.

Statistical meta-analytic methods are implemented in most standard software packages. R contains numerous libraries that provide a large variety of estimators, plots, and statistical tests. Their exhausting overview is here. Most economists use STATA, which is a de facto mainstream tool for academic economic research in meta-analysis. This page shows the possibilities that STATA provides to researchers.
As many of the data science community use Python, I will introduce three main Python libraries that are specifically designed to perform meta-analyses: PythonMeta, PyMARE, and NiMARE.
PythonMeta
PythonMeta provides basic models for effect measurement, heterogeneity tests, and plots (forest plot, funnel plot, etc.). It includes only widespread methods and lacks many more advanced features (such as multivariate meta-analysis, a new feature in STATA 17). All the elements in PythonMeta are described on the package site.
I will show the implementation of a forest plot for displaying the results from the studies in my sample and some main tests. With some changes, you can use the code on other datasets.
First, let’s import PythonMeta.
Next, this function calculates the effects of each study, weights on the overall effect, confidence intervals, total effect of all studies, and a heterogeneity test.
This function loads in-built PythonMeta classes, takes data, model, and algorithm settings from a dictionary, and plots the results and a forest plot.
This is the Python output:

Calling the main function produces this forest plot:

PyMARE
This library focuses explicitly on meta-regression. It is a technique to explore heterogeneity in the data by running regressions on a set of dummy variables that capture various characteristics of studies in the sample (year of publication, empirical method, regional focus, etc.)
I want to avoid copy and paste of the code and the documentation. Everything is nicely explained on the GitHub site, so please check it here.
NiMARE
NiMARE is the most exciting meta-analytic implementation in Python. It is an ecosystem of libraries, methods, and tools to perform meta-analyses that focus on the neuroimaging literature. To explore them, go to the main site.
It contains, for example:
- a database of over 14,000 neuroimaging papers
- a repository for coordinates and maps from neuroimaging studies
- library and coordinate database built for predictive meta-analysis
- a database of images.
A big NiMARE’s limitation is that it focuses on brain and neuroscience meta-analysis. Researchers and data scientists should be aware that its application outside this domain could cause some problems.
Conclusions
Although Python is not currently the mainstream program that one could use for all tasks in the meta-analysis, these Python packages can serve well for smaller projects and are very easy to implement. STATA or R include more developed packages, but if you know Python well, have a limited budget for STATA purchase, or R syntax seems too complicated, these three libraries are here for you.
Did you like the article? You can invite me for coffee and support my writing. You can also subscribe to my email list to get notified about my new articles. Thanks!