cumul | R Documentation |
Function to carry out a ‘cumulative meta-analysis’, by repeatedly fitting the specified model adding one study at a time. \loadmathjax
cumul(x, ...)
## S3 method for class 'rma.uni'
cumul(x, order, digits, transf, targs, collapse=FALSE, progbar=FALSE, ...)
## S3 method for class 'rma.mh'
cumul(x, order, digits, transf, targs, collapse=FALSE, progbar=FALSE, ...)
## S3 method for class 'rma.peto'
cumul(x, order, digits, transf, targs, collapse=FALSE, progbar=FALSE, ...)
x |
an object of class |
order |
optional argument to specify a variable based on which the studies will be ordered for the cumulative meta-analysis. |
digits |
optional integer to specify the number of decimal places to which the printed results should be rounded. If unspecified, the default is to take the value from the object. |
transf |
optional argument to specify a function to transform the model coefficients and interval bounds (e.g., |
targs |
optional arguments needed by the function specified under |
collapse |
logical to specify whether studies with the same value of the |
progbar |
logical to specify whether a progress bar should be shown (the default is |
... |
other arguments. |
For "rma.uni"
objects, the model specified via x
must be a model without moderators (i.e., either an equal- or a random-effects model).
If argument order
is not specified, the studies are added according to their order in the original dataset.
When a variable is specified for order
, the variable is assumed to be of the same length as the original dataset that was used in the model fitting (and if the data
argument was used in the original model fit, then the variable will be searched for within this data frame first). Any subsetting and removal of studies with missing values that was applied during the model fitting is also automatically applied to the variable specified via the order
argument.
By default, studies are added one at a time. However, if a variable is specified for the order
argument and collapse=TRUE
, then studies with the same value of the order
variable are added simultaneously.
An object of class c("list.rma","cumul.rma")
. The object is a list containing the following components:
k |
number of studies included in the analysis. |
estimate |
estimated (average) outcomes. |
se |
corresponding standard errors. |
zval |
corresponding test statistics. |
pval |
corresponding p-values. |
ci.lb |
lower bounds of the confidence intervals. |
ci.ub |
upper bounds of the confidence intervals. |
Q |
test statistics for the test of heterogeneity. |
Qp |
corresponding p-values. |
tau2 |
estimated amount of heterogeneity (only for random-effects models). |
I2 |
values of \mjseqnI^2. |
H2 |
values of \mjseqnH^2. |
order |
values of the |
... |
other arguments. |
When the model was fitted with test="t"
, test="knha"
, test="hksj"
, or test="adhoc"
, then zval
is called tval
in the object that is returned by the function.
The object is formatted and printed with the print
function. To format the results as a data frame, one can use the as.data.frame
function. A forest plot showing the results from the cumulative meta-analysis can be obtained with forest
. Alternatively, plot
can also be used to visualize the results.
When using the transf
option, the transformation is applied to the estimated coefficients and the corresponding interval bounds. The standard errors are then set equal to NA
and are omitted from the printed output.
Wolfgang Viechtbauer (wvb@metafor-project.org, https://www.metafor-project.org).
Chalmers, T. C., & Lau, J. (1993). Meta-analytic stimulus for changes in clinical trials. Statistical Methods in Medical Research, 2(2), 161–172. https://doi.org/10.1177/096228029300200204
Lau, J., Schmid, C. H., & Chalmers, T. C. (1995). Cumulative meta-analysis of clinical trials builds evidence for exemplary medical care. Journal of Clinical Epidemiology, 48(1), 45–57. https://doi.org/10.1016/0895-4356(94)00106-z
Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1–48. https://doi.org/10.18637/jss.v036.i03
forest
for a function to draw cumulative forest plots and plot
for a different visualization of the cumulative results.
### calculate log risk ratios and corresponding sampling variances
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg,
data=dat.bcg, slab=paste0(author, ", ", year))
### fit random-effects model
res <- rma(yi, vi, data=dat, digits=3)
### cumulative meta-analysis (in the order of publication year)
cumul(res, order=year)
cumul(res, order=year, transf=exp)
### add studies with the same publication year simultaneously
cumul(res, order=year, transf=exp, collapse=TRUE)
### meta-analysis of the (log) risk ratios using the Mantel-Haenszel method
res <- rma.mh(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg,
data=dat.bcg, slab=paste0(author, ", ", year), digits=3)
### cumulative meta-analysis
cumul(res, order=year)
cumul(res, order=year, transf=exp)
### add studies with the same publication year simultaneously
cumul(res, order=year, transf=exp, collapse=TRUE)
### meta-analysis of the (log) odds ratios using Peto's method
res <- rma.peto(ai=tpos, bi=tneg, ci=cpos, di=cneg,
data=dat.bcg, slab=paste0(author, ", ", year), digits=3)
### cumulative meta-analysis
cumul(res, order=year)
cumul(res, order=year, transf=exp)
### add studies with the same publication year simultaneously
cumul(res, order=year, transf=exp, collapse=TRUE)
### make the first log risk ratio missing and fit the model without study 2;
### then the variable specified via 'order' should still be of the same length
### as the original dataset; subsetting and removal of studies with missing
### values is automatically done by the cumul() function
dat$yi[1] <- NA
res <- rma(yi, vi, data=dat, subset=-2, digits=3)
cumul(res, transf=exp, order=year)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.