Is it possible to color the datapoints in the Funnel plot? I am using the metafor package.
# Load package
library(metafor)
# Load data
data(dat.bcg)
# Code
ex <- rma(ai=tpos, bi=tneg, ci=cpos,
di=cneg, data=dat.bcg, measure="OR",
slab=paste(author, year, sep=", "), method="FE")
# Funnel plot
funnel(ex, transf = exp, ylab="Test group", xlab="Control")
Would it be possible to color the points based on a variable?
Fx blue colored datapoints that represent:
dat.bcg$alloc==random
Thank you, C.
I examined the source code for the
funnel
method and irritatingly, no, you cannot pass a vector of colors to thecol
argument.An easy workaround is to assign the output of
funnel()
to a variable, which will give you the x and y coordinates of the points in the funnel plot, then plot over the original points on the funnel plot with colored points.