I've been working on a meta-analysis project which involved the sophisticated GOSH plot to explore the between-study heterogeneity (Olkin et al., 2012). To further identify the potential outliers, I adopted the method proposed by Harrer et al. as described in a comprehensive guide (https://bookdown.org/MathiasHarrer/Doing_Meta_Analysis_in_R/gosh-plot-analysis.html). In specific, the gosh.diagnostics() function uses three unsupervised machine learning algorithms to detect clusters in the GOSH plot data and determine which studies contribute the most to them automatically. As I run this function, most of the time it gave me results without errors. However, this time it came back with an error saying "Error in [.data.frame
(dat.db.full, db.plot.mask, c(3, 6, outlier.studies.all.mask)) : undefined columns selected". Could someone please tell me what the problem might originate from and the possible solution to it?
Here's my code.
# install required packages
install.packages("devtools")
devtools::install_github("MathiasHarrer/dmetar")
install.packages("metafor")
# load required packages
library(metafor)
library(dmetar)
# Create data set
TE <- c(0.693147181,
0.932164081,
0.759870813,
0.937269138,
1.688249093,
0.955511445,
0.91228271,
0.353,
1.638258578,
2.592980871,
0.587786665,
1.098612289,
0.815364813,
0.444685821,
0.841567186,
-0.589606502
)
seTE <- c(0.332562268,
0.403827718,
0.280396018,
0.432861017,
0.196494688,
0.453186734,
0.47468172,
0.174,
0.379343294,
1.444715875,
0.276176517,
0.383693213,
0.417546777,
0.218181816,
0.663200487,
1.081238182
)
author <- seq(16)
df <- data.frame(author, TE, seTE)
# Fit the data
m.rma.df <- rma(yi = df$TE,
sei = df$seTE,
method = "DL")
# plot GOSH plot
dat.gosh.df <- gosh(m.rma.df)
# Run diagnostics
gosh.diagnostics(dat.gosh.df)