cumul.Rd
Function to carry out a ‘cumulative meta-analysis’, by repeatedly fitting the specified model adding one study at a time.
cumul(x, ...)
# S3 method for rma.uni
cumul(x, order, digits, transf, targs, progbar=FALSE, ...)
# S3 method for rma.mh
cumul(x, order, digits, transf, targs, progbar=FALSE, ...)
# S3 method for rma.peto
cumul(x, order, digits, transf, targs, progbar=FALSE, ...)
an object of class "rma.uni"
, "rma.mh"
, or "rma.peto"
.
optional argument to specify a variable based on which the studies will be ordered for the cumulative meta-analysis.
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.
optional argument to specify a function to transform the model coefficients and interval bounds (e.g., transf=exp
; see also transf). If unspecified, no transformation is used.
optional arguments needed by the function specified under transf
.
logical to specify whether a progress bar should be shown (the default is FALSE
).
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. See ‘Examples’.
An object of class c("list.rma","cumul.rma")
. The object is a list containing the following components:
estimated (average) outcomes.
corresponding standard errors.
corresponding test statistics.
corresponding p-values.
lower bounds of the confidence intervals.
upper bounds of the confidence intervals.
test statistics for the test of heterogeneity.
corresponding p-values.
estimated amount of heterogeneity (only for random-effects models).
values of \(I^2\).
values of \(H^2\).
other arguments.
When the model was fitted with test="t"
or test="knha"
, 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.
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
### calculate log risk ratios and corresponding sampling variances
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)
### fit random-effects model
res <- rma(yi, vi, data=dat)
### cumulative meta-analysis (in the order of publication year)
cumul(res, transf=exp, order=year)
#>
#> estimate zval pvals ci.lb ci.ub Q Qp tau2 I2 H2
#> 1 0.4109 -1.5586 0.1191 0.1343 1.2574 0.0000 1.0000 0.0000 0.0000 1.0000
#> 2 0.2658 -3.7967 0.0001 0.1341 0.5268 0.9315 0.3345 0.0000 0.0000 1.0000
#> 6 0.3783 -3.9602 0.0001 0.2338 0.6120 3.1879 0.2031 0.0872 40.7090 1.6866
#> 3 0.3675 -4.5037 0.0000 0.2377 0.5681 3.8614 0.2768 0.0763 33.9750 1.5146
#> 10 0.3324 -5.5164 0.0000 0.2248 0.4916 7.6415 0.1056 0.0858 48.4120 1.9384
#> 9 0.3778 -5.1875 0.0000 0.2615 0.5457 10.1854 0.0702 0.1046 60.0008 2.5000
#> 12 0.4061 -4.7250 0.0000 0.2794 0.5901 13.2116 0.0398 0.1205 59.9982 2.4999
#> 5 0.4545 -4.0039 0.0001 0.3089 0.6686 19.5749 0.0066 0.1780 72.3904 3.6219
#> 7 0.4208 -4.4107 0.0000 0.2864 0.6182 22.8208 0.0036 0.2023 73.5065 3.7745
#> 11 0.4560 -4.3588 0.0000 0.3204 0.6491 34.1203 0.0001 0.2005 81.4029 5.3772
#> 13 0.4925 -3.9701 0.0001 0.3472 0.6987 39.6122 0.0000 0.2281 83.0110 5.8862
#> 4 0.4517 -4.4184 0.0000 0.3175 0.6426 67.9858 0.0000 0.2732 87.0314 7.7109
#> 8 0.4894 -3.9744 0.0001 0.3441 0.6962 152.2330 0.0000 0.3132 92.2214 12.8558
#>
### 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)
### cumulative meta-analysis
cumul(res, order=year)
#>
#> estimate se zval pval ci.lb ci.ub Q Qp I2 H2
#> 1 -0.8893 0.5706 -1.5586 0.1191 -2.0077 0.2290 0.0000 1.0000 0.0000 1.0000
#> 2 -1.3517 0.3455 -3.9124 0.0001 -2.0289 -0.6746 0.9373 0.3330 0.0000 0.9373
#> 6 -0.8273 0.0808 -10.2371 0.0000 -0.9857 -0.6689 3.2109 0.2008 37.7127 1.6055
#> 3 -0.8379 0.0802 -10.4490 0.0000 -0.9951 -0.6807 3.8945 0.2731 22.9687 1.2982
#> 10 -0.8940 0.0769 -11.6254 0.0000 -1.0447 -0.7433 7.7589 0.1008 48.4460 1.9397
#> 9 -0.8507 0.0730 -11.6480 0.0000 -0.9938 -0.7075 10.2660 0.0680 51.2956 2.0532
#> 12 -0.8358 0.0725 -11.5275 0.0000 -0.9779 -0.6937 13.2768 0.0388 54.8084 2.2128
#> 5 -0.7744 0.0688 -11.2623 0.0000 -0.9092 -0.6397 19.6127 0.0065 64.3088 2.8018
#> 7 -0.7896 0.0680 -11.6188 0.0000 -0.9228 -0.6564 22.8443 0.0036 64.9803 2.8555
#> 11 -0.6660 0.0577 -11.5373 0.0000 -0.7792 -0.5529 34.1377 0.0001 73.6362 3.7931
#> 13 -0.6351 0.0563 -11.2811 0.0000 -0.7454 -0.5247 39.6232 0.0000 74.7622 3.9623
#> 4 -0.7758 0.0520 -14.9267 0.0000 -0.8777 -0.6739 68.3763 0.0000 83.9126 6.2160
#> 8 -0.4537 0.0393 -11.5338 0.0000 -0.5308 -0.3766 152.5676 0.0000 92.1346 12.7140
#>
cumul(res, order=year, transf=TRUE)
#>
#> estimate zval pval ci.lb ci.ub Q Qp I2 H2
#> 1 0.4109 -1.5586 0.1191 0.1343 1.2574 0.0000 1.0000 0.0000 1.0000
#> 2 0.2588 -3.9124 0.0001 0.1315 0.5094 0.9373 0.3330 0.0000 0.9373
#> 6 0.4372 -10.2371 0.0000 0.3732 0.5123 3.2109 0.2008 37.7127 1.6055
#> 3 0.4326 -10.4490 0.0000 0.3697 0.5062 3.8945 0.2731 22.9687 1.2982
#> 10 0.4090 -11.6254 0.0000 0.3518 0.4756 7.7589 0.1008 48.4460 1.9397
#> 9 0.4271 -11.6480 0.0000 0.3702 0.4929 10.2660 0.0680 51.2956 2.0532
#> 12 0.4335 -11.5275 0.0000 0.3761 0.4997 13.2768 0.0388 54.8084 2.2128
#> 5 0.4610 -11.2623 0.0000 0.4028 0.5275 19.6127 0.0065 64.3088 2.8018
#> 7 0.4540 -11.6188 0.0000 0.3974 0.5187 22.8443 0.0036 64.9803 2.8555
#> 11 0.5138 -11.5373 0.0000 0.4588 0.5753 34.1377 0.0001 73.6362 3.7931
#> 13 0.5299 -11.2811 0.0000 0.4745 0.5917 39.6232 0.0000 74.7622 3.9623
#> 4 0.4603 -14.9267 0.0000 0.4158 0.5097 68.3763 0.0000 83.9126 6.2160
#> 8 0.6353 -11.5338 0.0000 0.5881 0.6862 152.5676 0.0000 92.1346 12.7140
#>
### 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)
### cumulative meta-analysis
cumul(res, order=year)
#>
#> estimate se zval pval ci.lb ci.ub Q Qp I2 H2
#> 1 -0.8604 0.5318 -1.6178 0.1057 -1.9027 0.1820 0.0000 1.0000 0.0000 1.0000
#> 2 -1.2401 0.2912 -4.2591 0.0000 -1.8107 -0.6694 0.7279 0.3936 0.0000 0.7279
#> 6 -0.9570 0.0897 -10.6686 0.0000 -1.1328 -0.7812 1.7723 0.4122 0.0000 0.8861
#> 3 -0.9642 0.0885 -10.8948 0.0000 -1.1377 -0.7908 2.0147 0.5694 0.0000 0.6716
#> 10 -1.0003 0.0823 -12.1559 0.0000 -1.1616 -0.8390 3.2425 0.5181 0.0000 0.8106
#> 9 -0.9410 0.0776 -12.1265 0.0000 -1.0931 -0.7889 7.9341 0.1599 36.9810 1.5868
#> 12 -0.9246 0.0771 -11.9872 0.0000 -1.0758 -0.7735 11.6730 0.0697 48.5992 1.9455
#> 5 -0.8501 0.0730 -11.6515 0.0000 -0.9932 -0.7071 20.5359 0.0045 65.9133 2.9337
#> 7 -0.8712 0.0724 -12.0301 0.0000 -1.0131 -0.7293 26.1159 0.0010 69.3673 3.2645
#> 11 -0.7268 0.0615 -11.8273 0.0000 -0.8472 -0.6064 40.3188 0.0000 77.6779 4.4799
#> 13 -0.6912 0.0599 -11.5417 0.0000 -0.8086 -0.5739 46.9968 0.0000 78.7220 4.6997
#> 4 -0.8161 0.0531 -15.3842 0.0000 -0.9201 -0.7122 67.1837 0.0000 83.6270 6.1076
#> 8 -0.4744 0.0407 -11.6689 0.0000 -0.5541 -0.3948 167.7302 0.0000 92.8457 13.9775
#>
cumul(res, order=year, transf=TRUE)
#>
#> estimate zval pval ci.lb ci.ub Q Qp I2 H2
#> 1 0.4230 -1.6178 0.1057 0.1492 1.1996 0.0000 1.0000 0.0000 1.0000
#> 2 0.2894 -4.2591 0.0000 0.1635 0.5120 0.7279 0.3936 0.0000 0.7279
#> 6 0.3840 -10.6686 0.0000 0.3221 0.4579 1.7723 0.4122 0.0000 0.8861
#> 3 0.3813 -10.8948 0.0000 0.3206 0.4535 2.0147 0.5694 0.0000 0.6716
#> 10 0.3678 -12.1559 0.0000 0.3130 0.4321 3.2425 0.5181 0.0000 0.8106
#> 9 0.3902 -12.1265 0.0000 0.3352 0.4543 7.9341 0.1599 36.9810 1.5868
#> 12 0.3967 -11.9872 0.0000 0.3410 0.4614 11.6730 0.0697 48.5992 1.9455
#> 5 0.4274 -11.6515 0.0000 0.3704 0.4931 20.5359 0.0045 65.9133 2.9337
#> 7 0.4184 -12.0301 0.0000 0.3631 0.4823 26.1159 0.0010 69.3673 3.2645
#> 11 0.4835 -11.8273 0.0000 0.4286 0.5453 40.3188 0.0000 77.6779 4.4799
#> 13 0.5010 -11.5417 0.0000 0.4455 0.5633 46.9968 0.0000 78.7220 4.6997
#> 4 0.4421 -15.3842 0.0000 0.3985 0.4906 67.1837 0.0000 83.6270 6.1076
#> 8 0.6222 -11.6689 0.0000 0.5746 0.6738 167.7302 0.0000 92.8457 13.9775
#>
### make first log risk ratio missing and fit 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)
#> Warning: 1 study with NAs omitted from model fitting.
cumul(res, transf=exp, order=year)
#>
#> estimate zval pvals ci.lb ci.ub Q Qp tau2 I2 H2
#> 6 0.4556 -9.4599 0.0000 0.3871 0.5362 0.0000 1.0000 0.0000 0.0000 1.0000
#> 3 0.4514 -9.6497 0.0000 0.3841 0.5306 0.7478 0.3872 0.0000 0.0000 1.0000
#> 10 0.3504 -4.3207 0.0000 0.2178 0.5639 4.9051 0.0861 0.1008 59.6906 2.4808
#> 9 0.4100 -4.2685 0.0000 0.2722 0.6174 7.1487 0.0673 0.1034 66.8114 3.0131
#> 12 0.4480 -3.6703 0.0002 0.2918 0.6878 10.0666 0.0393 0.1304 66.7246 3.0052
#> 5 0.5075 -3.1669 0.0015 0.3335 0.7722 15.9241 0.0071 0.1704 75.5631 4.0922
#> 7 0.4584 -3.5536 0.0004 0.2981 0.7048 19.3442 0.0036 0.2132 77.6086 4.4660
#> 11 0.4970 -3.6803 0.0002 0.3425 0.7212 29.4342 0.0001 0.1880 83.2856 5.9829
#> 13 0.5390 -3.3443 0.0008 0.3752 0.7743 34.5952 0.0000 0.2077 84.0877 6.2845
#> 4 0.4835 -3.7288 0.0002 0.3300 0.7084 64.2052 0.0000 0.2831 89.1076 9.1808
#> 8 0.5262 -3.3578 0.0008 0.3618 0.7655 144.6390 0.0000 0.3139 93.3044 14.9352
#>