How do I change the 'Odds Ratio [95% CI]' label in a metafor forest() plot?

37 views Asked by At

I am creating a forestplot using the metafor package in R. Whenever I create a custom header, on the right side of the plot the text 'Odds Ratio [95% CI]' shows up. I want to name it differently, but I don't know which argument to use for this.

During my attempts, I have tried three different situations:

  • forest() without a header. Then no header and no label on the right side show up.
  • forest(header=NULL). Now we don't have a header on the left side, but on the right side we have our unwanted label.
  • forest(header="studies"). Now we have our header on the left side, but also the unwanted label on the right side.

How can I solve this? I have added a picture of the top of my forest plot below: Example

1

There are 1 answers

0
Ben On

As noted by @Wolfgang in the comments, you can refer to the Forest Plot function description and the header argument:

header: logical to specify whether column headings should be added to the plot (the default is FALSE). Can also be a character vector to specify the left and right headings (or only the left one).

https://wviechtb.github.io/metafor/reference/forest.default.html

If you provide two character values in a vector to the header argument, you can specify the title on the left, and something else on the right (instead of Odds Ratio).

For example, try:

library(metafor)

dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)
res <- rma(yi, vi, data=dat, slab=paste(author, year, sep=", "))

forest(res, header = c("left", "right"))

Output

Forest Plot with header including two values for left and right