Learn R Programming

meta (version 9.0-0)

forest.metacum: Forest plot to display the result of a cumulative meta-analysis

Description

Draws a forest plot showing the results as studies are cumulatively added, using the grid graphics system.

Usage

# S3 method for metacum
forest(
  x,
  layout = gs("layout"),
  prediction = x$prediction,
  overall = x$overall,
  leftcols = NULL,
  rightcols = NULL,
  leftlabs = NULL,
  rightlabs = NULL,
  lab.NA = gs("lab.NA"),
  col = NULL,
  print = NULL,
  type = "square",
  digits = NULL,
  backtransf = x$backtransf,
  big.mark = gs("big.mark"),
  main = "Cumulative Meta-Analysis",
  filename = NULL,
  path = NULL,
  device = NULL,
  device.args = NULL,
  units = "in",
  height = NULL,
  width = NULL,
  dpi = 300,
  dev.off = NULL,
  new = TRUE,
  ...
)

Value

Invisibly returns a list with information about the forest plot, including the selected columns (leftcols, rightcols), their headings (leftlabs, rightlabs), formatted results, and graphical settings (see forest.meta). Element data contains the dataset used to create the forest plot.

Arguments

x

An object of class metacum.

layout

A character string specifying the layout of the forest plot (see forest.meta).

prediction

A logical indicating whether prediction intervals should be printed.

overall

A logical indicating whether overall results should be shown.

leftcols

A character vector specifying columns to be printed on the left side of the forest plot or a logical value; see forest.meta.

rightcols

A character vector specifying columns to be printed on the right side of the forest plot or a logical value; see forest.meta.

leftlabs

A character vector specifying labels for columns on the left side of the forest plot (see Details).

rightlabs

A character vector specifying labels for columns on the right side of the forest plot (see Details).

lab.NA

A character string to label missing values.

col

A named list specifying colours. A colour can also be supplied directly to set col$col. See Details for defaults specific to this function and meta-formatting for information on the elements.

print

A named list controlling displayed information. See Details for defaults specific to this function and meta-formatting for information on the elements.

type

A character string or vector specifying how to plot treatment effects and confidence intervals for cumulative meta-analysis results.

digits

A named list specifying digits used for displayed results; a scalar value is also accepted. See Details for defaults specific to this function and meta-formatting for information on the elements.

backtransf

A logical indicating whether results should be back transformed in forest plots. If backtransf = TRUE, results for sm = "OR" are presented as odds ratios rather than log odds ratios, for example.

big.mark

A character used as thousands separator.

main

A title for the forest plot.

filename

File name to store forest plot.

path

Path of the directory to save plot to: `path` and `filename` are combined to create the fully qualified file name. Defaults to the working directory.

device

Device to use. Can either be a device function (e.g., png), or one of "eps", "ps", "tex" (pictex), "pdf", "jpeg", "tiff", "png", "bmp", "svg" or "wmf" (Windows only). By default, the device is guessed based on the `filename` extension.

device.args

List with additional graphical parameters passed on to graphics function.

units

Units of the `width` and `height` of the file containing the forest plot. One of "in" (for inches, default), "cm", "mm", or "px" (for pixels), can be abbreviated.

height

Height of the graphics file.

width

Width of the graphics file.

dpi

Plot resolution.

dev.off

A logical to specify whether current graphics device should be shut down.

new

A logical value indicating whether a new figure should be printed in an existing graphics window.

...

Additional graphical arguments (passed on to forest.meta).

Author

Guido Schwarzer [email protected]

Details

Each row of the forest plot represents a meta-analysis based on the first k studies in the cumulative sequence. Results are shown in the order in which studies were added to the cumulative meta-analysis. The pooling model is determined by argument pooled in metacum. Prediction intervals and additional result columns can be selected when drawing the forest plot.

A forest plot, also called a confidence interval plot, is drawn in the active graphics window using the grid graphics system. To save the plot, specify a file name with argument filename; the graphics device is selected from the file extension by default (see forest.meta for examples).

The named list print determines the default result columns. Argument layout determines their default placement, which can be overridden with leftcols and rightcols.

Arguments leftcols and rightcols can be used to specify columns printed on the left or right side, respectively. Arguments leftlabs and rightlabs can be used to provide headings for these columns. Use NA for a column heading to retain its default label.

Formatting defaults

Unless listed below, defaults for supported formatting elements are described in meta-formatting.

ElementDefault
print$I2, print$tau2, print$tauTRUE
print$stat, print$Q, print$pval.QFALSE
print$I2.ci, print$tau2.ci, print$tau.ciFALSE

The named list col controls colours using the following elements:

  • col: colour of confidence interval lines;

  • bg: fill colour of result symbols;

  • border: border colour of result symbols;

  • bg.predict: fill colour of prediction intervals;

  • border.predict: border colour of prediction intervals.

Each element defaults to NULL, with colours determined automatically from the layout and plotting symbol.

Argument type defaults to "square". Available values are "square", "diamond", "circle", and "squarediamond".

See Also

forest.meta, metacum, settings.meta

Examples

Run this code
data(Fleiss1993bin)
ma <- metabin(d.asp, n.asp, d.plac, n.plac,
  data = Fleiss1993bin, studlab = study, sm = "RR", method = "I")
ma
metacum(ma)
metacum(ma, pooled = "random")

forest(metacum(ma))
forest(metacum(ma, pooled = "random"))
forest(metacum(ma, pooled = "random", prediction = TRUE))

Run the code above in your browser using DataLab