View source: R/forest.metabind.R
| forest.metabind | R Documentation |
Draws a forest plot combining common effect estimates, random effects estimates, and prediction intervals from a metabind object.
## S3 method for class '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,
...
)
x |
An object of class |
layout |
Layout of the forest plot; see |
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, |
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 |
hetstat |
Ignored when meta-analyses have no subgroup results; use
|
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
|
col, print, type, text, digits |
Named lists controlling colours, displayed
information, graphical types, model text. Scalar values are also accepted
for |
leftcols, rightcols |
Columns printed to the left or right of the
forest plot; see |
leftlabs, rightlabs |
Column headings. Use |
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 |
irscale |
A numeric defining a scaling factor for printing of
single incidence rates or incidence rate differences
(see |
irunit |
A character specifying the time unit used to
calculate rates, e.g., person-years (see |
scientific.pval, zero.pval, JAMA.pval |
Logical values controlling
the formatting of P values (see |
details |
A logical specifying whether method details are printed.
Defaults to |
... |
Additional arguments passed to |
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.
Unless listed below, defaults for supported formatting elements are
described in meta-formatting.
| Element | Default |
print$stat, print$pval | Automatic |
print$I2, print$pval.Q | See below |
print$I2.ci, print$Q | FALSE |
print$subgroup.name | FALSE |
type$common, type$random | NULL (automatic) |
digits$pval | max(gs("digits.pval") - 2, 2) |
digits$pval.Q | max(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.
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.
Guido Schwarzer guido.schwarzer@uniklinik-freiburg.de
metabind, print.metabind,
forest.meta
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)
## Not run:
# 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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.