[R-meta] Forest plot
Viechtbauer, Wolfgang (SP)
wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Thu Feb 14 23:51:09 CET 2019
Hi Martin,
You could synthesize the effects within studies and then create a forest plot using those aggregates. For example, using the dataset from Konstantopoulos (2011) (where 'district' takes the role of 'study' here):
dat <- dat.konstantopoulos2011
res <- rma.mv(yi, vi, random = ~ 1 | district/school, data=dat)
res
forest(res)
sav <- lapply(split(dat, dat$district), function(x) {
res <- rma(yi, vi, data=x)
return(c(coef(res), vcov(res)))
})
sav <- data.frame(do.call(rbind, sav))
names(sav) <- c("yi", "vi")
forest(sav$yi, sav$vi, slab=rownames(sav))
This isn't entirely correct, since the model fitted assumes constant heterogeneity between the estimates within districts, while synthesizing estimates within districts for each district separately allows for different amounts of heterogeneity. A forest plot fully in line with the model that is fitted would be (where I force the amount of heterogeneity within districts to be equal to the estimate from the fitted model):
sav <- lapply(split(dat, dat$district), function(x) {
res <- rma(yi, vi, data=x, tau2=res$sigma2[2])
return(c(coef(res), vcov(res)))
})
sav <- data.frame(do.call(rbind, sav))
names(sav) <- c("yi", "vi")
forest(sav$yi, sav$vi, slab=rownames(sav))
In fact, if we now meta-analyze the aggregated values, then we get *exactly* the same results as those from the full model:
rma(yi, vi, data=sav)
res
Pretty neat!
Best,
Wolfgang
-----Original Message-----
From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org] On Behalf Of Martin Bauer
Sent: Tuesday, 12 February, 2019 8:18
To: r-sig-meta-analysis using r-project.org
Subject: [R-meta] Forest plot
Hi there,
I am doing a meta analysis right now and I have about 41 studies. Every study does contain between 2-200 information and results. In total there are 1745 observations. Now I want to create a forest plot but just for the 41 studies. How can I do it?
I tried it that way:
forest(res, slab=paste(StudiesSponsorship$studien_name, as.character(StudiesSponsorship$studien_ID), sep =",")
However, the result was, that every study is included a couple of times depending how much results they deliver. So if the study has 10 results, it is represented 10 times in the forest plot. So the forest plot is very confusing.
My data set is called: StudiesSponsorship
The Random Effect Modell is called: res
I hope that someone can help me :)
Thanks for your time.
Greets,
Martin
More information about the R-sig-meta-analysis
mailing list