Last active
August 10, 2018 03:12
-
-
Save dsquintana/b4a80de22ce14c4ab73c443f334ee83a to your computer and use it in GitHub Desktop.
An R script to generate various contour-enhanced funnel plots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Contour-enhanced funnel plots using metafor ### | |
# Load metafor package | |
library("metafor") | |
# Load dataset | |
dat <- get(data(dat.molloy2014)) | |
# Calculate r-to-z transformed correlations and corresponding sampling variances | |
dat <- escalc(measure="ZCOR", ri=ri, ni=ni, data=dat) # | |
# meta-analysis of the transformed correlations | |
res <- rma(yi, vi, data=dat) | |
res | |
# Standard funnel plot (Plot A) | |
funnel(res) | |
# Standard contour-enhanced funnel plot (Plot B) | |
funnel(res, refline=0, level=c(90, 95, 99), | |
shade=c("white", "gray", "darkgray")) | |
# Contour-enhanced funnel plot with colour (Plot C) | |
funnel(res, refline=0, level=c(90, 95, 99), | |
shade=c("white", "red", "orange")) | |
# Contour-enhanced funnel plot with adjusted significance levels (Plot C) | |
funnel(res, refline=0, level=c(95, 99), | |
shade=c("white", "red")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment