Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.cumul.rma

Plot Method for 'cumul.rma' Objects


Description

Plot method for objects of class "cumul.rma".

Usage

## S3 method for class 'cumul.rma'
plot(x, yaxis="tau2", xlim, ylim, xlab, ylab,
     at, transf, atransf, targs, digits, cols=c("gray90","gray10"),
     addgrid=TRUE, pch=19, cex=1, lwd=2, ...)

Arguments

x

an object of class "cumul.rma".

yaxis

either "tau2", "I2", or "H2" to indicate what values should be placed on the y-axis. See ‘Details’.

xlim

x-axis limits. If unspecified, the function tries to set the x-axis limits to some sensible values.

ylim

y-axis limits. If unspecified, the function tries to set the y-axis limits to some sensible values.

xlab

title for the x-axis. If unspecified, the function tries to set an appropriate axis title.

ylab

title for the y-axis. If unspecified, the function tries to set an appropriate axis title.

at

position of the x-axis tick marks and corresponding labels. If unspecified, the function tries to set the tick mark positions/labels to some sensible values.

transf

optional argument specifying the name of a function that should be used to transform the summary estimates (e.g., transf=exp; see also transf). If unspecified, no transformation is used.

atransf

optional argument specifying the name of a function that should be used to transform the x-axis labels (e.g., atransf=exp; see also transf). If unspecified, no transformation is used.

targs

optional arguments needed by the function specified via transf or atransf.

digits

integer specifying the number of decimal places to which the tick mark labels of the x- and y-axis should be rounded. Can also be a vector of two integers, the first specifying the number of decimal places for the x-axis, the second for the y-axis labels (e.g., c(2,3)). If unspecified, the function tries to set the argument to some sensible values.

cols

vector with two or more colors to use for indicating the order of the cumulative results.

addgrid

logical specifying whether a grid should be added to the plot (the default is TRUE).

pch

plotting symbol to use. By default, a solid circle is used. See points for other options.

cex

symbol expansion factor.

lwd

line width.

...

other arguments.

Details

The function is meant to be used for cumulative random-effects models results as obtained with the cumul.rma.uni function.

By default, the plot shows the model estimate on the x-axis and the corresponding estimate of τ² on the y-axis in the cumulative order of the results in the "cumul.rma" object. Alternatively, one can also place the value of (yaxis="I2") or (yaxis="H2") on the y-axis.

The color gradient of the points/lines indicates the order of the cumulative results (by default, light gray at the beginning, dark gray at the end). A different set of colors can be chosen via the cols argument. See ‘Examples’.

Author(s)

References

Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1–48. https://www.jstatsoft.org/v036/i03.

See Also

Examples

### calculate log risk ratios and corresponding sampling variances
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)

### random-effects model
res <- rma(yi, vi, data=dat)

### cumulative meta-analysis (in the order of publication year)
sav <- cumul(res, transf=exp, order=order(dat$year))

### plot of model estimate and tau^2 over time
plot(sav)

### illustrate some other plot options
plot(sav, yaxis="I2", ylim=c(0,100), atransf=exp, at=log(seq(1.3, 1.6, by=.1)),
     lwd=5, cex=0, cols=c("green","blue","red"))

metafor

Meta-Analysis Package for R

v2.4-0
GPL (>= 2)
Authors
Wolfgang Viechtbauer [aut, cre] (<https://orcid.org/0000-0003-3463-4063>)
Initial release
2020-03-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.