forest.netmeta: Forest plot for network meta-analysis

View source: R/forest.netmeta.R

forest.netmetaR Documentation

Forest plot for network meta-analysis

Description

Draws a forest plot in the active graphics window (using grid graphics system).

Usage

## S3 method for class 'netmeta'
forest(
  x,
  pooled = ifelse(x$random, "random", "common"),
  reference.group = x$reference.group,
  baseline.reference = x$baseline.reference,
  labels = x$trts,
  equal.size = TRUE,
  leftcols = "studlab",
  leftlabs,
  rightcols = c("effect", "ci"),
  rightlabs,
  digits = gs("digits.forest"),
  small.values = x$small.values,
  nsim = 1000,
  digits.prop = 2,
  smlab = NULL,
  sortvar = x$seq,
  backtransf = x$backtransf,
  lab.NA = ".",
  add.data,
  drop.reference.group = FALSE,
  col.by = "black",
  print.subgroup.name = FALSE,
  ...
)

## S3 method for class 'netmeta'
plot(x, ...)

Arguments

x

An object of class netmeta.

pooled

A character string indicating whether results for the common ("common") or random effects model ("random") should be plotted. Can be abbreviated.

reference.group

Reference treatment(s).

baseline.reference

A logical indicating whether results should be expressed as comparisons of other treatments versus the reference treatment (default) or vice versa.

labels

An optional vector with treatment labels.

equal.size

A logical indicating whether all squares should be of equal size. Otherwise, the square size is proportional to the precision of estimates.

leftcols

A character vector specifying columns to be plotted on the left side of the forest plot or a logical value (see Details).

leftlabs

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

rightcols

A character vector specifying columns to be plotted on the right side of the forest plot or a logical value (see Details).

rightlabs

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

digits

Minimal number of significant digits for treatment effects and confidence intervals, see print.default.

small.values

A character string specifying whether small treatment effects indicate a beneficial ("desirable") or harmful ("undesirable") effect, can be abbreviated; see netrank.

nsim

Number of simulations to calculate SUCRAs.

digits.prop

Minimal number of significant digits for P-scores, SUCRAs and direct evidence proportions, see print.default and netrank.

smlab

A label printed at top of figure. By default, text indicating either common or random effects model is printed.

sortvar

An optional vector used to sort treatments (must be of same length as the total number of treatments).

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.

lab.NA

A character string to label missing values.

add.data

An optional data frame with additional columns to print in forest plot (see Details).

drop.reference.group

A logical indicating whether the reference group should be printed in the forest plot.

col.by

The colour to print information on subgroups.

print.subgroup.name

A logical indicating whether the name of the grouping variable should be printed in front of the group labels.

...

Additional arguments for forest.meta function.

Details

A forest plot, also called confidence interval plot, is drawn in the active graphics window.

Argument sortvar can be either a numeric or character vector with length of number of treatments. If sortvar is numeric the order function is utilised internally to determine the order of values. If sortvar is character it must be a permutation of the treatment names. It is also possible to provide either sortvar = Pscore, sortvar = "Pscore", sortvar = -Pscore, or sortvar = "-Pscore" in order to sort treatments according to the ranking generated by netrank which is called internally. It is also possible to use "SUCRA" instead of "Pscore". Similar expressions are possible to sort by treatment comparisons (sortvar = TE, etc.), standard error (sortvar = seTE), number of studies with direct treatment comparisons (sortvar = k), and direct evidence proportion (sortvar = prop.direct, see also netmeasures).

The arguments leftcols and rightcols can be used to specify columns which are plotted on the left and right side of the forest plot, respectively. The following columns are available:

Name Definition
"studlab" Treatments
"TE" Network estimates (either from common or random effects model)
"seTE" Corresponding standard errors
"Pscore" P-scores (see netrank)
"SUCRA" SUCRAs (see netrank)
"n.trts" Number of participants per treatment arm
"k" Number of studies in pairwise comparisons
"prop.direct" Direct evidence proportions (see netmeasures)
"effect" (Back-transformed) network estimates
"ci" Confidence intervals
"effect.ci" (Back-transformed) network estimates and confidence intervals

As a sidenote, the rather odd column name "studlab" to describe the treatment comparisons comes from internally calling forest.meta which uses study labels as the essential information.

Argument add.data can be used to add additional columns to the forest plot. This argument must be a data frame with row names equal to the treatment names in R object x, i.e., x$trts.

See help page of forest.meta for more information on the generation of forest plots and additional arguments.

Author(s)

Guido Schwarzer guido.schwarzer@uniklinik-freiburg.de

See Also

forest.meta

Examples

data(smokingcessation)

# Transform data from arm-based format to contrast-based format
#
p1 <- pairwise(list(treat1, treat2, treat3),
  event = list(event1, event2, event3), n = list(n1, n2, n3),
  data = smokingcessation, sm = "OR")

# Conduct random effects network meta-analysis
#
net1 <- netmeta(p1, common = FALSE)

forest(net1)

## Not run: 
data(Senn2013)

# Conduct network meta-analysis
#
net2 <- netmeta(TE, seTE, treat1, treat2, studlab,
  data = Senn2013, sm = "MD")

forest(net2, ref = "plac")
forest(net2, xlim = c(-1.5, 1), ref = "plac",
  xlab = "HbA1c difference", rightcols = FALSE)

# Random effects effect model
#
net3 <- netmeta(TE, seTE, treat1, treat2, studlab,
  data = Senn2013, sm = "MD", common = FALSE)

forest(net3, xlim = c(-1.5, 1), ref = "plac",
  xlab = "HbA1c difference")

# Add column with P-Scores on right side of forest plot
#
forest(net3, xlim = c(-1.5, 1), ref = "plac",
  xlab = "HbA1c difference",
  rightcols = c("effect", "ci", "Pscore"),
  just.addcols = "right")

# Add column with P-Scores on left side of forest plot
#
forest(net3, xlim = c(-1.5, 1), ref = "plac",
  xlab = "HbA1c difference",
  leftcols = c("studlab", "Pscore"),
  just.addcols = "right")

# Sort forest plot by descending P-Score
#
forest(net3, xlim = c(-1.5, 1), ref = "plac",
  xlab = "HbA1c difference",
  rightcols = c("effect", "ci", "Pscore"),
  just.addcols = "right",
  sortvar = -Pscore)

# Drop reference group and sort by and print number of studies with
# direct treatment comparisons
#
forest(net3, xlim = c(-1.5, 1), ref = "plac",
  xlab = "HbA1c difference",
  leftcols = c("studlab", "k"),
  leftlabs = c("Contrast\nto Placebo", "Direct\nComparisons"),
  sortvar = -k,
  drop = TRUE,
  smlab = "Random Effects Model")

## End(Not run)


netmeta documentation built on June 23, 2024, 9:06 a.m.