[R-meta] How to replace labels in metafor forest plots?

iagogv |@gogv @end|ng |rom d|@root@org
Wed Jul 30 13:05:45 CEST 2025


Hi all,

Let's say we have the common example

dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg,
               slab=paste(author, year, sep=", "), data=dat.bcg)
res <- rma(yi, vi, data=dat)
forest(res, addpred=TRUE, xlim=c(-16,7), at=seq(-3,2,by=1), shade=TRUE,
        ilab=cbind(tpos, tneg, cpos, cneg), ilab.xpos=c(-9.5, -8, -6, 
-4.5),
        ilab.lab=c("TB+", "TB-", "TB+", "TB-"), cex=0.75, 
header="Author(s) and Year")
text(c(-8.75, -5.25), res$k+2.8, c("Vaccinated", "Control"), cex=0.75, 
font=2)

The header of the estimates column is Log [RR] [95% CI].

I would like to change it (actually, my estimates are Hazard Ratios, and 
I want to replace the label 'Estimate' by 'Hazard Ratio'), but adding 
text in the same position just add the new text, but does not remove the 
original label. How can I replace this label?

Thank you for your help!

Iago
	[[alternative HTML version deleted]]



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