Skip to content
Prev 3793 / 5636 Next

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

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