Skip to content
Prev 4666 / 5636 Next

[R-meta] Setting non-log x axis and tick marks organized when "atransf = exp" is used in the forest plot

Dear Win,

I am not entirely sure I understand exactly what you want, but I think you want to use the 'transf' argument instead of 'atransf'. For example:

library(metafor)

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

# forest plot of the log risk ratios
forest(res, header=TRUE)

# forest plot of the risk ratios (log scale for the x-axis)
forest(res, header=TRUE, atransf=exp, at=log(c(0.05, 0.25, 1, 4)))

# forest plot of the risk ratios
forest(res, header=TRUE, transf=exp, alim=c(0,4), refline=1)

In the last case, the CIs will be asymmetric since exp() is a non-linear transformation.

Best,
Wolfgang