[R-meta] How to add the regression line onto Deek's funnel plot

Viechtbauer, Wolfgang (SP) wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Mon Oct 28 15:29:56 CET 2019

Hi Paul,

Thanks for the reproducible example. Here is how I would do it (without using ggplot2).


# read data
df <- read.csv("chang_cbcl.csv")

# calculate effect size as lnDOR
data1 <- escalc(measure="OR", ai=TP, bi=FP, ci=FN, di=TN, data=df)

# funnel plot with 1/sqrt(data1$ESS) on y-axis
fplot <- funnel(data1$yi, 1/sqrt(data1$ESS), yaxis="vi", atransf=exp,
                at=log(c(1, 10, 100, 1000)), ylim=c(0.04,0.20), refline=NA,
                xlab="Diagnostic Odds Ratio", ylab="1/root(ESS)",
                main="Deek's Funnel Plot Asymmetry Test", pch=21, cex=2)

# add text
text(fplot$x, fplot$y, fplot$slab, cex=.6)

# regression test
newf_lm <- lm(yi ~ I(1/sqrt(ESS)), weights = ESS, data = data1)

# add line
lims <- range(1/sqrt(data1$ESS))
segments(coef(newf_lm)[1] + coef(newf_lm)[2] * lims[1], lims[1], 
         coef(newf_lm)[1] + coef(newf_lm)[2] * lims[2], lims[2], lwd=2)

# add legend
legend("topright", inset=.01, legend=c("Study", "Regression Line"),
       pch=c(21, NA), lty=c(NA, "solid"), bg="white")

That comes pretty close to chang_cbcl_deeksfunnel.png.


-----Original Message-----
From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org] On Behalf Of Paul Chang
Sent: Wednesday, 23 October, 2019 11:49
To: r-sig-meta-analysis using r-project.org
Subject: [R-meta] How to add the regression line onto Deek's funnel plot

To whom this may concern,

I've been learning how to perform meta-analysis of diagnostic test accuracy (DTA).
I used mada package maintained by Prof. Doebler.
I'm aware that publication bias of DTA is better analyzed with the method proposed by Deek et al in 2005.
The Deek's funnel plot plots the lnDOR against the inverse of the square root of effective sample size (ESS).
Test of asymmetry is then conducted by regression of lnDOR with 1/root(ESS).
Please see the attachment "deeks2005" for more details.

Since Deek's funnel plot is not included in the mada package, and after discussion with Prof. Doebler, I adopted his suggestion that I use funnel() function within the metafor package to customize what I need to plot Deek's funnel plot.
I've got so close except for the final step: adding the regression line to the funnel plot.
I used the Child Behavior Checklist (CBCL) scale in the Chang et al study to practice.
Please see the attachment for the dataset ("chang_cbcl.csv"), my code ("Deek funnel plot.R") and the results after running in the console ("console.txt").
The regression to test the asymmetry yielded same P-value as in the Chang et al. study.
Please see the attachments of their funnel plot and mine ("chang_cbcl_deeksfunnel.png" and "myplot.png", respectively).

As I mentioned earlier, I couldn't find a way to correctly add the regression line onto the funnel plot.
Is there any solution you suggest?
Please let me know.  

Thank you very much. Best wishes.

Chang, Chun-Yu (Paul)
Class 2018, School of Medicine, Tzu Chi University
Post-graduate-year doctor, Taipei Tzu Chi Hospital, Buddhist Tzu Chi Medical Foundation, New Taipei, Taiwan
E-mail: paulchang1231 using gmail.com
Cell: 0978000933

More information about the R-sig-meta-analysis mailing list