[R-meta] How to use superscript in the forest plot (package 'meta')?

Guido Schwarzer @c @end|ng |rom |mb|@un|-|re|burg@de
Mon Jan 31 22:09:36 CET 2022


Antonello,

R function JAMAlabels() in meta can be used for JAMA labels, i.e., 
Author (Year) superscript index. At the moment there is no corresponding 
function for Lancet labels.

The following R code - adapted from JAMAlabels() - generates and uses 
Lancet labels in the forest plot:

library(meta)
data(Fleiss1993bin)

refs <- 20 + 1:7

Fleiss1993bin$mylabs <- NA
##
for (i in seq_len(nrow(Fleiss1993bin)))
   Fleiss1993bin$mylabs[i] <-
     with(Fleiss1993bin,
          as.expression(substitute(study~(year)^ref,
                                   list(study = study[i],
                                        year = year[i],
                                        ref = refs[i]))))

m <- metabin(d.asp, n.asp, d.plac, n.plac, data = Fleiss1993bin, sm = "OR")

forest(m, studlab = mylabs)

Best,

Guido



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