Solved – Funnel plot with asymmetrical point sizes

data visualizationfunnel-plotmeta-analysisr

Lets say I want to take the usual funnel plot for meta-analysis, and add another dimension to it, visually changing the points used for each study by a covariate. While it might be easier to change the marker or color for categorical variables, for a continuous variable, this gets a little harder.

Lets say we want to see if there's obvious asymmetry not just overall, but by say, length of follow-up. Does anyone know a way in either R or Stata to either change the size of the points plotted – so you essentially have a funnel-bubble plot, or to color them on a continuous gradient?

Clearly, this can be done by just modifying a scatterplot, but I'd like to save the steps in manipulating the access to get it looking like a conventional funnel plot.

Best Answer

You can do that with the funnel() function from the metafor package. Here is an example:

library(metafor)

data(dat.bcg)
res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg, measure="RR", method="REML")

ablat.scaled <- with(dat.bcg, (ablat - min(ablat))/(max(ablat) - min(ablat)))
ablat.scaled <- ablat.scaled * 2 + 0.5

funnel(res, cex=ablat.scaled)

Resulting figure shown below. Adapt to your taste.

funnel plot with asymmetrical point sizes