Forest Plots (Method for 'cumul.rma' Objects)
Function to create forest plots for objects of class "cumul.rma"
.
## S3 method for class 'cumul.rma' forest(x, annotate=TRUE, header=FALSE, xlim, alim, clim, ylim, top=3, at, steps=5, level=x$level, refline=0, digits=2L, width, xlab, ilab, ilab.xpos, ilab.pos, transf, atransf, targs, rows, efac=1, pch=15, psize=1, col, lty, fonts, cex, cex.lab, cex.axis, annosym, ...)
x |
an object of class |
annotate |
logical specifying whether annotations should be added to the plot (the default is |
header |
logical specifying whether column headings should be added to the plot (the default is |
xlim |
horizontal limits of the plot region. If unspecified, the function tries to set the horizontal plot limits to some sensible values. |
alim |
the actual x-axis limits. If unspecified, the function tries to set the x-axis limits to some sensible values. |
clim |
limits for the confidence intervals. If unspecified, no limits are used. |
ylim |
the y limits of the plot. If unspecified, the function tries to set the y-axis limits to some sensible values. |
top |
the amount of space to leave empty at the top of the plot (e.g., for adding headers) (the default is 3 rows). |
at |
position of the x-axis tick marks and corresponding labels. If unspecified, the function tries to set the tick mark positions/labels to some sensible values. |
steps |
the number of tick marks for the x-axis (the default is 5). Ignored when the user specifies the positions via the |
level |
numerical value between 0 and 100 specifying the confidence interval level (the default is to take the value from the object). |
refline |
value at which a vertical ‘reference’ line should be drawn (the default is 0). The line can be suppressed by setting this argument to |
digits |
integer specifying the number of decimal places to which the tick mark labels of the x-axis and the annotations should be rounded (the default is |
width |
optional integer to manually adjust the width of the columns for the annotations. |
xlab |
title for the x-axis. If unspecified, the function tries to set an appropriate axis title. |
ilab |
optional vector, matrix, or data frame providing additional information about the studies that should be added to the plot. |
ilab.xpos |
vector of numerical value(s) specifying the x-axis position(s) of the variable(s) given via |
ilab.pos |
integer(s) (either 1, 2, 3, or 4) specifying the alignment of the vector(s) given via |
transf |
optional argument specifying the name of a function that should be used to transform the observed effect sizes, summary estimates, fitted values, and confidence interval bounds (e.g., |
atransf |
optional argument specifying the name of a function that should be used to transform the x-axis labels and annotations (e.g., |
targs |
optional arguments needed by the function specified via |
rows |
optional vector specifying the rows (or more generally, the horizontal positions) for plotting the outcomes. If unspecified, the function sets this value automatically. Can also be a single value specifying the row (horizontal position) of the first outcome (the remaining outcomes are then plotted below this starting row). |
efac |
vertical expansion factor for confidence interval limits and arrows. The default value of 1 should usually work okay. Can also be a vector of two numbers, the first for CI limits, the second for arrows. |
pch |
plotting symbol to use for the observed effect sizes or outcomes. By default, a filled square is used. See |
psize |
optional vector with point sizes for the observed effect sizes or outcomes. Default is 1. |
col |
optional character string specifying the name of a color to use for plotting ("black" is used by default if not specified). Can also be a vector of color names. |
lty |
optional character string specifying the line type for the confidence intervals (if unspecified, the function sets this to |
fonts |
optional character string specifying the font to use for the study labels, annotations, and the extra information (if specified via |
cex |
optional character and symbol expansion factor. If unspecified, the function tries to set this to a sensible value. |
cex.lab |
optional expansion factor for the x-axis title. If unspecified, the function tries to set this to a sensible value. |
cex.axis |
optional expansion factor for the x-axis labels. If unspecified, the function tries to set this to a sensible value. |
annosym |
optional vector of length 3 to change the left bracket, separation, and right bracket symbols for the annotations. |
... |
other arguments. |
The plot shows the estimated (average) outcome with corresponding confidence interval as one study at a time is added to the analysis.
The function tries to set some sensible values for the optional arguments, but it may be necessary to tweak these in certain circumstances.
The function actually returns some information about the chosen defaults invisibly. Printing this information is useful as a starting point to make adjustments to the plot.
If the number of studies is quite large, the labels, annotations, and symbols may become quite small and impossible to read. Stretching the plot window vertically may then provide a more readable figure (one should call the function again after adjusting the window size, so that the label/symbol sizes can be properly adjusted). Also, the cex
, cex.lab
, and cex.axis
arguments are then useful to adjust the symbol and text sizes.
If the horizontal plot and/or x-axis limits are set by the user, then the horizontal plot limits (xlim
) must be at least as wide as the x-axis limits (alim
). This restriction is enforced inside the function.
If the outcome measure used for creating the plot is bounded (e.g., correlations are bounded between -1
and 1
, proportions are bounded between 0
and 1
), one can use the clim
argument to enforce those limits (confidence intervals cannot exceed those bounds then).
The lty
argument can also be a vector of two elements, the first for specifying the line type of the individual CIs ("solid"
by default), the second for the line type of the horizontal line that is automatically added to the plot ("solid"
by default; set to "blank"
to remove it).
Wolfgang Viechtbauer wvb@metafor-project.org http://www.metafor-project.org/
Chalmers, T. C., & Lau, J. (1993). Meta-analytic stimulus for changes in clinical trials. Statistical Methods in Medical Research, 2, 161–172.
Lau, J., Schmid, C. H., & Chalmers, T. C. (1995). Cumulative meta-analysis of clinical trials builds evidence for exemplary medical care. Journal of Clinical Epidemiology, 48, 45–57.
Lewis, S., & Clarke, M. (2001). Forest plots: Trying to see the wood and the trees. British Medical Journal, 322, 1479–1480.
Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1–48. https://www.jstatsoft.org/v036/i03.
### calculate log risk ratios and corresponding sampling variances dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg) ### random-effects model res <- rma(yi, vi, data=dat, slab=paste(author, year, sep=", ")) x <- cumul(res, order=order(dat$year)) forest(x, cex=.8) forest(x, alim=c(-2,1), cex=.8) ### meta-analysis of the (log) risk ratios using the Mantel-Haenszel method res <- rma.mh(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg, slab=paste(author, year, sep=", ")) x <- cumul(res, order=order(dat$year)) forest(x, alim=c(-2,1), cex=.8)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.