"rma"
.## S3 method for class 'rma':
forest(x, annotate=TRUE, addfit=TRUE, xlim=NULL, alim=NULL, ylim=NULL,
at=NULL, steps=5, level=x$level, digits=2, refline=0, xlab=NULL,
slab=NULL, mlab=NULL, ilab=NULL, ilab.xpos=NULL, ilab.pos=NULL,
order=NULL, transf=FALSE, atransf=FALSE, targs=NULL, addrows=0,
efac=1, pch=15, psize=NULL, col="darkgray", border="darkgray",
cex=NULL, cex.lab=NULL, cex.axis=NULL, ...)
"rma"
.TRUE
).NULL
, which means that the function tries to set the horizontal plot limits to some sensible values.NULL
, which means that the function tries to set the x axis limits to some sensible values.NULL
, which means that the function tries to set the y axis limits to some sensible values.NULL
, which means that the function tries to set the tick mark positions/labels to some sensible values.at
argument.NA
.NULL
by default, which suppresses the title).NULL
, which means that the labels are either taken from the object (if study labels were specified) or simple labels are created within the function. To suppress labels, sNULL
, which means that the label is created within the function.ilab
.ilab
(2 means right, 4 mean left aligned). The default is to center the labels.transf=exp
). Defaults to FALSE
, which meantransf=exp
). Defaults to FALSE
, which means that no transformation is used.transf
or atransf
.points
for other options.NULL
, which means that the point sizes are drawn proportional to the inverse of the sampling variances.NULL
(default), the function tries to set this to a sensible value.NULL
(default), the function tries to set this to a sensible value.NULL
(default), the function tries to set this to a sensible value."darkgray"
by default)."darkgray"
by default).transf
argument, the observed effect sizes, summary estimate, fitted values, and confidence interval bounds can be transformed with an arbitrary function. For example, if log odds ratios were analyzed, 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. The examples below illustrate the use of these arguments.
The studies can be reordered with the order
argument:
order="obs"
: the studies are ordered by the observed effect sizes,order="fit"
: the studies are ordered by the fitted values,order="prec"
: the studies are ordered by their sampling variances,order="resid"
: the studies are ordered by the size of their residuals,order
equal to a vector with indices giving the desired order.
Additional summary estimates can also be added to the plot with the addpoly
function. See the documentation for that function for examples.forest.rma
, addpoly
, addpoly.default
, addpoly.rma
### load BCG vaccine data
data(dat.bcg)
### meta-analysis of the log risk rates using a random-effects model
res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, slab=paste(author, year),
data=dat.bcg, measure="RR", method="REML")
### several forest plots illustrating the use of various arguments
forest(res, xlab="Log Relative Risk")
forest(res, transf=exp, alim=c(0,6), steps=4, xlim=c(-8,12),
xlab="Relative Risk", refline=1)
forest(res, atransf=exp, at=log(c(.05,.25,1,4,12)), xlim=c(-8,6),
xlab="Relative Risk (log scale)", order="prec")
forest(res, atransf=exp, at=log(c(.05,1,12)), xlim=c(-34,14), ylim=c(-2.5,15),
xlab="Relative Risk (log scale)", order="prec",
ilab=cbind(dat.bcg$tpos, dat.bcg$tneg, dat.bcg$cpos, dat.bcg$cneg),
ilab.xpos=c(-18,-14,-10,-6), cex=.7)
text(c(-18,-14,-10,-6), y=14.5, c("TB+", "TB-", "TB+", "TB-"), cex=.7)
text(c(-16,-8), y=15.5, c("Vaccinated", "Control"), cex=.7)
text(c(10), y=15, c("Observed [95% CI]"), cex=.7)
### mixed-effects model with absolute latitude in the model
res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, mods=ablat, slab=paste(author, year),
data=dat.bcg, measure="RR", method="REML")
### forest plots with observed and fitted values
forest(res, xlim=c(-18,10), ylim=c(.5, 15), order="fit", xlab="Log Relative Risk",
ilab=dat.bcg$ablat, ilab.xpos=-6)
text(-6, y=15, c("Absolute
Latitude"))
Run the code above in your browser using DataLab