Learn R Programming

netmeta (version 0.7-0)

forest.netmeta: Forest plot

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$comb.random, "random", "fixed"),
       reference.group=x$reference.group,
       leftcols="studlab",
       leftlabs="Treatment",
       smlab=NULL,
       sortvar=x$seq,
       ...)

Arguments

x
An object of class netmeta.
reference.group
Reference group.
pooled
A character string indicating whether results for fixed effect ("fixed") or random effects model ("random") should be plotted. Can be abbreviated.
leftcols
A character vector specifying (additional) columns to be plotted on the left side of the forest plot or a logical value (see forest.meta help page for details).
leftlabs
A character vector specifying labels for (additional) columns on left side of the forest plot (see forest.meta help page for details).
smlab
A label printed at top of figure. By default, text indicating either fixed effect or random effects model is printed.
sortvar
An optional vector used to sort the individual studies (must be of same length as the total number of treatments).
...
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. 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.

For more information see help page of forest.meta function.

See Also

forest.meta

Examples

Run this code
data(Senn2013)

##
## Fixed effect model (default)
##
net1 <- netmeta(TE, seTE, treat1, treat2, studlab,
                data=Senn2013, sm="MD")

forest(net1, ref="plac")

forest(net1, xlim=c(-1.5,1), ref="plac",
       xlab="HbA1c difference",
       leftcols="studlab", rightcols=NULL,
       leftlabs="Contrast to placebo")

##
## Random effects effect model
##
net2 <- netmeta(TE, seTE, treat1, treat2, studlab,
                data=Senn2013, sm="MD", comb.random=TRUE)

forest(net2, xlim=c(-1.5,1), ref="plac",
       xlab="HbA1c difference",
       leftcols="studlab", rightcols=NULL,
       leftlabs="Contrast to placebo")

Run the code above in your browser using DataLab