The Galbraith plot identifies potential outliers or influential studies in a meta-analysis. Outliers can significantly impact the results and overall conclusions. Studies that fall far outside the confidence region could be potential outliers or influential studies. These studies might be driving the heterogeneity or inconsistency observed in the meta-analysis results.
library(metafor)
### fit equal-effects model
res <- rma(yi, vi, data=dat.hackshaw1998, method="EE")
### adjust margins so the space is better used
par(mar=c(5,4,0,3))
### draw radial plot
radial(res)
How can I raise a warning if a study falls outside the confidence region when calling the plot?
I am looking for a way to raise a warning or a footnote in my R-shiny app for a meta-analysis when the diagnostic plots have certain characteristics. Not sure if that is even possible...
Basically you just need the confidence region. Without recalculating everything by hand, you could adjust the radial.rma function:
fix("radial.rma") # opens editor to change function locally
## now change the last lines:
ll <- -zcrit + xi * beta
ul <- zcrit + xi * beta
if (is.null(x$not.na.yivi)) {
invisible(data.frame(x = xi, y = zi, ids = x$ids[x$not.na],
slab = x$slab[x$not.na], ll, ul, stringsAsFactors = FALSE))
}
else {
invisible(data.frame(x = xi, y = zi, ids = x$ids[x$not.na.yivi],
slab = x$slab[x$not.na.yivi], ll, ul, stringsAsFactors = FALSE))
}
ll
is the lower limit and ul
is the upper limit. Now you can call the function radial again, but assign it to a variable:
radial_data <- radial(res)
And finally filter for the y-values that are outside the CI. You can of course then do anything you want with it, e.g. displaying a warning or a message in shiny.