Search code examples
rstatisticsproportions

how to plot untransformed proportion in the x-axis of the funnel plot in meta package


I am doing funnel plot of proportion in meta in R with color coding based on different Year categories ( blue and red). My question is how to plot untransformed proportion in the x-axis of the funnel plot. I tried backtransf=F and atransf but this did not work.

Here is my code and data sample:

library(meta); library(metafor)
data(Fleiss1993bin)

m1 <- metaprop(d.asp, n.asp,  data = Fleiss1993bin, sm = "PLO")


Fleiss1993bin$year_2gps<-"Before 1980"
Fleiss1993bin$year_2gps[ Fleiss1993bin$year  >=1980 ]<-"Year 1980 or after"

# Use obtained proportion on x-axis (rather than logit)
funnel(m1, backtransf = F,# sm="PLO",
       order = c("Before 1980","Year 1980 or after"  ), 
       pch = c(7,7,7), 
       col = c("blue", "red"), 
       linreg = F)
legend(-2.5, 0,  c("Before 1980","Year 1980 or after" ),
       fill = c("blue", "red"))

enter image description here


Solution

  • A funnel plot showing untransformed proportions is possible using the summary measure "PRAW", for raw untransformed proportions.

    m2 <- metaprop(d.asp, n.asp, data = Fleiss1993bin, sm = "PRAW")
    funnel(m2)
    

    However, I would not conduct a meta-analysis of raw proportions and thus would not look at a funnel plot with raw proportions.

    BTW, I noticed several problems with the R code.

    First, the provided funnel plot comes from a trim-and-fill analysis as the Fleiss1993bin data set only contains seven studies.

    Second, the newly generated variable 'year_2gps' is not used at all in the subsequent R commands.

    Third, the colouring is wrong.

    The following R code, based on the development version of meta on GitHub (version 6.6-0) produces the correctly coloured funnel plot.

    install.packages("remotes")
    remotes::install_github("guido-s/meta")
    library("meta")
    
    data(Fleiss1993bin)
    #
    Fleiss1993bin$year_2gps <- "Before 1980"
    Fleiss1993bin$year_2gps[Fleiss1993bin$year >= 1980] <- "Year 1980 or after"
    
    m1 <- metaprop(d.asp, n.asp, data = Fleiss1993bin)
    
    funnel(m1, pch = 22,
      col = "black",
      bg = ifelse(year_2gps == "Before 1980", "blue", "red"),
      studlab = TRUE)
    legend("topleft",
      c("Before 1980","Year 1980 or after" ), fill = c("blue", "red"))
    

    enter image description here

    m2 <- metaprop(d.asp, n.asp, data = Fleiss1993bin, sm = "PRAW")
    
    funnel(m2, pch = 22,
      col = "black",
      bg = ifelse(year_2gps == "Before 1980", "blue", "red"),
      studlab = TRUE)
    legend("topleft",
      c("Before 1980","Year 1980 or after" ), fill = c("blue", "red"))
    

    enter image description here