netmeta (version 0.9-5)

forest.netmeta: Forest plot

Description

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

Usage

# S3 method for netmeta
forest(x,
       pooled=ifelse(x$comb.random, "random", "fixed"),
       reference.group=x$reference.group,
       leftcols="studlab", leftlabs="Treatment",
       rightcols=c("effect", "ci"), rightlabs=NULL,
       digits=gs("digits.forest"), small.values="good", digits.Pscore=2,
       smlab=NULL,
       sortvar=x$seq, lab.NA=".", add.data,
       drop.reference.group = FALSE,
       ...)

Arguments

x

An object of class netmeta.

reference.group

Reference group.

pooled

A character string indicating whether results for the 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).

rightcols

A character vector specifying (additional) columns to be plotted on the right side of the forest plot or a logical value (see forest.meta help page for details).

rightlabs

A character vector specifying labels for (additional) columns on right side of the forest plot (see forest.meta help page for 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 ("good") or harmful ("bad") effect, can be abbreviated; see netrank.

digits.Pscore

Minimal number of significant digits for P-score, see print.default and netrank.

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

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.

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

Argument add.data can be used to add additional columns to the forest plot. This argument must be a data frame with the same row names as the treatment effects matrices in R object x, i.e., x$TE.fixed or x$TE.random.

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

See Also

forest.meta

Examples

Run this code
# NOT RUN {
data(Senn2013)

# }
# NOT RUN {
#
# 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=FALSE,
       leftlabs="Contrast to placebo")
# }
# NOT RUN {
#
# 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",
       leftlabs="Contrast to placebo")

#
# Add column with P-Scores on right side of forest plot
#
forest(net2, xlim=c(-1.5,1), ref="plac",
       xlab="HbA1c difference",
       leftcols="studlab",
       leftlabs="Contrast to placebo",
       rightcols=c("effect", "ci", "Pscore"),
       rightlabs="P-Score",
       just.addcols="right")

# }
# NOT RUN {
#
# Add column with P-Scores on left side of forest plot
#
forest(net2, xlim=c(-1.5,1), ref="plac",
       xlab="HbA1c difference",
       leftcols=c("studlab", "Pscore"),
       leftlabs=c("Contrast to placebo", "P-Score"),
       just.addcols="right")

#
# Sort forest plot by descending P-Score
#
forest(net2, xlim=c(-1.5,1), ref="plac",
       xlab="HbA1c difference",
       leftcols="studlab",
       leftlabs="Contrast to placebo",
       rightcols=c("effect", "ci", "Pscore"),
       rightlabs="P-Score",
       just.addcols="right",
       sortvar=-Pscore)
# }
# NOT RUN {
#
# Drop reference group and sort by and print number of studies
# with direct treatment comparisons
#
forest(net2, 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)
# }

Run the code above in your browser using DataLab