Learn R Programming

meta (version 9.0-0)

meta-formatting: Formatting arguments for printouts and forest plots

Description

Formatting arguments for printouts and forest plots.

Arguments

Details

Formatting arguments for printouts can be provided in the following named lists, with availability shown below:

print, digits.

Furthermore, formatting arguments for forest plots can be provided in the following named lists:

test, label, rob, fs, ff, just, fill, col, print, type, pooled, text, lty, lwd, digits, calcwidth, colgap, cid, addrow.

List elements available in these named lists are described in the following subsections.

The corresponding individual arguments are also supported. Their names are formed by combining the list name and element name, such as fs.main or col.diamond. Supplying the same setting both as a list element and as an individual argument is an error, even if the values agree.

In forest.meta, the primary value can also be supplied directly without wrapping it in a named list for addrow, cid, colgap, digits, fill, just, and lwd. The rob argument also accepts a risk-of-bias assessment directly.

In forest.metacum or forest.metainf, the primary value can also be supplied directly without wrapping it in a named list for col and digits. A scalar digits in print methods sets digits$digits, except in print.cidprop, where it sets digits$cid.

Most individual arguments can also be set globally through settings.meta. The corresponding defaults are then used by the named lists.

Function keys in the tables:

M

forest.meta.

B

forest.metabind.

C

forest.metacum and forest.metainf.

P

print.metabind.

N

print.meta and print.summary.meta.

S

print.summary.meta only.

R

print.metacum and print.metainf.

D

print.cidprop.

L

print.blup.meta; also print.estimates.blup.meta for digits.

A star, as in B* or C*, denotes forwarding through ... to forest.meta. Unmarked keys indicate direct processing; C uses the same implementation for both methods.

Availability does not imply that every setting affects every plot: forwarded arguments remain subject to the wrapper's documented restrictions and the results displayed. In particular, C supplies study symbols and disables overall-effect tests; B does not provide tests between input meta-analyses and fixes pooled.totals = FALSE.

Each subsection first describes elements and availability, then gives one table of general defaults. For elements supported by M, native forest.meta defines the baseline; other elements have the general defaults shown. Individual function documentation describes exceptions. Named-list and individual arguments use the same defaults.

gs("name") denotes the current setting from settings.meta, x the object supplied, and other names the corresponding function arguments. Defaults depending on the object, layout, or displayed results are indicated as such; NULL can request automatic selection rather than suppress output. In default tables, * stands for the element name in a setting or object field. CI denotes a confidence interval; CID denotes a clinically important difference.

Tests (test.*)

Logical values control whether the corresponding tests are printed.

ElementDescriptionFunctions
overallOverall effectsM, B
overall.commonCommon effect modelM, B
overall.randomRandom effects modelM, B
subgroupSubgroup differencesM, B, C*, N
subgroup.commonCommon-effect differencesM, B, C*, N
subgroup.randomRandom-effects differencesM, B, C*, N
effect.subgroupEffects within subgroupsM, B, C*
effect.subgroup.commonCommon subgroup effectsM, B, C*
effect.subgroup.randomRandom subgroup effectsM, B, C*

ElementGeneral default
overallAutomatic (see below)
overall.commonAutomatic (see below)
overall.randomAutomatic (see below)
subgroupAutomatic (see below)
subgroup.commonAutomatic (see below)
subgroup.randomAutomatic (see below)
effect.subgroupgs("test.effect.subgroup")
effect.subgroup.commonNULL (automatic)
effect.subgroup.randomNULL (automatic)

The overall-test default is gs("test.overall"); if NULL, it is TRUE for BMJ, RevMan5, JAMA, and meta (default) layouts, and FALSE otherwise. Model-specific defaults also depend on common, random, and overall. Subgroup tests default to x$test.subgroup, or TRUE if NULL; model-specific defaults also depend on common and random. C fixes overall-effect tests to FALSE; do not supply these elements. In print.meta, test supports only subgroup, subgroup.common, and subgroup.random. These settings can also be passed through print.summary.meta.

Labels (label.*)

Labels identify groups, attached study-data columns, graph regions, column headings, and test results.

ElementDescriptionFunctions
eExperimental groupM, B, C*
cControl groupM, B, C*
e.attachAttached experimental columnM, B, C*
c.attachAttached control columnM, B, C*
left, rightEither side of null effectM, B, C*
n, eventsSample sizes / eventsM, B, C*
mean, sdMean / standard deviationM, B, C*
corCorrelationM, B, C*
time, pvalTime / p-valueM, B, C*
tau2, tau, I2HeterogeneityM, B, C*
clusterCluster variableM, B, C*
cyclesCycle countM, B, C*
test.overall.commonOverall common-effect testM, B, C*
test.overall.randomOverall random-effects testM, B, C*
test.subgroup.commonCommon subgroup testM, B, C*
test.subgroup.randomRandom subgroup testM, B, C*
test.effect.subgroup.commonCommon subgroup-effect testM, B, C*
test.effect.subgroup.randomRandom subgroup-effect testM, B, C*

ElementGeneral default
e, cCorresponding x$label.* value
left, rightCorresponding x$label.* value
e.attach, c.attachCorresponding gs("label.*") setting
n, eventsCorresponding gs("label.*") setting
mean, sdCorresponding gs("label.*") setting
cor, timeCorresponding gs("label.*") setting
pval, tau2Corresponding gs("label.*") setting
tau, I2Corresponding gs("label.*") setting
cluster, cyclesCorresponding gs("label.*") setting
All test.* elementsNULL (test-specific labels)

Risk-of-bias settings (rob.*)

In forest.meta, settings for risk-of-bias assessments can be supplied in the named list rob.

ElementDescriptionFunctions
robRisk-of-bias assessmentM, B*, C*
textTable headingM, B*, C*
legendDomain legendM, B*, C*
onlyRisk of bias alone on rightM, B*, C*

ElementGeneral default
robx$rob
text"Risk of Bias"
legendTRUE
onlyFALSE

Font sizes (fs.*) and font faces (ff.*)

Numeric font sizes, in points. The corresponding elements can be supplied in the named list fs. Font faces accepted by gpar, such as "plain", "bold", and "italic". The corresponding elements can be supplied in the named list ff.

Both lists can contain the following elements:

ElementDescriptionFunctions
main, headingTitle / column headingsM, B*, C*
common, randomPooled resultsM, B*, C*
predictPrediction intervalsM, B*, C*
common.labelsCommon-effect labelsM, B*, C*
random.labelsRandom-effects labelsM, B*, C*
predict.labelsPrediction-interval labelsM, B*, C*
studyStudy resultsM, B*, C*
study.labelsStudy labelsM, B*, C*
hetstatHeterogeneity statisticsM, B*, C*
test.overallOverall-effect testsM, B*, C*
test.subgroupSubgroup-difference testsM, B*, C*
test.effect.subgroupSubgroup-effect testsM, B*, C*
addlineAdditional linesM, B*, C*
axisAxis textM, B*, C*
smlabSummary measureM, B*, C*
xlabx-axis labelM, B*, C*
lrLeft / right labelsM, B*, C*
robRisk-of-bias textM, B*, C*
rob.symbolsRisk-of-bias symbolsM, B*, C*
detailsMethod detailsM, B*, C*

ElementSize default (fs)Face default (ff)
headingfontsize"bold"
study, study.labelsfontsize"plain"
smlab, xlabfontsizeCorresponding gs("ff.*") setting
lrfontsizegs("ff.lr")
axisfontsize - 1gs("ff.axis")
detailsfontsize - 1"plain"
robgs("fs.rob")"plain"
rob.symbolsgs("fs.rob.symbols")"bold"
Remaining elementsgs("fs.*")gs("ff.*")

Justifications (just.*)

Possible values are "left", "right", and "center".

ElementDescriptionFunctions
justOrdinary columnsM, B*, C*
mainMain titleM, B*, C*
studlabStudy labelsM, B*, C*
addcolsAdditional columnsM, B*
addcols.leftLeft additional columnsM, B*, C*
addcols.rightRight additional columnsM, B*, C*
label.e, label.cGroup headingsM, B*, C*
robRisk-of-bias columnsM, B*, C*

ElementGeneral default
just"left" for JAMA, otherwise "right"
label.e, label.c"left" for JAMA, otherwise "right"
main, studlabCorresponding gs("just.*") setting
addcolsgs("just.addcols")
addcols.left, addcols.rightgs("just.addcols")
rob"left"

C fixes just.addcols = "right"; do not supply just$addcols.

Fill settings (fill.*)

Colours used to fill plot regions and symbols.

ElementDescriptionFunctions
fillGeneral fillM, B*, C*
cidCID regionsM, B*, C*
cid.below.nullCID below null effectM, B*, C*
cid.above.nullCID above null effectM, B*, C*
equiBetween equivalence limitsM, B*, C*
lower.equiLower limit to null effectM, B*, C*
upper.equiNull effect to upper limitM, B*, C*

ElementGeneral default
fillgs("fill")
cid, cid.below.nullgs("fill.cid")
cid.above.nullrev(gs("fill.cid"))
equi, lower.equigs("fill.equi")
upper.equirev(gs("fill.equi"))

Colours (col.*)

Colour values used for plot elements. Vectors can be supplied when colours differ between subgroups or rows.

ElementDescriptionFunctions
mainMain titleM, B*
commonCommon effectM, B*
randomRandom effectsM, B*
cidDecision linesM, B*
labelAxis labelsM, B*
label.left, label.rightLeft / right labelsM, B*
study, study.textStudy textM, B*
square, square.linesSquare fill / borderM, B
circle, circle.linesCircle fill / borderM, B
insideInside study symbolsM, B*
inside.commonInside common symbolsM, B*
inside.randomInside random symbolsM, B*
diamondDiamond fillM, B
diamond.commonCommon diamond fillM, B
diamond.randomRandom diamond fillM, B
diamond.common.subgroupCommon subgroup fillM, B*
diamond.random.subgroupRandom subgroup fillM, B*
diamond.linesDiamond borderM, B
diamond.lines.commonCommon diamond borderM, B
diamond.lines.randomRandom diamond borderM, B
diamond.lines.common.subgroupCommon subgroup borderM, B*
diamond.lines.random.subgroupRandom subgroup borderM, B*
predictPrediction-interval fillM, B
predict.linesPrediction-interval borderM, B
predict.subgroupSubgroup prediction fillM, B*
predict.lines.subgroupSubgroup prediction borderM, B*
subgroupSubgroup textM, B*
lines, header.linePlot / header linesM, B*
jama.lineJAMA linesM, B*
colSquare resultsC
bgSymbol fillC
borderSymbol borderC
bg.predictPrediction-interval fillC
border.predictPrediction-interval borderC

ElementGeneral default
main, commonCorresponding gs("col.*") setting
random, cidCorresponding gs("col.*") setting
label, studyCorresponding gs("col.*") setting
study.text, squareCorresponding gs("col.*") setting
square.lines, circleCorresponding gs("col.*") setting
circle.linesgs("col.circle")
insidegs("col.inside")
inside.common, inside.randomgs("col.inside")
diamond, diamond.commongs("col.diamond")
diamond.randomgs("col.diamond")
diamond.common.subgroupgs("col.diamond")
diamond.random.subgroupgs("col.diamond")
diamond.linesgs("col.diamond.lines")
diamond.lines.commongs("col.diamond.lines")
diamond.lines.randomgs("col.diamond.lines")
diamond.lines.common.subgroupgs("col.diamond.lines")
diamond.lines.random.subgroupgs("col.diamond.lines")
predict, predict.subgroupgs("col.predict")
predict.lines, predict.lines.subgroupgs("col.predict.lines")
subgroup, jama.linegs("col.subgroup")
lines, header.linegs("col.lines")
label.leftx$col.label.left
label.rightx$col.label.right
col, bgNULL
borderNULL
bg.predict, border.predictNULL

B processes its own colour elements and forwards other native elements; C uses only its alternative elements.

Printing results (print.*)

Logical settings controlling displayed results, columns, and labels.

ElementDescriptionFunctions
I2, I2.ciI-squared / CIM, B, C, P, N, R
tau2Tau-squaredM, B, C, P, N, R, L
tau2.ciTau-squared CIM, B, C, P, N, R
tauTauM, B, C, P, N, R, L
tau.ciTau CIM, B, C, P, N, R
QHeterogeneity statistic QM, B, C, P, N
pval.QHeterogeneity p-valueM, B, C, P
RbRb statisticM, N
Rb.ciRb CIM
statEffect z- or t-statisticM, B, C, P, R
pvalEffect p-valueB, C, P
Q.subgroupSubgroup-difference QM
tau2.ci.subgroupSubgroup tau-squared CIM
tau.ci.subgroupSubgroup tau CIM
subgroup.labelsSubgroup labelsM
subgroup.nameSubgroup variable nameM, B, P, N
CMHCochran-Mantel-Haenszel testN
probCID benefit / harm probabilityC, R
studlabMeta-analysis labelsB
typeResult typeB
funcAnalysis functionB, P
methodPooling methodB, P
method.intervalInterval methodB, P
method.tauTau-squared methodB
backtransfBack-transformation functionB, P
args.backtransfBack-transformation argumentsB, P
kNumber of studiesB, P
smSummary measureB, P
seStandard errorB, P
level.maPooled-effect CI levelB, P
level.predictPrediction levelB, P
level.hetstatHeterogeneity CI levelB, P
null.effectNull effectB, P
HH statisticB, P, N
H.ciH CIB, P
Q.bSubgroup-test statisticB, P
pval.Q.bSubgroup-test p-valueB, P

ElementGeneral default
I2, I2.ciCorresponding gs("forest.*") setting
tau2, tau2.ciCorresponding gs("forest.*") setting
tau, tau.ciCorresponding gs("forest.*") setting
Q, pval.QCorresponding gs("forest.*") setting
Rb, Rb.ciCorresponding gs("forest.*") setting
stat, Q.subgroupCorresponding gs("forest.*") setting
tau2.ci.subgroupgs("print.tau2.ci.subgroup")
tau.ci.subgroupgs("print.tau.ci.subgroup")
subgroup.labelsTRUE
subgroup.namex$print.subgroup.name
CMHx$print.CMH
studlab, kTRUE
pvalTRUE
se, null.effectFALSE
H, H.ciFALSE
probFALSE
type, funcNULL (automatic)
method, method.intervalNULL (automatic)
method.tau, backtransfNULL (automatic)
args.backtransf, smNULL (automatic)
level.ma, level.predictNULL (automatic)
level.hetstatNULL (automatic)
Q.b, pval.Q.bNULL (automatic)

Confidence-interval switches require the corresponding statistic. B and C use their own print lists; native-only elements are not a shared wrapper interface. Q.b and pval.Q.b refer to subgroup differences within each meta-analysis. In P, pval.Q.b controls the whole subgroup-test block, including the statistic and degrees of freedom; Q.b has no separate effect.

Graphical-type (type.*)

Character strings specifying how treatment effects and confidence intervals are plotted, such as "square", "diamond", or "circle".

ElementDescriptionFunctions
studyIndividual study resultsM
commonOverall common-effect resultsM, B
randomOverall random-effects resultsM, B
typeGeneral result symbolB
predictPrediction-interval symbolB
subgroupSubgroup resultsM
subgroup.commonCommon-effect subgroup resultsM
subgroup.randomRandom-effects subgroup resultsM

ElementGeneral default
studygs("type.study")
common, randomgs("type.common") for both
subgroupAutomatic (see below)
subgroup.commonAutomatic (see below)
subgroup.randomAutomatic (see below)
type, predictNULL (automatic)

Subgroup symbols default to "diamond" if study.results is TRUE, and "square" otherwise. C uses an ordinary character argument type, not a named list.

Pooled-results (pooled.*)

ElementDescriptionFunctions
totalsSample sizes / totalsM, C*
eventsEvent countsM, B*, C*
timesPerson-time totalsM, B*, C*

ElementGeneral default
totalscommon | random
eventsgs("pooled.events")
timesgs("pooled.times")

B fixes pooled.totals = FALSE; do not supply pooled$totals.

Text settings (text.*)

Character strings used for labels and explanatory text.

ElementDescriptionFunctions
commonCommon-effect labelM, B, C*
randomRandom-effects labelM, B, C*
w.commonCommon weight labelM, B, C*
w.randomRandom weight labelM, B, C*
predictPrediction-interval labelM, B, C*
subgroupSubgroup labelM, B, C*
common.wCommon subgroup labelM, B, C*
random.wRandom subgroup labelM, B, C*
predict.wSubgroup prediction labelM, B, C*
subgroup.nohetNo-heterogeneity textM, B, C*
addline1, addline2Additional linesM, B, C*

ElementGeneral default
common, randomCorresponding x$text.* value
w.common, w.randomCorresponding x$text.* value
predictx$text.predict
common.w, random.wx$text.common, x$text.random
predict.wx$text.predict
subgroupNULL
addline1, addline2NULL
subgroup.nohetgs("text.subgroup.nohet")

Line-type settings (lty.*)

ElementDescriptionFunctions
commonCommon-effect linesM, B*, C*
randomRandom-effects linesM, B*, C*
cidCID linesM, B*, C*

ElementGeneral default
common, randomCorresponding gs("lty.*") setting
cidgs("lty.cid")

Line-width settings (lwd.*)

ElementDescriptionFunctions
lwdGeneral line widthM, B*, C*
squareSquare bordersM, B*, C*
diamondDiamond bordersM, B*, C*

ElementGeneral default
lwdgs("lwd")
square, diamondgs("lwd.square"), gs("lwd.diamond")

Digits (digits.*)

The values specify the minimum number of significant digits.

ElementDescriptionFunctions
digitsTreatment effectsM, B, C, P, N, R, L
seStandard errorsM, B, P, S, L
statz- or t-statisticsM, B, C, P, N, R
pvalEffect p-valuesM, B, C, P, N, R
pval.QHeterogeneity p-valuesM, B, P, N
QHeterogeneity statistic QM, B, P, N
dfDegrees of freedomN
HH statisticN
tau2Between-study varianceM, B, C, P, N, R, L
tauBetween-study SDM, B, C, P, N, R, L
I2I-squared statisticM, B, C, P, N, R
weightStudy weightsM, B*, S
propProportionsS
mean, sdMeans / standard deviationsM, B*
cor, timeCorrelations / follow-upM, B*
n, eventSample sizes / eventsM, B*
TEAdditional treatment estimatesM, B*
addcolsAdditional columnsM, B*
addcols.leftLeft additional columnsM, B*
addcols.rightRight additional columnsM, B*
cidCID limitsC, R, D
percentPercentagesC, R, D

ElementGeneral default
digits, corgs("digits.forest")
time, addcolsgs("digits.forest")
addcols.left, addcols.rightgs("digits.forest")
se, statCorresponding gs("digits.*") setting
pval, pval.QCorresponding gs("digits.*") setting
Q, tau2Corresponding gs("digits.*") setting
df, HCorresponding gs("digits.*") setting
tau, I2Corresponding gs("digits.*") setting
weight, meanCorresponding gs("digits.*") setting
sdgs("digits.sd")
propgs("digits.prop")
n, event0
TEgs("digits.TE.forest")
cidgs("digits.cid")
percent1

Width calculation (calcwidth.*)

Logical arguments controlling whether generated text is included when calculating column widths.

ElementDescriptionFunctions
pooledPooled resultsM, B*, C*
commonCommon-effect textM, B*, C*
randomRandom-effects textM, B*, C*
predictPrediction-interval textM, B*, C*
hetstatHeterogeneity statisticsM, B*, C*
testsOverall / subgroup testsM, B*, C*
subgroupSubgroup labelsM, B*, C*
addlineAdditional linesM, B*, C*
detailsMethod detailsM, B*, C*

ElementGeneral default
pooledAutomatic (see below)
common, randomAutomatic (see below)
predict, hetstatCorresponding gs("calcwidth.*") setting
tests, subgroupCorresponding gs("calcwidth.*") setting
addline, detailsCorresponding gs("calcwidth.*") setting

Width calculation for pooled, common, and random text is enabled when either common or random is TRUE and either overall is TRUE or subgroup is non-NULL.

Column-gaps (colgap.*)

Gaps can be specified as character strings or grid::unit objects.

ElementDescriptionFunctions
colgapBetween columnsM, B*, C*
left, rightBetween left / right columnsM, B*, C*
studlabAfter study labelsM, B*, C*
forestBeside forest plotM, B*, C*
forest.leftBefore forest plotM, B*, C*
forest.rightAfter forest plotM, B*, C*
robBetween risk-of-bias columnsM, B*, C*
rob.overallBefore overall risk of biasM, B*, C*

ElementGeneral default
colgap, leftgs("colgap")
right, studlabgs("colgap")
forestgs("colgap.forest")
forest.left, forest.rightgs("colgap.forest")
rob"1mm"
rob.overall"2mm"

Clinically important difference settings (cid.*)

ElementDescriptionFunctions
cidCID / decision thresholdsM, B*, C*
below.nullLimits below null effectM, B*, C*
above.nullLimits above null effectM, B*, C*
pooled.onlyPooled estimates onlyM, B*, C*

ElementGeneral default
cidgs("cid")
below.null, above.nullCorresponding gs("cid.*") setting
pooled.onlygs("cid.pooled.only")

Additional-row settings (addrow.*)

ElementDescriptionFunctions
addrowEmpty row above studiesM, B*, C*
overallEmpty row above overall resultsM, B*, C*
subgroupEmpty row between subgroupsM, B*, C*

ElementGeneral default
addrowgs("addrow")
overallgs("addrow.overall")
subgroupgs("addrow.subgroups")

See Also

forest.meta, settings.meta, gpar

Examples

Run this code
data(Olkin1995)
ma1 <- metabin(ev.exp, n.exp, ev.cont, n.cont,
  data = Olkin1995, subset = c(41, 47, 51, 59),
  sm = "RR", method = "I",
  studlab = paste(author, year))

# Use individual arguments label.left to col.label.right
#
forest(ma1, layout = "RevMan5", common = FALSE, prediction = TRUE,
  label.left = "Favours experimental", label.right = "Favours control",
  col.label.left = "green", col.label.right = "red",
  main = "Use individual arguments")

if (FALSE) {
# Same forest plot using named lists label and col
#
forest(ma1, layout = "RevMan5", common = FALSE, prediction = TRUE,
  label = list(left = "Favours experimental", right = "Favours control"),
  col = list(label.left = "green", label.right = "red"),
  main = "Use named lists 'label' and 'col'")

# Same forest plot with a mixture
#
forest(ma1, layout = "RevMan5", common = FALSE, prediction = TRUE,
  label.left = "Favours experimental",
  col = list(label.left = "green"),
  label = list(right = "Favours control"),
  col.label.right = "red",
  main = "Use mixture of individual arguments and named lists")
}

Run the code above in your browser using DataLab