# Using mvmeta to perform a network meta-analysis

A few months ago, I posted these two questions about practical considerations in collecting data for a network meta-analysis and the available R packages that can analyze such data. For those unfamiliar with network meta-analysis, it is a method that compares a set of treatments against each other. Part of what's attractive about this method is that multivariate extensions of network meta-analysis can accommodate studies that compare more than two treatments against each other; traditional meta-analytic methods can only accommodate two treatments.

I am currently attempting to use the mvmeta package to conduct the meta-analysis. However, I'm a little stuck in figuring out how to implement the meta-analysis.

As I understand it, network meta-analysis can be implemented at either the arm level or the contrast level. In my own meta-analysis, however, authors rarely report the outcome at the arm level, and much of my data had to be extracted using test statistics from the comparison between arms (e.g., a t-test comparing treatment A to treatment B). Therefore, I'm using the contrast-based approach, which accommodates studies with more than three arms by modeling the different comparisons between the arms as separate outcomes. For a study with k arms, k - 1 comparisons fully represent the differences between the arms. So, one must choose a reference treatment and calculate the k - 1 comparisons to that reference treatment. For example, for a study comparing treatments A, B, and C to each other, one would calculate separate effect sizes for the AB and AC comparisons.

What I don't understand is how to extend this framework to represent studies that don't include the reference treatment. So, in the above example, I don't understand how to accommodate a study that compares treatments B and C.

One possibility is that I would simply run a new analysis with B as the reference treatment. Do any of you know if this is actually the case?

For reference, I have included some R code that I wrote that I believe performs a network meta-analysis using mvmeta below. My question, restated in the context of the sample R code, is that I don't see how to represent studies that observe BC comparisons.

library(mvmeta)

# Construct data
AB <- c(.5, .3, .2, .2, NA, NA, .1)
AC <- c(NA, .3, .4, NA, .2, .1, .5) # Where are the BC comparisons?
d <- data.frame(AB, AC)

n1 <- 50
n2 <- 50
nT <- 150 # Total N for 3-arm studies in this example

# Create list of N = 7 within-study variance-covariance matrices (S matrices).
# These are a function of the effect sizes and study Ns specified above.
S <- list(matrix(c(1/n1 + 1/n2 + .5/(2*(n1 + n2)), NA,
NA, NA), ncol = 2, nrow = 2),
matrix(c(1/n1 + 1/n2 + .3/(2*nT), 1/n1 + .3 * .3 / (2*nT),
1/n1 + .3 * .3 / (2*nT), 1/n1 + 1/n2 + .3/(2*nT)), ncol = 2, nrow = 2),
matrix(c(1/n1 + 1/n2 + .2/(2*nT), 1/n1 + .2 * .4 / (2*nT),
1/n1 + .2 * .4 / (2*nT), 1/n1 + 1/n2 + .4/(2*nT)), ncol = 2, nrow = 2),
matrix(c(1/n1 + 1/n2 + .2/(2*(n1 + n2)), NA,
NA, NA), ncol = 2, nrow = 2),
matrix(c(NA, NA,
NA, 1/n1 + 1/n2 + .2/(2*(n1 + n2))), ncol = 2, nrow = 2),
matrix(c(NA, NA,
NA, 1/n1 + 1/n2 + .1/(2*(n1 + n2))), ncol = 2, nrow = 2),
matrix(c(1/n1 + 1/n2 + .1/(2*nT), 1/n1 + .1 * .5 / (2*nT),
1/n1 + .1 * .5 / (2*nT), 1/n1 + 1/n2 + .5/(2*nT)), ncol = 2, nrow = 2))

mod <- mvmeta(cbind(AB, AC) ~ 1, S = S, data = d, method = "reml")
summary(mod)


## 4 Answers

There is a fairly new R package for conducting network meta-analysis called 'gemtc' by Gert van Valkenhoef and Joel Kuiper. It is quite user friendly and the authors are responsive to questions about their package.

The link is below:

http://cran.r-project.org/web/packages/gemtc/

• Thanks for the suggestion! I actually stumbled on the package myself a couple days ago. From my cursory investigation, it looks like the gemtc package is basically an R interface into a package that does Bayesian data analysis like rjags. Because I'm not really familiar with Bayesian methods, I've been reluctant to spend the time to figure out how to use the package. Do you know of any tutorials besides the package documentation that illustrate how to use the package? Jun 11 '13 at 4:03

I don't work with R but am starting to do network meta-analyses with WinBugs. The concept should be the same. Imagine you have trials with A, B, and C arms. The studies are as follows:

A vs. B A vs. C A vs. B vs. C B vs. C

You need to set it up so that the most common comparator is 'A' followed by the second, etc. The model should have a place for you to indicate which arm is the 'baseline' or 'comparator' arm so that it can connect the arms and form the network.

Sorry I couldn't be more specific than this, but as I said, I'm starting to learn about network meta-analyses but don't work with R.

Ahmed Abou-Setta, MD, PhD

• thanks for responding. I'm not quite sure how I would implement your suggestion because, given comparisons AB and AC, the BC comparisons are redundant information (i.e., they are completely defined by the other information in the network). So, if I were to do a (multivariate) contrast-based meta-analysis where my outcomes were the AB and AC studies, I would not be able to add another variable that represented the BC studies because the estimation procedures would crash. Unless I'm misunderstanding your suggestion, of course . . . Apr 11 '13 at 21:36

On top of mvmeta in R or Stata, and gemtc in R, you can also use netmeta in R.

For a sort of survey on which method is considered best you can look at this recent CrossValidated question: Which is the best method for network meta-analysis?

# The R package metafor can do this

Here is a link to a short tutorial on metafor. The tutorial uses 2-arm trials only, but the package can be used for network meta-analysis as well.

You could of course write your own code, but that's unnecessary.

# To answer the statistical aspect of your question:

Let's take your example: You want to compare A, B and C in a contrast-based analysis. This involves choosing an overarching reference treatment, which you've chosen to be A. This is fine if all studies contain treatment A, but how do you accommodate a study with only B and C?

I find that the easiest way to think about this is to firstly consider what the AB and AC comparisons are. What does the contrast mean in the simpler 2-arm case? You might be measuring binomial data or continuous data, but for simplicity let's assume you're using continuous data, such as "weight after 12 months". In this case, the data of each arm of each study would be a mean measurement -- perhaps 200 in arm A, 210 in arm B. The output of your study would show a contrast of 10 for the comparison AB, because the difference between treatments A and B has been estimated to be 210 - 200 = 10. The contrast is the difference between two arms. Here, treatment effect AB = B - A.

How does this extend to network meta-analysis?

Consider your meta-analysis of treatments A, B and C. You need to choose what contrasts you wish to estimate explicitly -- these contrasts are known as basic parameters. They are the contrasts through which all other contrasts can be found. It's easiest to choose your basic parameters in terms of your reference treatment A, e.g. AB, AC, AD, etc. So with k treatments in total, there will be k-1 basic parameters estimated, as you state in your question.

So then: What is the estimate of comparison BC, and how can I find it?

Well, if

AB = B - A, and

AC = C - A, then

BC = C - B,

and this contrast can be found using a combination of the basic parameters. In this case,

AC - AB = (C - A) - (B - A) = C - B = BC.

So in that particular study (BC), what is being estimated is AC - AB, which is equivalent to BC. However complicated the network, all possible contrasts can be expressed in terms of the basic parameters.

Note that this is only one model for network meta-analysis -- as you say, other models are available, e.g. arm-based analysis. However, for more detail on the model I've described, check out section 2 of Extending DerSimonian and Laird's methodology to perform network meta-analyses with random inconsistency effects.