[R-meta] Question on metafor forest plot

Viechtbauer, Wolfgang (NP) wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Tue Jun 6 13:57:50 CEST 2023


Dear Gabriel,

The point sizes can also be set manually via the 'psize' argument. 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(res, header=TRUE, top=2)

forest(res, header=TRUE, top=2, cex=1.5, psize=weights(res)/10)

You can play around with the factor in weights(res)/10 until you like the size. Or just use psize=1 (or some other constant) to not draw points in different sizes.

The other thing that changes is the height of the lines at the end of the CI bounds and the size of the summary polygon. These can be controlled via the 'efac' argument. For example:

forest(res, header=TRUE, top=2, cex=1.5, psize=weights(res)/10, efac=0.7)

Again, play around with efac until you like how it looks. You can also specify two values for the lines at the end of the CI bounds and the summary polygon separately. For example:

forest(res, header=TRUE, top=2, cex=1.5, psize=weights(res)/10, efac=c(0,0.7))

Best,
Wolfgang

>-----Original Message-----
>From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces using r-project.org] On
>Behalf Of Gabriel Cotlier via R-sig-meta-analysis
>Sent: Tuesday, 06 June, 2023 13:29
>To: r-sig-meta-analysis using r-project.org
>Cc: Gabriel Cotlier
>Subject: [R-meta] Question on metafor forest plot
>
>Hello all,
>
>I would like to ask how can I modify the size of the text font in a
>metrafor package forest plot  without modifying the size of the size effect
>points and their error bars?
>
>I have tried to use cex but this argument indeed increases the text fonts
>size but also increases the size effect points and their error bars as well.
>
>Thanks a lot for your help.
>regards,



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