1 Background

This is going to be an ultra-quick down and dirty guide to carrying out the statistical analysis part of a meta-analysis. I am not going to focus on the first steps of searching the literature and finding the sources for the meta analysis. This is purely about the statistical analysis at the end.

I am going to use an example dataset from a final year project that looked at the relationship between volume of the hippocampus volume and PTSD. The treatment is either the participant was diagnosed with PTSD or they were not and the measured outcome variable was the hippocampal volume.

2 Alternative Programs Exist

The point of this tutorial is to be very down and dirty. This was written in response to the question that I am often asked of how do I make a Forest Plot. Usually I am asked this towards the end of a student project when there is little time left and after the student has collected all the papers that they are going to use.

If they had asked for advice at the start the project I might say something different. There are multiple programs that you could use as an alternative to R and these often support the collection, filtering and quality control stages of the papers that go into the review. But these processes take time and if you just want to go from a summary table to a Forest Plot then R will do that. But here is a summary of the alternatives.

2.1 RevMan

This program was created by the Cochrane Collaboration who are responsible for the majority of clinical meta-analysis. They no longer support the download version which is fixed at version 5 but there is also the web version which is updated and which contains the Cochrane Handbook for meta analysis. This is the tool you would use for a Cochrane Review and that is why you would sign up and register for this service. Registration is free and the download is free.

The tool is PRISMA compliant and it allows you to specify the protocol for data collection including the inclusion and exclusion criteria. It also allows you to evaluate the included papers in terms of bias and quality control.

The reason that I did not use this for the guide is that this is best used from the start so that you include your literature in the database and extract the data properly. If you just come to me with a table of data then using RevMan to make Forest and Funnel plots is using a sledgehammer to crack a nut.

2.2 Covidence

This is commercially available software for the systematic review part of the process. It allows you to coordinate the literature searches and evaluations across a team so that there is rigourous evaluation. It connects seamlessly to the literature databases and makes the initial steps very simple. Why didn’t I use it for this guide is that IT DOES NOT DO THE META ANALYSIS. It doesn’t have the statistical functions.

2.3 OpenMeta

This is an academic add-on to R. This conceals that you are using R and provides a graphic user interface where you can input the data for the summary table that will then be used to run R and produce the Forest and Funnel plots. I really suggest this as a solution if after reading this guide you decide that R is too hard for you. The only issues I have are that there are limitations on the formating of the output. Using R itself allows you to customise the plots as you want them.

OpenMeta is available from http://www.cebm.brown.edu/openmeta/

3 The Data

I am going to use a simple dataset which has a continuous outcome variable - hippocampus volume for two different groups, the experimental group and the control group. The general format for the data that you are going to use needs the following columns.

  1. Author/Study
  2. Date
  3. Mean of the Experimental Group (ME)
  4. Standard Deviation of the Experimental Group (SE)
  5. Number in the Experimental Group (NE)
  6. Mean of the Control Group (MC)
  7. Standard Deviation of the Control Group (SC)
  8. Number in the Control Group (NC)

The data for this example are available in the file Total_Hippocampus.csv

4 Setting up the Analysis

The first step with the R code is to clean up the environment and install the libraries that are used in meta analysis and loading the data.

The data is available from my Google Drive.

Total_Hippocampus.csv

rm(list=ls())

#Loading the Libraries
library("grid")
library("RColorBrewer")
library("colorBlindness")
library(knitr)
library(meta)
## Loading 'meta' package (version 5.0-1).
## Type 'help(meta)' for a brief overview.
## Readers of 'Meta-Analysis with R (Use R!)' should install
## older version of 'meta' package: https://tinyurl.com/dt4y5drs
library(here)
## here() starts at D:/Dropbox/R notebooks/Meta Analysis
#Reading the Data
data <- read.csv("Total_Hippocampus.csv")

I want to show you what the data looks like and so I am going to put the data into a table. It is always useful to look at your data but you will already have done this when you prepared the comma separated variable file but it is important to do this if you are using someone elese’s data.

knitr::kable (data)
Study Year Me Se Ne Mc Sc Nc
Levy-Gigi 2013 9330.8 481.80 39 9727.60 476.20 31
Villarreal 2002 5960.0 660.00 12 6730.00 680.00 12
Rubin 2015 8197.7 792.90 23 8315.20 758.30 36
Bonne 2001 7860.0 840.00 10 7640.00 850.00 27
Levy-Gigi 2014 9230.7 479.97 26 9625.91 458.59 26
Bonne 2008 3300.0 460.00 22 3640.00 410.00 22
Emdad 2006 5930.0 790.00 23 6530.00 100.00 17
Fennema-Notestine 2002 2929.0 310.00 11 2954.00 301.00 17
Hedges 2003 2920.0 435.60 4 4242.50 347.70 4
Jatzko 2006 7300.0 900.00 15 7100.00 700.00 15
Pavic 2007 8326.0 173.00 15 9110.00 1085.00 15
Pederson 2004 5946.0 637.00 17 6093.00 616.00 17
Vythilingam 2005 2832.0 311.00 14 3230.00 407.00 29
Wignall 2004 3041.0 589.00 15 3539.00 646.00 11
Winter 2004 7150.0 120.00 15 7900.00 800.00 15
Chalavi 2014 4231.0 409.00 33 4577.00 434.00 28

5 Carrying out the Meta Analysis and Generating the Plots

The reason that I like R so much for meta analysis is that the actual analysis itself is a single line of script.

hippo <- metacont(Ne, Me, Se, Nc, Mc, Sc, studlab=paste(Study, Year), data=data)

This has created an object in R called hippo that contains all of the output from the meta analysis.

5.1 The Forest Plot

I can now create the Forest plot using whatever format I want from the “hippo” object.

This is the simplest possible Forest Plot command

png(filename="forest1.png", height= 720, width=1280, pointsize=24 )
forest(hippo)
dev.off()
## png 
##   2
The Default Forest Plot

The Default Forest Plot

This gives the summary statistics for the data on the left with the calculated effect sizes on the right and the plot itself in the middle. It is a bit confusing especially if you have already tabulated the data as then the columns on the left are redundant. You can customise the plot in many different ways and that is the main advantage of using R over OpenMeta. You will need to look at the manual for meta to see all of the psosible options but there are some built in layouts.

If you wanted to create a Forest Plot in the format used in the Journal of the American Medical Association then you would use the following code.

png(filename="forest2.png", height= 720, width=1280, pointsize=24 )
forest(hippo, layout = "JAMA", xlab="Maximum Difference in Volume", hetstat=FALSE, prediction=TRUE,
       text.predict = "95% PI",
       col.predict = "black",
       colgap.forest.left = unit(15,"mm"))
dev.off()
## png 
##   2
The JAMA formatted Forest Plot

The JAMA formatted Forest Plot

5.2 The Funnel Plot

It is just as easy to create the Funnel Plot from the “hippo” object.

png(filename="funnel1.png", height= 720, width=1280, pointsize=24 )
funnel(hippo)
dev.off()
## png 
##   2
The Default Funnel Plot

The Default Funnel Plot

Alternatively you can use colour and also include the contours for the null hypothesis on the plot.

png(filename="funnel2.png", height= 720, width=1280, pointsize=24 )
funnel(hippo, comb.random = FALSE, pch=16, 
       contour=c(0.9, 0.95, 0.99),
       col.contour=brewer.pal(3, "Blues"))
legend(-80, 0, c("0.1 > p > 0.05", "0.05 > p > 0.01", "< 0.01"), fill=brewer.pal(3, "Blues"))
dev.off()
## png 
##   2
The Contoured Funnel Plot

The Contoured Funnel Plot