## S3 method for class 'default':
forest(x, vi, sei, ci.lb, ci.ub, annotate=TRUE, showweight=FALSE,
xlim, alim, ylim, at, steps=5,
level=95, digits=2, refline=0, xlab,
slab, ilab, ilab.xpos, ilab.pos,
subset, transf=FALSE, atransf=FALSE, targs, rows,
efac=1, pch=15, psize, cex, cex.lab, cex.axis, \dots)vi or sei, needs to be specified)vi or sei is specified. See vi or sei is specified. See TRUE).FALSE).at argument.NA.NA.ilab (must be specified if ilab is specified).ilab (2 means right, 4 mean left aligned). If unspecified, the default is to center the labels.transf=exp). Defaults to FALSE, which means that no trtransf=exp). Defaults to FALSE, which means that no transformation is used.transf or atransf.points for other options. Can also be a vector of values.x argument) together with the corresponding sampling variances (via the vi argument) or with the corresponding standard errors (via the sei argument). Alternatively, one can specify the observed effect sizes or outcomes together with the corresponding confidence interval bounds (via the ci.lb and ci.ub arguments).
With the transf argument, the observed effect sizes or outcomes and corresponding confidence interval bounds can be transformed with an arbitrary function. For example, when plotting log odds ratios, then one could use transf=exp to obtain a forest plot showing the odds ratios. Alternatively, one can use the atransf argument to transform the x-axis labels and annotations (e.g., atransf=exp). The examples below illustrate the use of these arguments.
By default, the studies are ordered from top to bottom (i.e., the first study in the dataset will be placed in row $k$, the second study in row $k-1$, and so on, until the last study, which is placed in the first row). The studies can be reordered with the subset argument (by specifying a vector with indices with the desired order).
Summary estimates can also be added to the plot with the addpoly function. See the documentation for that function for examples.forest, forest.rma, addpoly### load BCG vaccine data
data(dat.bcg)
### calculate log relative risks and corresponding sampling variances
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)
### default forest plot of the observed log relative risks
forest(dat$yi, dat$vi)
### forest plot of the observed relative risks
forest(dat$yi, dat$vi, slab=paste(dat$author, dat$year, sep=", "), transf=exp,
alim=c(0,2), steps=5, xlim=c(-2,3.5), refline=1)
### forest plot of the observed relative risks
forest(dat$yi, dat$vi, slab=paste(dat$author, dat$year, sep=", "), atransf=exp,
at=log(c(.05,.25,1,4,20)), xlim=c(-10,8))
### see also examples for the forest.rma functionRun the code above in your browser using DataLab