setwd("...") ## your working directory source("Functions.R") # publication bias tests for all types of outcomes methods.all <- c("rank","reg", "reg.het", "skew", "skew.het", "inv.sqrt.n", "trimfill") # publication bias tests for binary outcomes methods.binary <- c("rank", "reg", "reg.het", "skew", "skew.het", "inv.sqrt.n", "trimfill", "n", "inv.n", "as.rank", "as.reg", "as.reg.het", "smoothed", "smoothed.het", "score", "count") ####### # Plourde et al., 2015, Lancet; effect size: MD y <- c(3.40, 1.30, 2.20, 2.00, -1.10, -0.90, 1.00, 5.00, 0.90, 1.00, 1.00, -0.30, 0.40, 0.60, 1.10, 2.60, -1.00, -0.10, -0.28) ci.low <- c(2.77, 0.90, 1.66, 0.28, -3.59, -1.65, -1.95, 3.20, -0.22, 0.53, -1.54, -2.78, -0.13, -0.54, -1.07, 1.35, -5.13, -0.85, -1.12) ci.upp <- c(4.03, 1.70, 2.74, 3.72, 1.39, -0.15, 3.95, 6.80, 2.02, 1.47, 3.54, 2.18, 0.93, 1.74, 3.27, 3.85, 3.13, 0.65, 0.56) n1 <- c(66, 73, 72, 279, 77, 25, 54, 57, 152, 670, 217, 50, 100, 49, 60, 2249, 24, 348, 52) n2 <- c(126, 75, 126, 299, 72, 50, 48, 57, 155, 335, 222, 50, 100, 59, 59, 2295, 30, 359, 51) n <- n1 + n2 s <- (ci.upp - ci.low)/(2*1.96) s2 <- s^2 plourde.rma <- rma(yi = y, vi = s2) set.seed(1234) plourde.pb <- pb.hybrid.nonbinary(y = y, s2 = s2, n = n, methods = methods.all, iter.resam = 10000, theo.pval = FALSE) plourde.pb ####### # Paige et al., 2017, JAMA; effect size:SMD y <- c(-0.04, -0.37, -0.29, -0.67, -0.47, -1.00) ci.low <- c(-0.15, -0.68, -0.70, -1.09, -0.98, -1.78) ci.upp <- c(0.07, -0.06, 0.12, -0.24, 0.04, -0.23) n1 <- c(172, 118, 46, 45, 30, 15) n2 <- c(139, 60, 47, 46, 30, 14) n <- n1 + n2 s <- (ci.upp - ci.low)/(2*1.96) s2 <- s^2 paige.rma <- rma(yi = y, vi = s2) set.seed(1234) paige.pb <- pb.hybrid.nonbinary(y = y, s2 = s2, n = n, methods = methods.all, iter.resam = 10000, theo.pval = FALSE) paige.pb ####### # Whiting et al., 2015, JAMA; effect size: OR n11 <- c(31, 7, 16, 2, 23, 46, 120, 35, 57, 83, 30, 109, 102, 156, 120, 67, 6, 32, 17, 14, 16, 32, 23, 12, 5, 5, 136, 3, 133) n1 <- c(72, 11, 21, 17, 24, 56, 149, 36, 63, 90, 34, 128, 124, 167, 167, 80, 7, 36, 20, 26, 19, 45, 26, 19, 9, 12, 172, 6, 143) n01 <- c(9, 8, 7, 3, 11, 29, 101, 26, 48, 71, 22, 83, 46, 132, 106, 57, 6, 14, 11, 9, 15, 13, 20, 5, 3, 2, 99, 2, 100) n0 <- c(67, 10, 21, 14, 24, 60, 148, 34, 62, 91, 32, 118, 65, 170, 172, 80, 9, 36, 20, 23, 19, 45, 27, 19, 11, 12, 181, 6, 134) n00 <- n0 - n01 n10 <- n1 - n11 y <- log(n11/n10/n01*n00) s2 <- 1/n11 + 1/n10 + 1/n01 + 1/n00 whiting.rma <- rma(yi = y, vi = s2) set.seed(1234) whiting.pb <- pb.hybrid.binary(n00 = n00, n01 = n01, n10 = n10, n11 = n11, methods = methods.binary, iter.resam = 10000, theo.pval = FALSE) whiting.pb ####### # funnel plots pdf(file = "Fig1FunnelPlots.pdf", width = 8.8, height = 3) par(mfrow = c(1, 3), mgp = c(2, 1, 0), mar = c(4, 3, 3, 1) + 0.1) funnel(plourde.rma, xlab = "Mean difference", ylab = "Standard error", main = "(a) Plourde et al. (2015)", font.main = 1) funnel(paige.rma, xlab = "Standardized mean difference", ylab = "Standard error", main = "(b) Paige et al. (2017)", font.main = 1) funnel(whiting.rma, xlab = "Log odds ratio", ylab = "Standard error", main = "(c) Whiting et al. (2015)", font.main = 1) par(mfrow = c(1, 1)) dev.off()