[R-meta] Network meta-analysis with randomized and non-randomized studies in metafor

Viechtbauer, Wolfgang (SP) wolfg@ng@viechtb@uer @ending from m@@@trichtuniver@ity@nl
Wed Dec 19 10:42:59 CET 2018

Hi Chris,

Why don't you just include a moderator that distinguishes RS from NRS? The model should already include fixed/random effects for studies and random effects for estimates, so adding a moderator is sufficient. Here is an example, using the data from help(dat.hasselblad1998):

### copy data into 'dat'
dat <- dat.hasselblad1998

### calculate log odds for each study arm
dat <- escalc(measure="PLO", xi=xi, ni=ni, add=1/2, to="all", data=dat)

### convert trt variable to factor with desired ordering of levels
dat$trt <- factor(dat$trt, levels=c("no_contact", "self_help", "ind_counseling", "grp_counseling"))

### add a space before each level (this makes the output a bit more legible)
levels(dat$trt) <- paste0(" ", levels(dat$trt))

### network meta-analysis using an arm-based model
res <- rma.mv(yi, vi, mods = ~ trt, random = ~ 1 | study/id, data=dat)

### simulate a RS/NRS moderator (type)
dat$type <- rep(sample(c("RS", "NRS"), length(unique(dat$study)), replace=TRUE), times=tapply(dat$study, dat$study, length))

### adding type (RS/NRS) to the model
res <- rma.mv(yi, vi, mods = ~ trt + type, random = ~ 1 | study/id, data=dat)

This last model assumes that the amount of heterogeneity at the study and estimate level is the same for RS and NRS. This might not be true; we may suspect that NRS are more heterogeneous. We can allow for this:

### allowing for different amounts of heterogeneity for RS vs NRS
res <- rma.mv(yi, vi, mods = ~ trt + type, random = list(~ type | study, ~ type | id), struct=c("DIAG","DIAG"), data=dat)

This is already a pretty complex model, so let's check on the identifiability of the variance components:


Looks good -- all profile plots have a clear peak (one being at 0, but that is fine).

Finally, one may not just want to distinguish between RS/NRS, but actually allow the effect of the treatment to differ depending on the type of study. Then we allow type and trt to interact:

res <- rma.mv(yi, vi, mods = ~ type * trt, random = list(~ type | study, ~ type | id), struct=c("DIAG","DIAG"), data=dat)

I hope this gives you some ideas on how to model your data.


-----Original Message-----
From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org] On Behalf Of Chris Rose
Sent: Wednesday, 21 November, 2018 10:25
To: r-sig-meta-analysis using r-project.org
Subject: [R-meta] Network meta-analysis with randomized and non-randomized studies in metafor


I'm working on a network meta-analysis (NMA) that will include randomized studies (RS) and non-randomized studies (NRS). I anticipate that the NRS may be biased, and that magnitude and direction of bias may vary unpredictably across the NRS. I am less concerned that the NRS may be overly precise (though I may be wrong!). It is also possible that I will have to include fixed effects for moderators (i.e., do a network meta-regression). I'm considering using the metafor package (see the end of this email for my reasoning).

How should I model the distinction between the RS and NRS in metafor? I’m considering using a random effect (intercept) for each NRS. I.e., each effect estimate would be supported by some mixture of direct and indirect evidence that is (hopefully) unbiased in the case of the RS, and potentially biased in the case of the NRS (with that bias explained by the random effects).

How would I specify this model in metafor? I.e., how do I specify that the random effects are conditional on a study being a NRS? Could I use a factor variable that has the same value for all the randomized studies, and distinct values for the non-randomized studies? Is there a better way to do this?

Thanks in advance,


Why metafor?

I’m aware of various NMA packages available for R, and I'm able to implement bespoke Bayesian models in JAGS and Stan. I’m considering metafor because:

1. I need to use R.
2. I have multiple outcomes to analyze and need to do various sensitivity analyses, so run-time is a consideration and MCMC is less attractive for this reason.
3. I'd prefer to use a well-tested model implementation (I'm experienced enough with JAGS and Stan to know it's possible to make programming errors).
4. I think the existing NMA-specific packages do not support modeling the distinction between RS and NRS (but I could be wrong).
5. I think the existing NMA packages either do not support regression, or only support a single covariate or continuous covariates. I think this means they do not allow me to adjust for the randomized/non-randomized designs as well as other covariates if that was necessary. Again, I could be wrong.

More information about the R-sig-meta-analysis mailing list