madina_b
madina_b

Reputation: 55

How to create a funnel plot where the same color indicates effect sizes from the same studies

I am trying to create a funnel plot in metafor to test if there is a publication bias. In the funnel plot, I am trying to create the same color indicating effect sizes from the same studies. I recently came across a paper where they applied the same approach using the following code:

mod1 <- rma(yi, vi, data = dat3)
pdf(NULL)
dev.control(displaylist="enable")
par(mar=c(4,4,0.1,0) + 0.1)
funnel(mod1, col =inferno(25)[pos],
       ylim = c(0, 0.26), xlim = c(-0.6, 0.8),
       ylab = "Standard error (SE)", xlab = "Effect size (lnRR)")

I was just wondering what could inferno(25)[pos] mean in the argument col. Does anyone know how to create such a funnel plot where the same color indicates effect sizes from the same studies?

Upvotes: 1

Views: 179

Answers (1)

madina_b
madina_b

Reputation: 55

I made it work by pasting data$esid into col argument. Where data is your original data and esid is the unique id for each effect size

Upvotes: 1

Related Questions