How do I get rid off pre-printed text in Forest Plot using Metafor/R?

cmirian

I am using the Metafor package to produce meta-analysis and subsequently a Forest Plot. When I print my Forest Plot a "RE Model"-text appears automatically as shown on the attached print. I can't figure out how to remove the "RE Model" although I use a separate text-script. I just want my "own" text to appear aligned with the polygon. Can you help?

enter image description here

First "load data" and then my script:

### Load data
dat <- structure(list(study = structure(c(4L, 5L, 3L, 1L, 2L, 7L, 6L
), .Label = c("Battaglia et al.", "Hong et al.", "Kosyakove et al.", 
          "Lim et al.", "Rauch et al.", "Swachia et al.", "Tsounis et 
al."
), class = "factor"), n1i = c(20L, 121L, 25L, 18L, 31L, 35L, 
                          22L), m1i = c(12.8, 30.2, 24.6, 21, 25, 27, 
18.2), sd1i = c(15.4, 

21.6, 17, 33, 18, 13.8, 8.72), n2i = c(20L, 129L, 25L, 17L, 32L, 

34L, 20L), m2i = c(12.1, 28.7, 25.1, 31, 26, 28.6, 14.7), sd2i = c(14.6, 

21.6, 12.2, 25, 19, 24.2, 12.9), ntotal = c(40L, 250L, 50L, 35L, 

63L, 69L, 42L), mean.age = c(3L, 3L, 1L, 4L, 4L, 3L, 3L), demograhic = 
c(0L, 

2L, 1L, 1L, 0L, 1L, 0L), adjusted.comorbid = c(1L, 1L, 1L, 1L, 

0L, 1L, 1L), follow.up = c(1L, 3L, 3L, 1L, 2L, 2L, 2L), severity = c(2L, 

4L, 1L, 4L, 4L, 4L, 4L), treat.sys = c(1L, 2L, 1L, 2L, 1L, 2L, 

1L), treat.int = c(1L, 1L, 2L, 1L, 2L, 1L, 1L), year = c(2000L, 

2000L, 2000L, 2000L, 2000L, 2000L, 2000L), citation = c(1L, 2L, 

3L, 4L, 5L, 6L, 6L), yi = structure(c(0.700000000000001, 1.5, 

-0.5, -10, -1, -1.6, 3.5), measure = "MD", ni = c(40L, 250L, 

50L, 35L, 63L, 69L, 42L)), vi = c(22.516, 7.47261195464155, 17.5136, 

97.2647058823529, 21.7328629032258, 22.6658487394958, 11.7767909090909

)), .Names = c("study", "n1i", "m1i", "sd1i", "n2i", "m2i", "sd2i", 

"ntotal", "mean.age", "demograhic", "adjusted.comorbid", "follow.up", 

"severity", "treat.sys", "treat.int", "year", "citation", "yi", 

"vi"), row.names = c(NA, -7L), class = c("escalc", "data.frame"

), digits = 4, yi.names = "yi", vi.names = "vi")

AND my code

### My code
res <- rma(yi, vi, data=dat, slab=paste(study, year, citation, sep=", "), method = "REML")
forest(res, xlim=c(-39,24), at=c(-12,-9,-6,-3,0,3,6,9,12), showweights = TRUE,
   ilab=cbind(dat$m1i, dat$n1i, dat$sd1i, dat$m2i, dat$n2i, dat$sd2i),
   ilab.xpos=c(-26,-24,-22,-18,-16,-14), cex=1, ylim=c(-2, 10), font=1, digits=2, col="darkgrey")

### Add own text
 text(-39, -2, pos=4, cex=0.9, font=2, 
 bquote(paste("Random-effects model for all studies: Q = ",
              .(formatC(q1$QE, digits=2, format="f")), 
              ", df = ", .(q1$k - q1$p),", p = ", 
              .(formatC(q1$QEp, digits=2, format="f")),
              ", ", I^2, " = ",
              .(formatC(q1$I2, digits=1, format="f")), 
              "%", ", ", tau^2 == 
                .(formatC(q1$tau2, digits=2, format="f")))))

Thank you in advance!

meenaparam

To make your forest plot without the "RE Model" text in the bottom left hand corner, just use the mlab = "" argument in your forest function call.

forest(res, xlim=c(-39,24), at=c(-12,-9,-6,-3,0,3,6,9,12), showweights = TRUE,
       ilab=cbind(dat$m1i, dat$n1i, dat$sd1i, dat$m2i, dat$n2i, dat$sd2i),
       ilab.xpos=c(-26,-24,-22,-18,-16,-14), cex=1, ylim=c(-2, 10), 
       font=1, digits=2, col="darkgrey", mlab = "")

enter image description here

Unfortunately I can't run the "Add own text" section of your provided code as you do not provide your q1 object. But you should be able to solve that yourself.

I figured this out using the Metafor-Project site, specifically their page on forest plots.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I get rid of the /#/ when using ui-router?

From Dev

How do I get rid of errors using TaskStackBuilder on Android Studio?

From Dev

How do I get rid of the HWaddr that docker0 is using?

From Dev

How can I get rid off a character to get the desired output

From Dev

How do I force gridLayout to make each cell the same size? Also how do I get rid off unnecessary spacing?

From Dev

How do I get rid of dotted line on x axis of Pandas/Matplotlib bar plot?

From Dev

How can I get rid off fork bomb?

From Dev

How do I get rid of the NameError and TypeError

From Dev

How do I get rid of this jump on slideToggle()?

From Dev

How do I get rid of "[1]"?

From Dev

What is &shy; and how do i get rid of it

From Dev

How do I get rid of this new line?

From Dev

How do I get rid of SKTextures?

From Dev

How do i get rid of an "MySQLSyntaxErrorException"

From Dev

How do I get rid of this goto?

From Dev

NoSuchElementException on Scanner, how do i get rid of it?

From Dev

How do I get rid of this new line?

From Dev

How do I get rid of this Anthy toolbar?

From Dev

How do I get rid of this allocated space?

From Dev

How do i get rid of this warning

From Dev

How do I get rid of the last comma?

From Dev

How do I get rid of OneDrive completely?

From Dev

How do I get rid of this monitor error?

From Dev

How do I get rid of these "Formatting" lines?

From Dev

How do I get rid of this toolbar in Eclipse?

From Dev

How do I get rid of pocket for firefox?

From Dev

How do I get rid of Amazon Assistant?

From Dev

How do I get rid of a duplicate application?

From Dev

How do I get the height and width of a text printed on a 300 dpi label printer?

Related Related

HotTag

Archive