Learn R Programming

meta (version 9.0-0)

forest.metabind: Forest plot to display the results of several meta-analyses

Description

Draws a forest plot combining common effect estimates, random effects estimates, and prediction intervals from a metabind object.

Usage

# S3 method for metabind
forest(
  x,
  layout = gs("layout"),
  common = !is.null(x$common),
  random = !is.null(x$random),
  prediction = !is.null(x$predict),
  overall = common || random || prediction,
  studlab = NULL,
  subgroup = NULL,
  overall.hetstat = NULL,
  hetstat = !is.null(x$subgroup),
  backtransf = x$backtransf,
  test = NULL,
  label,
  col = NULL,
  print = NULL,
  type = NULL,
  text = NULL,
  digits = NULL,
  leftcols = NULL,
  rightcols = NULL,
  leftlabs = NULL,
  rightlabs = NULL,
  lab.NA = if (is.null(x$subgroup)) gs("lab.NA") else "",
  big.mark = gs("big.mark"),
  pscale = NULL,
  irscale = NULL,
  irunit = NULL,
  scientific.pval = gs("scientific.pval"),
  zero.pval = gs("zero.pval"),
  JAMA.pval = gs("JAMA.pval"),
  details = FALSE,
  ...
)

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 metabind.

layout

Layout of the forest plot; see forest.meta.

common, random, prediction

Logical values selecting common effect estimates, random effects estimates, and prediction intervals.

overall

A logical value indicating whether overall summaries should be plotted.

studlab

A variable containing labels for individual results, evaluated in the combined results data frame or supplied as an external vector. Available with or without subgroup results.

subgroup

For meta-analyses without subgroup results, a variable defining display groups, evaluated in the combined results data frame or supplied as an external vector. For example, subgroup = type groups results by common effect model, random effects model, or prediction interval. Unavailable when the included meta-analyses contain subgroup results.

overall.hetstat

Ignored when meta-analyses have no subgroup results. Otherwise, a logical value indicating whether to display a shared overall heterogeneity row. The default NULL determines this automatically from agreement of the overall results and heterogeneity.

hetstat

Ignored when meta-analyses have no subgroup results; use print to display heterogeneity information in columns. Otherwise, a logical value controlling separate heterogeneity rows, defaulting to TRUE. Setting FALSE suppresses all such rows, including the shared overall heterogeneity row.

backtransf

A logical indicating whether results should be back-transformed. Different summary measures require back-transformation.

test

A named list controlling statistical test rows.

label

A named list controlling column and test labels. Logical values or character vectors control the x-axis tick labels instead. See Details for defaults specific to this function and meta-formatting for information on the elements.

col, print, type, text, digits

Named lists controlling colours, displayed information, graphical types, model text. Scalar values are also accepted for type and digits. See Details for defaults specific to this function and meta-formatting for information on the elements.

leftcols, rightcols

Columns printed to the left or right of the forest plot; see forest.meta. Explicit column selections take precedence over automatic column selection.

leftlabs, rightlabs

Column headings. Use NA to retain a default heading.

lab.NA

Label for missing values.

big.mark

Character used as thousands separator.

pscale

A numeric giving scaling factor for printing of single event probabilities or risk differences (see metaprop).

irscale

A numeric defining a scaling factor for printing of single incidence rates or incidence rate differences (see metarate).

irunit

A character specifying the time unit used to calculate rates, e.g., person-years (see metarate).

scientific.pval, zero.pval, JAMA.pval

Logical values controlling the formatting of P values (see forest.meta).

details

A logical specifying whether method details are printed. Defaults to TRUE when the included meta-analyses contain subgroup results, and FALSE otherwise.

...

Additional arguments passed to forest.meta.

Author

Guido Schwarzer [email protected]

Details

When the included meta-analyses contain subgroup results, the forest plot groups these results by meta-analysis. Overall summaries are shared when the datasets and selected overall results agree; otherwise they are shown separately for each meta-analysis. Shared heterogeneity information additionally requires agreement of the heterogeneity values and settings.

Confidence and prediction intervals share a column. Heterogeneity information is shown once per included meta-analysis, with tau and tau-squared information also shown on its prediction interval rows when random effects results are selected. Tau and tau-squared information is not shown on common effect rows.

Back-transformations are applied separately using the settings stored for each meta-analysis, allowing results with different transformations to be displayed together.

Formatting defaults

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

ElementDefault
print$stat, print$pvalAutomatic
print$I2, print$pval.QSee below
print$I2.ci, print$QFALSE
print$subgroup.nameFALSE
type$common, type$randomNULL (automatic)
digits$pvalmax(gs("digits.pval") - 2, 2)
digits$pval.Qmax(gs("digits.pval.Q") - 2, 2)

Fill and border colours are determined automatically from the layout. They can be overridden using the following elements of the named list col:

  • square, square.lines: square fill and border;

  • circle, circle.lines: circle fill and border;

  • diamond, diamond.lines: diamond fill and border;

  • diamond.common, diamond.lines.common: common effect diamond fill and border;

  • diamond.random, diamond.lines.random: random effects diamond fill and border;

  • predict, predict.lines: prediction interval fill and border.

The named list print controls which columns are shown. Columns func, sm, method, and method.interval are selected automatically when their values differ between the displayed results. Heterogeneity-method columns method.tau, method.tau.ci, and method.I2 are selected similarly when the corresponding heterogeneity statistics are shown. Statistics and P values are shown when available, except in subgroup plots.

Without subgroup results, print$I2 defaults to FALSE, and print$pval.Q follows print$Q. With subgroup results, I-squared is shown by default. The global setting settings.meta(print.I2 = FALSE) suppresses it unless print$I2 is set explicitly. Element print$pval.Q defaults to TRUE for subgroup plots.

See Also

metabind, print.metabind, forest.meta

Examples

Run this code
data(Fleiss1993cont)

# Add some (fictitious) grouping variables:
#
Fleiss1993cont$age <- c(55, 65, 55, 65, 55)
Fleiss1993cont$region <- c("Europe", "Europe", "Asia", "Asia", "Europe")

ma <- metacont(n.psyc, mean.psyc, sd.psyc, n.cont, mean.cont, sd.cont,
  data = Fleiss1993cont, sm = "SMD")

# Conduct two subgroup analyses
#
ma1 <- update(ma, subgroup = age, subgroup.name = "Age group")
ma2 <- update(ma, subgroup = region, subgroup.name = "Region")

# Combine random effects subgroup meta-analyses and show forest
# plot with subgroup results
#
mb12 <- metabind(ma1, ma2, common = FALSE)
mb12
forest(mb12)

if (FALSE) {
# Use various estimation methods for between-study heterogeneity
# variance
#
ma.pm <- update(ma, method.tau = "PM")
ma.dl <- update(ma, method.tau = "DL")
ma.ml <- update(ma, method.tau = "ML")
ma.hs <- update(ma, method.tau = "HS")
ma.sj <- update(ma, method.tau = "SJ")
ma.he <- update(ma, method.tau = "HE")
ma.eb <- update(ma, method.tau = "EB")

# Combine meta-analyses and show results
#
taus <- c("Restricted maximum-likelihood estimator",
  "Paule-Mandel estimator",
  "DerSimonian-Laird estimator",
  "Maximum-likelihood estimator",
  "Hunter-Schmidt estimator",
  "Sidik-Jonkman estimator",
  "Hedges estimator",
  "Empirical Bayes estimator")
#
mb2 <- metabind(ma, ma.pm, ma.dl, ma.ml, ma.hs, ma.sj, ma.he, ma.eb,
  name = taus, common = FALSE)
mb2
forest(mb2)

# Return results for both common effect and random effects model
#
ma3 <- metagen(1:3, 3:1, sm = "md")
#
mb3 <- metabind(ma, update(ma, method.random.ci = "HK"))
mb3

# Meta-analysis model as subgroups
#
forest(mb, subgroup = type)
}

Run the code above in your browser using DataLab