[R-meta] Setting non-log x axis and tick marks organized when "atransf = exp" is used in the forest plot
Viechtbauer, Wolfgang (NP)
wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Fri Jun 2 15:02:38 CEST 2023
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:
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 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.
>From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org] On
>Behalf Of Win Thu via R-sig-meta-analysis
>Sent: Friday, 02 June, 2023 13:52
>To: r-sig-meta-analysis using r-project.org
>Cc: Win Thu
>Subject: [R-meta] Setting non-log x axis and tick marks organized when "atransf =
>exp" is used in the forest plot
>Currently, I finished a meta-analysis using metafor. Please advise how I can keep
>the X axis scale organized in the forest plot without needing to change it into a
>log scale when "atransf = exp" is used in the forest function.
>I used "atransf = exp" as I want to show the risk estimates and the result on a
>normal scale in the forest plot.
>The code is: forest (meta, atransf = exp) which gave me a X axis and tick marks
>not organized well and sometimes bizarre (fig below).
>I need to use: forest (meta, atransf = exp, at = log (c(0.5,1,1.5)) to get a more
>organized x axis (fig below) but the X axis scale is now in log scale while
>the result is not in log scale. The journal I want to publish asks to keep the X
>axis scale same with the relative risk scale. I want to keep relative risk on a
>normal scale, and thus, the X axis should not be in log scale.
>Your help will be greatly appreciated as I was trying several days and hours
>Thank you very much in advance,
More information about the R-sig-meta-analysis