Thank you FJCC,
I try to properly position elements in forest plot from Metafor package, and this is why I would like to understand how does it work I mean x, y coordinates in text() function from base R plots, especially, because I believe they are used in Metafor package in forest() plot function.
Here below, there is a sample code:
library(metafor)
library(readr)
dat <- readr::read_csv("https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20180730/e790230b/attachment-0001.obj")
sub <- subset(dat, outcome=="periorneomortalityany" & Parity=="nullip" & Integration=="integ")
primary <- rma(yi, vi, data=sub, measure="OR",
slab = paste(sub$author, sub$year, sep=", "),
digits=2, level=95)
forest(primary, addfit=TRUE, showweights=TRUE, atransf=exp,
xlab="Odds Ratio", mlab="Random Effects Model",
order=order(sub$PragIdeal),
ilab=cbind(sub$HomePos, sub$HomeNeg, sub$HospPos, sub$HospNeg),
ilab.xpos=c(-14.5,-12,-9,-6))
forest(primary, addfit=TRUE, showweights=TRUE, atransf=exp,
xlab="Odds Ratio", mlab="Random Effects Model",
order=order(sub$PragIdeal),
ilab=cbind(sub$HomePos, sub$HomeNeg, sub$HospPos, sub$HospNeg),
ilab.xpos=c(-20,-16,-12,-8), xlim=c(-35,20), at=log(c(.01, .1, 1, 10, 100)))
So my question is, where is it :
ilab.xpos=c(-14.5,-12,-9,-6))
ilab.xpos=c(-20,-16,-12,-8)
Is it related to:
xlim=c(-35,20)
Another example:
https://www.metafor-project.org/doku.php/plots:forest_plot_with_subgroups
### add additional column headings to the plot
text(c(-9.5,-8,-6,-4.5), 26, c("TB+", "TB-", "TB+", "TB-"))
text(c(-8.75,-5.25), 27, c("Vaccinated", "Control"))
### add text for the subgroups
text(-16, c(24,16,5), pos=4, c("Systematic Allocation",
"Random Allocation",
"Alternate Allocation"))
So I would like to know where is it on this plot:
text(c(-9.5,-8,-6,-4.5), 26,
text(-16, c(24,16,5), pos=4,
Please forgive me as somehow I don't see it yet.