Title: | Meta-Analysis Datasets |
---|---|
Description: | A collection of meta-analysis datasets for teaching purposes, illustrating/testing meta-analytic methods, and validating published analyses. |
Authors: | Thomas White [aut] , Daniel Noble [aut] , Alistair Senior [aut] , W. Kyle Hamilton [aut] , Wolfgang Viechtbauer [aut, cre] , Guido Schwarzer [dtc] |
Maintainer: | Wolfgang Viechtbauer <[email protected]> |
License: | GPL (>=2) |
Version: | 1.3-0 |
Built: | 2024-11-13 05:30:29 UTC |
Source: | https://github.com/wviechtb/metadat |
The metadat package contains a large collection of meta-analysis datasets. These datasets are useful for teaching purposes, illustrating/testing meta-analytic methods, and validating published analyses.
A listing of all datasets in the package can be obtained with help(package=metadat)
. Each datasets is also tagged with one or multiple concept terms. These concept terms refer to various aspects of a dataset, such as the field/topic of research, the outcome measure used for the analysis, the model(s) used for analyzing the data, and the methods/concepts that can be illustrated with the dataset. The datsearch
function can be used to search among the existing datasets in the package based on their concept terms or based on a full-text search of their corresponding help files.
You can also read the documentation online at https://wviechtb.github.io/metadat/ (where the output from the example analyses corresponding to each dataset is provided).
We welcome contributions of new datasets to the package. For each dataset, there must be a citable reference, ideally in a peer-reviewed journal or publication. The general workflow for contributing a new dataset is as follows:
Install the metadat
package in R in the usual manner (i.e., install.packages("metadat")
).
If you are familiar with Git/GitHub and making pull requests, fork the package repository. Otherwise, download the source version of the package from GitHub and unzip the file to some directory on your computer.
Place the raw data (in a non-binary format) in the data-raw
directory. The file should be named dat.<author><year>.<ext>
, where <author>
is the last name of the first author of the publication from which the data come, <year>
is the publication year, and <ext>
is the file extension (e.g., .txt
, .csv
).
Place a corresponding R script in the data-raw
directory named dat.<author><year>.r
that reads in the data, possibly does some data cleaning/processing, and then saves the dataset to the data
directory (using save
), with name dat.<author><year>.rda
.
Start R, load the metadat
package (i.e., library(metadat)
), and then run the prep_dat
function (either set the working directory to the location of the source package beforehand or use the pkgdir
argument of the prep_dat
function to specify the source package location).
For a new dataset, this should create a boilerplate template for a corresponding help file in the man
directory, named dat.<author><year>.Rd
. Edit the help file, adding the title and a short description of the dataset in general, a description of each variable in the dataset, further details on the dataset (e.g., the field of research, how the data was collected, the purpose of the dataset / what it was used for, the effect size or outcome measure used in the analysis, the types of analyses/models that can be illustrated with the dataset), a reference for the source of the dataset, one or multiple concept terms, the name and email address of the contributor of the dataset, and (optionally) example code to illustrate the analysis of the dataset.
Either make a pull request (if you are familiar with this workflow) or zip up the dat.<author><year>.<ext>
, dat.<author><year>.r
, dat.<author><year>.rda
, and dat.<author><year>.Rd
files and open up a new issue at GitHub, attaching the zip file.
If the above makes no sense to you, you can also email one of the package authors with a cleaned, raw data file in .txt
or .csv
format, along with a meta-data file (format doesn't matter) that includes the information described above.
If you use these data, please cite both the metadat package (see citation("metadat")
for the reference) and the original source of the data as given under the help file of a dataset.
If you think you have found an error in an existing dataset or a bug in the package in general, please go to https://github.com/wviechtb/metadat/issues and open up a new issue.
Thomas White, [email protected]
Daniel Noble, [email protected]
Alistair Senior, [email protected]
W. Kyle Hamilton, [email protected]
Wolfgang Viechtbauer, [email protected]
Results from 5 studies examining the association between various measures of supervision quality and various work-related outcomes in social, mental health, and child welfare workers.
dat.aloe2013
dat.aloe2013
The data frame contains the following columns:
study | character |
study author(s) and year |
n | integer |
sample size |
tval | numeric |
t-statistic for the test of the association/predictor |
preds | integer |
number of predictors included in the regression model |
R2 | numeric |
the coefficient of determination (i.e., R-squared value) of the regression model |
The dataset is based on studies that used regression models to examine the association between some measure of perceived supervision quality (e.g., the quality of the relationship with one's supervisor) and some work-related outcome (e.g., job satisfaction) in social, mental health, and child welfare workers. The dataset was extracted from Aloe and Thompson (2013), which in turn is a subset of the studies included in the meta-analysis by Mor Barak et al. (2009).
The dataset can be used to illustrate the meta-analysis of regression models, using measures such as the (semi-)partial correlation coefficient. For this, the t-statistic from the regression model for the association (i.e., predictor) of interest was extracted from each regression model (tval
), as well as the sample size (n
), the number of predictors included in the regression model (preds
), and the coefficient of determination (i.e., R-squared value) of the regression model (R2
). Based on this information, the (semi-)partial correlation coefficient can be computed for each study, as well as its corresponding sampling variance. These values can then be meta-analyzed using standard methods.
social work, (semi-)partial correlations, meta-regression
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Aloe, A. M., & Thompson, C. G. (2013). The synthesis of partial effect sizes. Journal of the Society for Social Work and Research, 4(4), 390–405. https://doi.org/10.5243/jsswr.2013.24
Mor Barak, M. E., Travis, D. J., Pyun, H., & Xie, B. (2009). The impact of supervision on worker outcomes: A meta-analysis. Social Service Review, 83(1), 3–32. https://doi.org/10.1086/599028
### copy data into 'dat' and examine data dat <- dat.aloe2013 dat ## Not run: ### load metafor package suppressPackageStartupMessages(library(metafor)) ### compute the partial correlation coefficients and corresponding sampling variances dat <- escalc(measure="PCOR", ti=tval, ni=n, mi=preds, data=dat) dat ### random-effects model res <- rma(yi, vi, data=dat) res ### mixed-effects meta-regression model examining the relationship between the partial ### correlation coefficients and the number of predictors included in the models res <- rma(yi, vi, mods = ~ preds, data=dat) res ### compute the r-to-z transformed partial correlation coefficients and their variances dat <- escalc(measure="ZPCOR", ti=tval, ni=n, mi=preds, data=dat) dat ### random-effects model res <- rma(yi, vi, data=dat) res ### back-transformation to the partial correlation scale predict(res, transf=transf.ztor) ### compute the semi-partial correlation coefficients and their variances dat <- escalc(measure="SPCOR", ti=tval, ni=n, mi=preds, r2i=R2, data=dat) dat ### random-effects model res <- rma(yi, vi, data=dat) res ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.aloe2013 dat ## Not run: ### load metafor package suppressPackageStartupMessages(library(metafor)) ### compute the partial correlation coefficients and corresponding sampling variances dat <- escalc(measure="PCOR", ti=tval, ni=n, mi=preds, data=dat) dat ### random-effects model res <- rma(yi, vi, data=dat) res ### mixed-effects meta-regression model examining the relationship between the partial ### correlation coefficients and the number of predictors included in the models res <- rma(yi, vi, mods = ~ preds, data=dat) res ### compute the r-to-z transformed partial correlation coefficients and their variances dat <- escalc(measure="ZPCOR", ti=tval, ni=n, mi=preds, data=dat) dat ### random-effects model res <- rma(yi, vi, data=dat) res ### back-transformation to the partial correlation scale predict(res, transf=transf.ztor) ### compute the semi-partial correlation coefficients and their variances dat <- escalc(measure="SPCOR", ti=tval, ni=n, mi=preds, r2i=R2, data=dat) dat ### random-effects model res <- rma(yi, vi, data=dat) res ## End(Not run)
Results from 34 trials examining the effectiveness of oral anticoagulants in patients with coronary artery disease.
dat.anand1999
dat.anand1999
The data frame contains the following columns:
study | character |
author(s) or trial name |
year | numeric |
publication year |
intensity | character |
intensity of anticoagulation (low, medium, or high) |
asp.t | numeric |
concomitant use of aspirin in the treatment group (0 = no, 1 = yes) |
asp.c | numeric |
concomitant use of aspirin in the control group (0 = no, 1 = yes) |
ai | numeric |
number of deaths in the treatment group |
n1i | numeric |
number of patients in the treatment group |
ci | numeric |
number of deaths in the control group |
n2i | numeric |
number of patients in the control group |
The dataset includes the results from 34 randomized clinical trials that examined the effectiveness of oral anticoagulants in patients with coronary artery disease. The results given here are focused on the total mortality in the treatment versus control groups.
medicine, cardiology, odds ratios, Mantel-Haenszel method
Strictly speaking, there are only 31 trials, since Breddin et al. (1980) and ATACS (1990) are multiarm trials.
According to a correction, dat.anand1999$ci[29]
should be 1. But then dat.anand1999$ci[21]
would also have to be 1 (if these data indeed refer to the same control group). This appears contradictory, so this correction was not made.
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Anand, S. S., & Yusuf, S. (1999). Oral anticoagulant therapy in patients with coronary artery disease: A meta-analysis. Journal of the American Medical Association, 282(21), 2058–2067. https://doi.org/10.1001/jama.282.21.2058
### copy data into 'dat' and examine data dat <- dat.anand1999 dat ## Not run: ### load metafor package library(metafor) ### High-Intensity OA vs Control rma.mh(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=(intensity=="high" & asp.t==0 & asp.c==0), digits=2) ### High- or Moderate-Intensity OA vs Aspirin rma.mh(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=(intensity %in% c("high","moderate") & asp.t==0 & asp.c==1), digits=2) ### Moderate-Intensity OA vs Control rma.mh(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=(intensity=="moderate" & asp.t==0 & asp.c==0), digits=2) ### High- or Moderate-Intensity OA and Aspirin vs Aspirin rma.mh(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=(intensity %in% c("high","moderate") & asp.t==1 & asp.c==1), digits=2) ### Low-Intensity OA and Aspirin vs Aspirin rma.mh(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=(intensity=="low" & asp.t==1 & asp.c==1), digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.anand1999 dat ## Not run: ### load metafor package library(metafor) ### High-Intensity OA vs Control rma.mh(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=(intensity=="high" & asp.t==0 & asp.c==0), digits=2) ### High- or Moderate-Intensity OA vs Aspirin rma.mh(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=(intensity %in% c("high","moderate") & asp.t==0 & asp.c==1), digits=2) ### Moderate-Intensity OA vs Control rma.mh(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=(intensity=="moderate" & asp.t==0 & asp.c==0), digits=2) ### High- or Moderate-Intensity OA and Aspirin vs Aspirin rma.mh(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=(intensity %in% c("high","moderate") & asp.t==1 & asp.c==1), digits=2) ### Low-Intensity OA and Aspirin vs Aspirin rma.mh(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=(intensity=="low" & asp.t==1 & asp.c==1), digits=2) ## End(Not run)
Results from 17 studies on the association between recidivism and mental health in delinquent juveniles.
dat.assink2016
dat.assink2016
The data frame contains the following columns:
study | numeric |
study id number |
esid | numeric |
effect size within study id number |
id | numeric |
row id number |
yi | numeric |
standardized mean difference |
vi | numeric |
corresponding sampling variance |
pubstatus | numeric |
published study (0 = no; 1 = yes) |
year | numeric |
publication year of the study (approximately mean centered) |
deltype | character |
type of delinquent behavior in which juveniles could have recidivated (either general, overt, or covert) |
The studies included in this dataset (which is a subset of the data used in Assink et al., 2015) compared the difference in recidivism between delinquent juveniles with a mental health disorder and a comparison group of juveniles without a mental health disorder. Since studies differed in the way recidivism was defined and assessed, results are given in terms of standardized mean differences, with positive values indicating a higher prevalence of recidivism in the group of juveniles with a mental health disorder.
Multiple effect size estimates could be extracted from most studies (e.g., for different delinquent behaviors in which juveniles could have recidivated), necessitating the use of appropriate models/methods for the analysis. Assink and Wibbelink (2016) illustrate the use of multilevel meta-analysis models for this purpose.
psychology, criminology, standardized mean differences, multilevel models, cluster-robust inference
The year
variable is not constant within study 3, as this study refers to two different publications using the same data.
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Assink, M., & Wibbelink, C. J. M. (2016). Fitting three-level meta-analytic models in R: A step-by-step tutorial. The Quantitative Methods for Psychology, 12(3), 154–174. https://doi.org/10.20982/tqmp.12.3.p154
Assink, M., van der Put, C. E., Hoeve, M., de Vries, S. L. A., Stams, G. J. J. M., & Oort, F. J. (2015). Risk factors for persistent delinquent behavior among juveniles: A meta-analytic review. Clinical Psychology Review, 42, 47–61. https://doi.org/10.1016/j.cpr.2015.08.002
### copy data into 'dat' and examine data dat <- dat.assink2016 head(dat, 9) ## Not run: ### load metafor package library(metafor) ### fit multilevel model res <- rma.mv(yi, vi, random = ~ 1 | study/esid, data=dat) res ### use cluster-robust inference methods robust(res, cluster=study, clubSandwich=TRUE) ### LRTs for the variance components res0 <- rma.mv(yi, vi, random = ~ 1 | study/esid, data=dat, sigma2=c(0,NA)) anova(res0, res) res0 <- rma.mv(yi, vi, random = ~ 1 | study/esid, data=dat, sigma2=c(NA,0)) anova(res0, res) ### examine some potential moderators via meta-regression rma.mv(yi, vi, mods = ~ pubstatus, random = ~ 1 | study/esid, data=dat) rma.mv(yi, vi, mods = ~ year, random = ~ 1 | study/esid, data=dat) dat$deltype <- relevel(factor(dat$deltype), ref="general") rma.mv(yi, vi, mods = ~ deltype, random = ~ 1 | study/esid, data=dat) rma.mv(yi, vi, mods = ~ year + deltype, random = ~ 1 | study/esid, data=dat) ### assume that the effect sizes within studies are correlated with rho=0.6 V <- vcalc(vi, cluster=study, obs=esid, data=dat, rho=0.6) round(V[dat$study %in% c(1,2), dat$study %in% c(1,2)], 4) ### fit multilevel model using this approximate V matrix res <- rma.mv(yi, V, random = ~ 1 | study/esid, data=dat) res ### use cluster-robust inference methods robust(res, cluster=study, clubSandwich=TRUE) ### use a correlation of 0.7 for effect sizes corresponding to the same type of ### delinquent behavior and a correlation of 0.5 for effect sizes corresponding ### to different types of delinquent behavior V <- vcalc(vi, cluster=study, type=deltype, obs=esid, data=dat, rho=c(0.7, 0.5)) ### fit multilevel model using this approximate V matrix res <- rma.mv(yi, V, random = ~ 1 | study/esid, data=dat) res ### use cluster-robust inference methods robust(res, cluster=study, clubSandwich=TRUE) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.assink2016 head(dat, 9) ## Not run: ### load metafor package library(metafor) ### fit multilevel model res <- rma.mv(yi, vi, random = ~ 1 | study/esid, data=dat) res ### use cluster-robust inference methods robust(res, cluster=study, clubSandwich=TRUE) ### LRTs for the variance components res0 <- rma.mv(yi, vi, random = ~ 1 | study/esid, data=dat, sigma2=c(0,NA)) anova(res0, res) res0 <- rma.mv(yi, vi, random = ~ 1 | study/esid, data=dat, sigma2=c(NA,0)) anova(res0, res) ### examine some potential moderators via meta-regression rma.mv(yi, vi, mods = ~ pubstatus, random = ~ 1 | study/esid, data=dat) rma.mv(yi, vi, mods = ~ year, random = ~ 1 | study/esid, data=dat) dat$deltype <- relevel(factor(dat$deltype), ref="general") rma.mv(yi, vi, mods = ~ deltype, random = ~ 1 | study/esid, data=dat) rma.mv(yi, vi, mods = ~ year + deltype, random = ~ 1 | study/esid, data=dat) ### assume that the effect sizes within studies are correlated with rho=0.6 V <- vcalc(vi, cluster=study, obs=esid, data=dat, rho=0.6) round(V[dat$study %in% c(1,2), dat$study %in% c(1,2)], 4) ### fit multilevel model using this approximate V matrix res <- rma.mv(yi, V, random = ~ 1 | study/esid, data=dat) res ### use cluster-robust inference methods robust(res, cluster=study, clubSandwich=TRUE) ### use a correlation of 0.7 for effect sizes corresponding to the same type of ### delinquent behavior and a correlation of 0.5 for effect sizes corresponding ### to different types of delinquent behavior V <- vcalc(vi, cluster=study, type=deltype, obs=esid, data=dat, rho=c(0.7, 0.5)) ### fit multilevel model using this approximate V matrix res <- rma.mv(yi, V, random = ~ 1 | study/esid, data=dat) res ### use cluster-robust inference methods robust(res, cluster=study, clubSandwich=TRUE) ## End(Not run)
Results from 33 trials examining the effectiveness of hydroxychloroquine or chloroquine in patients with COVID-19.
dat.axfors2021
dat.axfors2021
The data frame contains the following columns:
id | character |
registry number |
acronym | character |
shortened registry number |
patient_setting | character |
patient setting |
blinding_exact | character |
study blinding |
high_dose | character |
high or low dose of medication |
Published | character |
publication status |
hcq_cq | character |
medication type (hcq = hydroxychloroquine or cq = chloroquine) |
hcq_arm_event | numeric |
number of deaths in the treatment group |
hcq_arm_total | numeric |
number of patients in the treatment group |
control_arm_event | numeric |
number of deaths in the control group |
control_arm_total | numeric |
number of patients in the control group |
Control | character |
control group type (Standard of Care or Placebo) |
The dataset includes the results from 33 published and unpublished randomized clinical trials that examined the effectiveness of hydroxychloroquine or chloroquine in patients with COVID-19. The results given here are focused on the total mortality in the treatment versus control groups.
medicine, covid-19, odds ratios
W. Kyle Hamilton [email protected] https://kylehamilton.com
Axfors, C., Schmitt, A., Janiaud, P., van ’t Hooft, J., Moher, D., Goodman, S., … Hemkens, L. G. (2021, March 9). Hydroxychloroquine and chloroquine for survival in COVID-19: An international collaborative meta-analysis of randomized trials. https://doi.org/10.17605/OSF.IO/QESV4
Axfors, C., Schmitt, A. M., Janiaud, P., van’t Hooft, J., Abd-Elsalam, S., Abdo, E. F., Abella, B. S., Akram, J., Amaravadi, R. K., Angus, D. C., Arabi, Y. M., Azhar, S., Baden, L. R., Baker, A. W., Belkhir, L., Benfield, T., Berrevoets, M. A. H., Chen, C.-P., Chen, T.-C., … Hemkens, L. G. (2021). Mortality outcomes with hydroxychloroquine and chloroquine in COVID-19 from an international collaborative meta-analysis of randomized trials. Nature Communications, 12(1), 2349. https://doi.org/10.1038/s41467-021-22446-z
# copy data into 'dat' and examine data dat <- dat.axfors2021 dat ## Not run: # load metafor package library(metafor) # calculate log odds ratios and corresponding sampling variances dat <- escalc(measure="OR", ai=hcq_arm_event, n1i=hcq_arm_total, ci=control_arm_event, n2i=control_arm_total, data=dat) # meta-analysis Hydroxychloroquine res_hcq <- rma(yi, vi, subset=(hcq_cq=="hcq"), slab = id, data=dat) print(res_hcq, digits=2) # meta-analysis Chloroquine res_cq <- rma(yi, vi, subset=(hcq_cq=="cq"), slab = id, data=dat) print(res_cq, digits=2) ## End(Not run)
# copy data into 'dat' and examine data dat <- dat.axfors2021 dat ## Not run: # load metafor package library(metafor) # calculate log odds ratios and corresponding sampling variances dat <- escalc(measure="OR", ai=hcq_arm_event, n1i=hcq_arm_total, ci=control_arm_event, n2i=control_arm_total, data=dat) # meta-analysis Hydroxychloroquine res_hcq <- rma(yi, vi, subset=(hcq_cq=="hcq"), slab = id, data=dat) print(res_hcq, digits=2) # meta-analysis Chloroquine res_cq <- rma(yi, vi, subset=(hcq_cq=="cq"), slab = id, data=dat) print(res_cq, digits=2) ## End(Not run)
Results from 77 papers with 678 effects evaluating associations among measures of situation awareness and task performance.
dat.bakdash2021
dat.bakdash2021
The data frame contains the following columns:
Author | character |
paper author(s) |
Year | integer |
year of paper publication |
Title | character |
title of paper |
DOI | character |
digital object identifier (DOI) |
DTIC.link | character |
permanent link for Defense Technical Information Collection (DITC) reports; see: https://www.dtic.mil |
SA.measure.type | character |
type of SA measure |
Sample.size | integer |
reported sample size |
Sample.size.stats | integer |
reported sample size based on reported statistics (this reflects excluded participants) |
es.z | numeric |
z-transformed correlation coefficient; includes ghost results (disclosed and undisclosed non-significant effects not reported in detail) imputed using the draw method described in Bakdash et al. (2021a) |
vi.z | numeric |
variance for z-transformed correlation (calculated using Sample.size.stats , not Sample.size ) |
SampleID | character |
unique identifier for each experiment/study |
Outcome | integer |
unique value for each effect size |
The dataset contains behavioral experiments from 77 papers/79 studies with a total of 678 effects, evaluating associations among measures of situation awareness (“knowing what is going on”) and task performance. Examples of situation awareness include knowledge of current vehicle speed in a simulated driving task and location and heading of aircraft in a simulated air traffic control task. Corresponding examples of task performance include “the number of collisions in a simulated driving task” and “subject matter expert rating of conflict management in a simulated air control task” (Bakdash et al. 2021a, p. 2). This dataset and the ‘Examples’ are a highly simplified version of the data and code in Bakdash et al. (2021b; 2021c). The journal article by Bakdash et al. (2021a) describes the systematic review and meta-analysis in detail.
This dataset is used to illustrate multilevel multivariate meta-analytic models for the overall pooled effect and pooled effects by situation awareness measure. We also adjust meta-analytic models using cluster-robust variance estimation / cluster-robust inference with the robust
function in metafor. Results are shown graphically in a customized forest plot with a prediction interval (estimated plausible range of individual effects). Last, we create a table summarizing the estimated meta-analytic heterogeneity parameters.
The meta-analytic results show most pooled effect sizes in the positive medium range or less. There was also substantial meta-analytic heterogeneity (estimated systematic variance in true effects), nearing the magnitude of the overall pooled effect. We interpret the meta-analytic results as situation awareness typically having limited validity for task performance (i.e., good situation awareness does not tend to have strong probabilistic links with good performance and vice-versa). More formally, measures of situation awareness do not generally and meaningfully capture cognitive processes and other relevant factors underlying task performance.
The code run-time can be greatly sped-up using a linear algebra library with R that makes use of multiple CPU cores. See: https://www.metafor-project.org/doku.php/tips:speeding_up_model_fitting. To measure the run-time, uncomment these three lines: start.time <- Sys.time()
, end.time <- Sys.time()
, and end.time - start.time
. Run-times on Windows 10 x64 with the Intel Math Kernel Library are:
CPU | Run-Time (Minutes) | |
i7-11850H | 2.49 | |
i7-4770 | 5.38 | |
psychology, human factors, engineering, correlation coefficients, multilevel models, multivariate models, cluster-robust inference
Jonathan Bakdash, [email protected], [email protected]
Laura Marusich, [email protected], [email protected]
Bakdash, J. Z., Marusich, L. R., Cox, K. R., Geuss, M. N., Zaroukian, E. G., & Morris, K. M. (2021b). The validity of situation awareness for performance: A meta-analysis (Code Ocean Capsule). https://doi.org/10.24433/CO.1682542.v4
Bakdash, J. Z., Marusich, L. R., Cox, K. R., Geuss, M. N., Zaroukian, E. G., & Morris, K. M. (2021c). The validity of situation awareness for performance: A meta-analysis (Systematic Review, Data, and Code). https://doi.org/10.17605/OSF.IO/4K7ZV
Bakdash, J. Z., Marusich, L. R., Cox, K. R., Geuss, M. N., Zaroukian, E. G., & Morris, K. M. (2021a). The validity of situation awareness for performance: A meta-analysis. Theoretical Issues in Ergonomics Science, 1–24. https://doi.org/10.1080/1463922X.2021.1921310
Supplemental materials: https://www.tandfonline.com/doi/suppl/10.1080/1463922X.2021.1921310/suppl_file/ttie_a_1921310_sm5524.docx
### copy data into 'dat' and examine data dat <- dat.bakdash2021 head(dat[c(1,2,6,8:12)]) ## Not run: #start.time <- Sys.time() ### load metafor library(metafor) ### multilevel meta-analytic model to get the overall pooled effect res.overall <- rma.mv(es.z, vi.z, mods = ~ 1, random = ~ 1 | SampleID / Outcome, data = dat, test = "t") res.overall ### get prediction interval predict(res.overall) ### cluster-robust variance estimation (CRVE) / cluster-robust inference res.overall.crve <- robust(res.overall, cluster = SampleID) res.overall.crve ### get prediction interval res.overall.crve.pred <- predict(res.overall.crve) res.overall.crve.pred ### multilevel meta-analytic model for SA measures res.sa <- rma.mv(es.z, vi.z, mods = ~ SA.measure.type - 1, random = ~ 1 | SampleID / Outcome, data = dat, test = "t") res.sa ### cluster-robust variance estimation (CRVE) / cluster-robust inference res.sa.crve <- robust(res.sa, cluster = SampleID) res.sa.crve ### profile likelihood plots par(mfrow=c(2,1)) profile(res.sa.crve, progbar = FALSE) ### format and combine output of meta-analytic models for the forest plot all.z <- c(res.sa.crve$beta, # SA measures res.overall.crve$beta, # pooled effect for confidence interval (CI) res.overall.crve$beta) # pooled effect for prediction interval (PI) all.ci.lower <- c(res.sa.crve$ci.lb, # SA measures res.overall.crve.pred$ci.lb, # pooled effect, lower CI res.overall.crve.pred$pi.lb) # pooled effect, lower PI all.ci.upper <- c(res.sa.crve$ci.ub, # SA measures res.overall.crve.pred$ci.ub, # pooled effect, upper CI res.overall.crve.pred$pi.ub) # pooled effect, upper PI ### note: there is no p-value for the PI all.pvals <- c(res.sa.crve$pval, res.overall.crve$pval) all.labels <- c(sort(unique(dat$SA.measure.type)), "Overall", "95% Prediction Interval") ### function to round p-values for the forest plot pvals.round <- function(input) { input <- ifelse(input < 0.001, "< 0.001", ifelse(input < 0.01, "< 0.01", ifelse(input < 0.05 & input >= 0.045, "< 0.05", ifelse(round(input, 2) == 1.00, "0.99", sprintf("%.2f", round(input, 2))))))} all.pvals.rounded <- pvals.round(all.pvals) ### forest plot plot.vals <- data.frame(all.labels, all.z, all.ci.lower, all.ci.upper) par(mfrow=c(1,1), cex = 1.05) forest(plot.vals$all.z, ci.lb = plot.vals$all.ci.lower, ci.ub = plot.vals$all.ci.upper, slab = plot.vals$all.labels, psize = 1, efac = 0, xlim = c(-1.8, 2.5), clim = c(-1, 1), transf = transf.ztor, # transform z to r at = seq(-0.5, 1, by = 0.25), xlab = expression("Correlation Coefficient"~"("*italic('r')*")"), main = "\n\n\nSA Measures", ilab = c(all.pvals.rounded, ""), ilab.xpos = 2.45, ilab.pos = 2.5, digits = 2, refline = 0, annotate = FALSE) ### keep trailing zero using sprintf output <- cbind(sprintf("%.2f", round(transf.ztor(plot.vals$all.z), 2)), sprintf("%.2f", round(transf.ztor(plot.vals$all.ci.lower), 2)), sprintf("%.2f", round(transf.ztor(plot.vals$all.ci.upper), 2))) ### alignment kludge annotext <- apply(output, 1, function(x) {paste0(" ", x[1], " [", x[2],", ", x[3], "]")}) text( 1.05, 12:1, annotext, pos = 4, cex = 1.05) text(-1.475, 14.00, "SA Measure", cex = 1.05) text( 2.30, 14.00, substitute(paste(italic('p-value'))), cex = 1.05) text( 1.55, 14.00, "Correlation [95% CI]", cex = 1.05) abline(h = 1.5) ### black polygon for overall mean CIs addpoly(all.z[11], ci.lb = all.ci.lower[11], ci.ub = all.ci.upper[11], rows = 2, annotate = FALSE, efac = 1.5, transf = transf.ztor) ### white polygon for PI addpoly(all.z[12], ci.lb = all.ci.lower[12], ci.ub = all.ci.upper[12], rows = 1, col = "white", border = "black", annotate = FALSE, efac = 1.5, transf = transf.ztor) par(mfrow=c(1,1), cex = 1) # reset graph parameters to default ### confidence intervals for the variance components re.CI.variances <- confint(res.overall) re.CI.variances sigma1.z <- data.frame(re.CI.variances[[1]]["random"]) sigma2.z <- data.frame(re.CI.variances[[2]]["random"]) ### fit model using alternative multivariate parameterization res.overall.alt <- rma.mv(es.z, vi.z, mods = ~ 1, random = ~ factor(Outcome) | factor(SampleID), data = dat, test = "t") ### confidence intervals for the total amount of heterogeneity variance component res.overall.alt.tau <- confint(res.overall.alt, tau2=1)$random ### I^2: http://www.metafor-project.org/doku.php/tips:i2_multilevel_multivariate W <- diag(1/dat$vi.z) X <- model.matrix(res.overall) P <- W - W %*% X %*% solve(t(X) %*% W %*% X) %*% t(X) %*% W ### I^2 (variance due to heterogeneity): 61% I2 <- 100 * res.overall.alt$tau2 / (res.overall.alt$tau2 + (res.overall$k-res.overall$p)/sum(diag(P))) I2 ### 95% CI for I^2 using uncertainty around tau^2 I2.CI.lb <- 100 * res.overall.alt.tau[1,2] / (res.overall.alt.tau[1,2] + (res.overall$k-res.overall$p)/sum(diag(P))) I2.CI.lb I2.CI.ub <- 100 * res.overall.alt.tau[1,3] / (res.overall.alt.tau[1,3] + (res.overall$k-res.overall$p)/sum(diag(P))) I2.CI.ub ### total amount of heterogeneity (tau) sqrt(res.overall.alt$tau2) ### heterogeneity table table.heterogeneity <- data.frame(matrix(ncol = 3, nrow = 4)) colnames(table.heterogeneity) <- c("Parameter Value", "Lower 95% CI", "Upper 95% CI") rownames(table.heterogeneity) <- c("Tau (Total)", "Tau1 (Between paper)", "Tau2 (Within paper)", "I2 (%)") table.heterogeneity[1,] <- res.overall.alt.tau[2,] table.heterogeneity[2,] <- sigma1.z[2,] table.heterogeneity[3,] <- sigma2.z[2,] table.heterogeneity[4,] <- c(I2, I2.CI.lb, I2.CI.ub) round(table.heterogeneity, 2) #end.time <- Sys.time() #end.time - start.time ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.bakdash2021 head(dat[c(1,2,6,8:12)]) ## Not run: #start.time <- Sys.time() ### load metafor library(metafor) ### multilevel meta-analytic model to get the overall pooled effect res.overall <- rma.mv(es.z, vi.z, mods = ~ 1, random = ~ 1 | SampleID / Outcome, data = dat, test = "t") res.overall ### get prediction interval predict(res.overall) ### cluster-robust variance estimation (CRVE) / cluster-robust inference res.overall.crve <- robust(res.overall, cluster = SampleID) res.overall.crve ### get prediction interval res.overall.crve.pred <- predict(res.overall.crve) res.overall.crve.pred ### multilevel meta-analytic model for SA measures res.sa <- rma.mv(es.z, vi.z, mods = ~ SA.measure.type - 1, random = ~ 1 | SampleID / Outcome, data = dat, test = "t") res.sa ### cluster-robust variance estimation (CRVE) / cluster-robust inference res.sa.crve <- robust(res.sa, cluster = SampleID) res.sa.crve ### profile likelihood plots par(mfrow=c(2,1)) profile(res.sa.crve, progbar = FALSE) ### format and combine output of meta-analytic models for the forest plot all.z <- c(res.sa.crve$beta, # SA measures res.overall.crve$beta, # pooled effect for confidence interval (CI) res.overall.crve$beta) # pooled effect for prediction interval (PI) all.ci.lower <- c(res.sa.crve$ci.lb, # SA measures res.overall.crve.pred$ci.lb, # pooled effect, lower CI res.overall.crve.pred$pi.lb) # pooled effect, lower PI all.ci.upper <- c(res.sa.crve$ci.ub, # SA measures res.overall.crve.pred$ci.ub, # pooled effect, upper CI res.overall.crve.pred$pi.ub) # pooled effect, upper PI ### note: there is no p-value for the PI all.pvals <- c(res.sa.crve$pval, res.overall.crve$pval) all.labels <- c(sort(unique(dat$SA.measure.type)), "Overall", "95% Prediction Interval") ### function to round p-values for the forest plot pvals.round <- function(input) { input <- ifelse(input < 0.001, "< 0.001", ifelse(input < 0.01, "< 0.01", ifelse(input < 0.05 & input >= 0.045, "< 0.05", ifelse(round(input, 2) == 1.00, "0.99", sprintf("%.2f", round(input, 2))))))} all.pvals.rounded <- pvals.round(all.pvals) ### forest plot plot.vals <- data.frame(all.labels, all.z, all.ci.lower, all.ci.upper) par(mfrow=c(1,1), cex = 1.05) forest(plot.vals$all.z, ci.lb = plot.vals$all.ci.lower, ci.ub = plot.vals$all.ci.upper, slab = plot.vals$all.labels, psize = 1, efac = 0, xlim = c(-1.8, 2.5), clim = c(-1, 1), transf = transf.ztor, # transform z to r at = seq(-0.5, 1, by = 0.25), xlab = expression("Correlation Coefficient"~"("*italic('r')*")"), main = "\n\n\nSA Measures", ilab = c(all.pvals.rounded, ""), ilab.xpos = 2.45, ilab.pos = 2.5, digits = 2, refline = 0, annotate = FALSE) ### keep trailing zero using sprintf output <- cbind(sprintf("%.2f", round(transf.ztor(plot.vals$all.z), 2)), sprintf("%.2f", round(transf.ztor(plot.vals$all.ci.lower), 2)), sprintf("%.2f", round(transf.ztor(plot.vals$all.ci.upper), 2))) ### alignment kludge annotext <- apply(output, 1, function(x) {paste0(" ", x[1], " [", x[2],", ", x[3], "]")}) text( 1.05, 12:1, annotext, pos = 4, cex = 1.05) text(-1.475, 14.00, "SA Measure", cex = 1.05) text( 2.30, 14.00, substitute(paste(italic('p-value'))), cex = 1.05) text( 1.55, 14.00, "Correlation [95% CI]", cex = 1.05) abline(h = 1.5) ### black polygon for overall mean CIs addpoly(all.z[11], ci.lb = all.ci.lower[11], ci.ub = all.ci.upper[11], rows = 2, annotate = FALSE, efac = 1.5, transf = transf.ztor) ### white polygon for PI addpoly(all.z[12], ci.lb = all.ci.lower[12], ci.ub = all.ci.upper[12], rows = 1, col = "white", border = "black", annotate = FALSE, efac = 1.5, transf = transf.ztor) par(mfrow=c(1,1), cex = 1) # reset graph parameters to default ### confidence intervals for the variance components re.CI.variances <- confint(res.overall) re.CI.variances sigma1.z <- data.frame(re.CI.variances[[1]]["random"]) sigma2.z <- data.frame(re.CI.variances[[2]]["random"]) ### fit model using alternative multivariate parameterization res.overall.alt <- rma.mv(es.z, vi.z, mods = ~ 1, random = ~ factor(Outcome) | factor(SampleID), data = dat, test = "t") ### confidence intervals for the total amount of heterogeneity variance component res.overall.alt.tau <- confint(res.overall.alt, tau2=1)$random ### I^2: http://www.metafor-project.org/doku.php/tips:i2_multilevel_multivariate W <- diag(1/dat$vi.z) X <- model.matrix(res.overall) P <- W - W %*% X %*% solve(t(X) %*% W %*% X) %*% t(X) %*% W ### I^2 (variance due to heterogeneity): 61% I2 <- 100 * res.overall.alt$tau2 / (res.overall.alt$tau2 + (res.overall$k-res.overall$p)/sum(diag(P))) I2 ### 95% CI for I^2 using uncertainty around tau^2 I2.CI.lb <- 100 * res.overall.alt.tau[1,2] / (res.overall.alt.tau[1,2] + (res.overall$k-res.overall$p)/sum(diag(P))) I2.CI.lb I2.CI.ub <- 100 * res.overall.alt.tau[1,3] / (res.overall.alt.tau[1,3] + (res.overall$k-res.overall$p)/sum(diag(P))) I2.CI.ub ### total amount of heterogeneity (tau) sqrt(res.overall.alt$tau2) ### heterogeneity table table.heterogeneity <- data.frame(matrix(ncol = 3, nrow = 4)) colnames(table.heterogeneity) <- c("Parameter Value", "Lower 95% CI", "Upper 95% CI") rownames(table.heterogeneity) <- c("Tau (Total)", "Tau1 (Between paper)", "Tau2 (Within paper)", "I2 (%)") table.heterogeneity[1,] <- res.overall.alt.tau[2,] table.heterogeneity[2,] <- sigma1.z[2,] table.heterogeneity[3,] <- sigma2.z[2,] table.heterogeneity[4,] <- c(I2, I2.CI.lb, I2.CI.ub) round(table.heterogeneity, 2) #end.time <- Sys.time() #end.time - start.time ## End(Not run)
Results from 39 trials examining pharmacologic treatments for chronic obstructive pulmonary disease (COPD).
dat.baker2009
dat.baker2009
The data frame contains the following columns:
study | character |
study label |
year | numeric |
year of publication |
id | numeric |
study ID |
treatment | character |
treatment |
exac | numeric |
number of individuals with one or more COPD exacerbations |
total | numeric |
number of individuals |
This dataset comes from a systematic review of randomized controlled trials on pharmacologic treatments for chronic obstructive pulmonary disease (COPD) (Baker et al., 2009).
The primary outcome, occurrence of one or more episodes of COPD exacerbation, is binary (yes / no). For this outcome, five drug treatments (fluticasone, budesonide, salmeterol, formoterol, tiotropium) and two combinations (fluticasone + salmeterol, budesonide + formoterol) were compared to placebo. The authors considered the two combinations as separate treatments instead of evaluating the individual components.
medicine, odds ratios, network meta-analysis, component network meta-analysis
Guido Schwarzer, [email protected], https://github.com/guido-s/
Baker, W. L., Baker, E. L., & Coleman, C. I. (2009). Pharmacologic treatments for chronic obstructive pulmonary disease: A mixed-treatment comparison meta-analysis. Pharmacotherapy: The Journal of Human Pharmacology and Drug Therapy, 29(8), 891–905. https://doi.org/10.1592/phco.29.8.891
pairwise
, metabin
,
netmeta
, netcomb
,
netmetabin
### Show first 6 rows of the dataset head(dat.baker2009) ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print odds ratios and confidence limits with two digits oldset <- settings.meta(digits = 2) ### Transform data from long arm-based format to contrast-based ### format. Argument 'sm' has to be used for odds ratio as summary ### measure; by default the risk ratio is used in the metabin function ### called internally. pw <- pairwise(treatment, exac, total, studlab = paste(study, year), data = dat.baker2009, sm = "OR") ### Conduct random effects network meta-analysis (NMA) ### with placebo as reference net <- netmeta(pw, fixed = FALSE, ref = "plac") ### Show network graph netgraph(net, seq = "optimal", start = "prcomp", labels = gsub("+", " +\n", trts, fixed = TRUE), plastic = TRUE, thickness = "se.fixed", number = TRUE, points = TRUE, cex.points = 5, col.points = "red", offset = 0.025) ### Print and plot results for network meta-analysis net forest(net) ### Conduct component network meta-analysis (CNMA) cnet <- netcomb(net) cnet ### Compare results of NMA and additive CNMA nb <- netbind(net, cnet, name = c("Standard NMA", "Additive CNMA")) forest(nb) ### Use previous settings settings.meta(oldset) ## End(Not run)
### Show first 6 rows of the dataset head(dat.baker2009) ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print odds ratios and confidence limits with two digits oldset <- settings.meta(digits = 2) ### Transform data from long arm-based format to contrast-based ### format. Argument 'sm' has to be used for odds ratio as summary ### measure; by default the risk ratio is used in the metabin function ### called internally. pw <- pairwise(treatment, exac, total, studlab = paste(study, year), data = dat.baker2009, sm = "OR") ### Conduct random effects network meta-analysis (NMA) ### with placebo as reference net <- netmeta(pw, fixed = FALSE, ref = "plac") ### Show network graph netgraph(net, seq = "optimal", start = "prcomp", labels = gsub("+", " +\n", trts, fixed = TRUE), plastic = TRUE, thickness = "se.fixed", number = TRUE, points = TRUE, cex.points = 5, col.points = "red", offset = 0.025) ### Print and plot results for network meta-analysis net forest(net) ### Conduct component network meta-analysis (CNMA) cnet <- netcomb(net) cnet ### Compare results of NMA and additive CNMA nb <- netbind(net, cnet, name = c("Standard NMA", "Additive CNMA")) forest(nb) ### Use previous settings settings.meta(oldset) ## End(Not run)
Results from 48 studies on the effectiveness of school-based writing-to-learn interventions on academic achievement.
dat.bangertdrowns2004
dat.bangertdrowns2004
The data frame contains the following columns:
id | numeric |
study number |
author | character |
study author(s) |
year | numeric |
publication year |
grade | numeric |
grade level (1 = elementary; 2 = middle; 3 = high-school; 4 = college) |
length | numeric |
treatment length (in weeks) |
minutes | numeric |
minutes per assignment |
wic | numeric |
writing tasks were completed in class (0 = no; 1 = yes) |
feedback | numeric |
feedback on writing was provided (0 = no; 1 = yes) |
info | numeric |
writing contained informational components (0 = no; 1 = yes) |
pers | numeric |
writing contained personal components (0 = no; 1 = yes) |
imag | numeric |
writing contained imaginative components (0 = no; 1 = yes) |
meta | numeric |
prompts for metacognitive reflection (0 = no; 1 = yes) |
subject | character |
subject matter |
ni | numeric |
total sample size of the study |
yi | numeric |
standardized mean difference |
vi | numeric |
corresponding sampling variance |
In each of the studies included in this meta-analysis, an experimental group (i.e., a group of students that received instruction with increased emphasis on writing tasks) was compared against a control group (i.e., a group of students that received conventional instruction) with respect to some content-related measure of academic achievement (e.g., final grade, an exam/quiz/test score). The outcome measure for this meta-analysis was the standardized mean difference (with positive values indicating a higher mean level of academic achievement in the intervention group).
The standardized mean differences given here are bias-corrected and therefore differ slightly from the values reported in the article. Also, since only the total sample size is given in the article, the sampling variances were computed under the assumption that \(n_{i1} = n_{i2} = n_i / 2\).
education, standardized mean differences, meta-regression
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Bangert-Drowns, R. L., Hurley, M. M., & Wilkinson, B. (2004). The effects of school-based writing-to-learn interventions on academic achievement: A meta-analysis. Review of Educational Research, 74(1), 29–58. https://doi.org/10.3102/00346543074001029
### copy data into 'dat' and examine data dat <- dat.bangertdrowns2004 dat[1:10,-13] ## Not run: ### load metafor package library(metafor) ### fit random-effects model res <- rma(yi, vi, data=dat) res ### some examples of mixed-effects meta-regression models res <- rma(yi, vi, mods = ~ factor(grade), data=dat) res res <- rma(yi, vi, mods = ~ length, data=dat) res res <- rma(yi, vi, mods = ~ info + pers + imag + meta, data=dat) res ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.bangertdrowns2004 dat[1:10,-13] ## Not run: ### load metafor package library(metafor) ### fit random-effects model res <- rma(yi, vi, data=dat) res ### some examples of mixed-effects meta-regression models res <- rma(yi, vi, mods = ~ factor(grade), data=dat) res res <- rma(yi, vi, mods = ~ length, data=dat) res res <- rma(yi, vi, mods = ~ info + pers + imag + meta, data=dat) res ## End(Not run)
Results from 350,757 coin flips by 48 people to examine the presence of same-side bias.
dat.bartos2023
dat.bartos2023
The data frame contains the following columns:
person | character |
person identifier |
hsame | numeric |
number of flips where the coin landed on heads and on the same side as where it started |
hdiff | numeric |
number of flips where the coin landed on heads and on the different side as where it started |
tsame | numeric |
number of flips where the coin landed on tails and on the same side as where it started |
tdiff | numeric |
number of flips where the coin landed on tails and on the different side as where it started |
same | numeric |
number of flips where the coin landed on the same side as where it started |
flips | numeric |
total number of flips |
In a landmark study by Bartoš et al. (2023), 48 people flipped a coin (of various currencies and/or denominations) a total of 350,757 times, recording on each flip whether it landed on heads or tails and whether the coin landed on the same side as where it started or on the different side. The goal of this experiment was to examine the model by Diaconis, Holmes, and Montgomery (2007), according to which flipped coins have a slightly higher than 50% chance (of around 51% according to the D-H-M model) of landing on the same side as where they started.
physics, human factors, proportions, multivariate models
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Bartoš, F., Sarafoglou, A., Godmann, H. R., Sahrani, A., Leunk, D. K., Gui, P. Y., Voss, D., Ullah, K., Zoubek, M. J., Nippold, F., Aust, F., Vieira, F. F., Islam, C.-G., Zoubek, A. J., Shabani, S., Petter, J., Roos, I. B., Finnemann, A., Lob, A. B., Hoffstadt, M. F., Nak, J., de Ron, J., Derks, K., Huth, K., Terpstra, S., Bastelica, T., Matetovici, M., Ott, V. L., Zetea, A. S., Karnbach, K., Donzallaz, M. C., John, A., Moore, R. M., Assion, F., van Bork, R., Leidinger, T. E., Zhao, X., Motaghi, A. K., Pan, T., Armstrong, H., Peng, T., Bialas, M., Pang, J. Y.-C., Fu, B., Yang, S., Lin, X., Sleiffer, D., Bognar, M., Aczel, B., & Wagenmakers, E.-J. (2023). Fair coins tend to land on the same side they started: Evidence from 350,757 flips. arXiv, 2310.04153, v2. https://arxiv.org/abs/2310.04153
Diaconis, P., Holmes, S., & Montgomery, R. (2007). Dynamical bias in the coin toss. SIAM Review, 49(2), 211–235. https://doi.org/10.1137/s0036144504446436
### copy data into 'dat' and examine data dat <- dat.bartos2023 dat ## Not run: ### load metafor package library(metafor) ### compute proportions and the corresponding sampling variances dat <- escalc(measure="PR", xi=same, ni=flips, data=dat, slab=person) dat ### compute confidence intervals for the individual proportions (as in Table 1) summary(dat, digits=3)[c(1,6:8,13,14)] ### compute a confidence interval based on the column totals summary(escalc(measure="PR", xi=sum(dat$same), ni=sum(dat$flips)), digits=3) ### this is the same as meta-analyzing the proportions directly using an equal-effects ### model and also computing the sampling variances under the assumption that the true ### proportions are homogeneous rma(measure="PR", xi=same, ni=flips, vtype="AV", method="EE", data=dat, digits=3) ### fit a random-effects model res <- rma(yi, vi, data=dat) res ### profile likelihood confidence interval for tau^2 confint(res, type="PL") ### forest plot forest(res, header=TRUE, refline=0.5, xlim=c(0.38,0.72), digits=c(3,2)) ### funnel plot funnel(res, xlim=c(0.45,0.6), ylim=c(0,.02)) ### fit a random-effects model excluding those with same-side proportions larger than 0.53 res <- rma(yi, vi, data=dat, subset=yi<=0.53) res confint(res, type="PL") ### fit a binomial-normal model res <- rma.glmm(measure="PLO", xi=same, ni=flips, data=dat) res predict(res, transf=plogis) ### conduct a meta-analysis for the proportions of heads (to examine heads-tails bias) dat <- escalc(measure="PR", xi=hdiff+hsame, ni=flips, data=dat) res <- rma(yi, vi, data=dat) res confint(res, type="PL") ### restructure the dataset for a bivariate meta-analysis of same-side and heads proportions dat <- dat.bartos2023 dat <- dat[rep(1:nrow(dat), each=2),] rownames(dat) <- NULL dat$outcome <- c("heads", "same") dat <- escalc(measure="PR", xi=hsame+hdiff, ni=flips, data=dat, include=outcome=="heads") dat <- escalc(measure="PR", xi=hsame+tsame, ni=flips, data=dat, include=outcome=="same") dat ### construct the 2x2 variance-covariance matrix of the proportions within persons dat$cov <- with(dat, (hsame/flips * (1-hsame/flips) - hsame/flips * tsame/flips - hsame/flips * hdiff/flips - hdiff/flips * tsame/flips) / flips) V <- lapply(split(dat, dat$person), \(x) matrix(c(x$vi[1], x$cov, x$vi[2]), nrow=2)) ### fit bivariate meta-analysis model res <- rma.mv(yi, V, mods = ~ 0 + outcome, random = ~ outcome | person, struct="UN", data=dat) res ### create plot with confidence ellipses ('ellipse' package must be installed) library(ellipse) plot(NA, xlim=c(0.45,0.62), ylim=c(0.45,0.62), bty="l", xlab="Pr(heads)", ylab="Pr(same)") abline(h=0.5, lty="dotted") abline(v=0.5, lty="dotted") # add confidence ellipses for persons invisible(tapply(dat, dat$person, \(x) { xy <- ellipse(matrix(c(x$vi[1],x$cov,x$vi[2]), nrow=2), centre=x$yi, level=0.95) lines(xy[,1],xy[,2], col="gray80") })) # add the points invisible(tapply(dat, dat$person, \(x) points(x$yi[1], x$yi[2], pch=21, bg="gray80", cex=1.5))) # add the 95% PI ellipsis based on the model xy <- ellipse(res$G, centre=coef(res), level=0.95) lines(xy[,1],xy[,2], col="gray30", lwd=3, lty="dotted") # add the 95% CI ellipsis based on the model xy <- ellipse(vcov(res), centre=coef(res), level=0.95) lines(xy[,1],xy[,2], col="gray30", lwd=3) # add the point for the pooled effects points(coef(res)[1], coef(res)[2], pch=21, bg="gray40", cex=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.bartos2023 dat ## Not run: ### load metafor package library(metafor) ### compute proportions and the corresponding sampling variances dat <- escalc(measure="PR", xi=same, ni=flips, data=dat, slab=person) dat ### compute confidence intervals for the individual proportions (as in Table 1) summary(dat, digits=3)[c(1,6:8,13,14)] ### compute a confidence interval based on the column totals summary(escalc(measure="PR", xi=sum(dat$same), ni=sum(dat$flips)), digits=3) ### this is the same as meta-analyzing the proportions directly using an equal-effects ### model and also computing the sampling variances under the assumption that the true ### proportions are homogeneous rma(measure="PR", xi=same, ni=flips, vtype="AV", method="EE", data=dat, digits=3) ### fit a random-effects model res <- rma(yi, vi, data=dat) res ### profile likelihood confidence interval for tau^2 confint(res, type="PL") ### forest plot forest(res, header=TRUE, refline=0.5, xlim=c(0.38,0.72), digits=c(3,2)) ### funnel plot funnel(res, xlim=c(0.45,0.6), ylim=c(0,.02)) ### fit a random-effects model excluding those with same-side proportions larger than 0.53 res <- rma(yi, vi, data=dat, subset=yi<=0.53) res confint(res, type="PL") ### fit a binomial-normal model res <- rma.glmm(measure="PLO", xi=same, ni=flips, data=dat) res predict(res, transf=plogis) ### conduct a meta-analysis for the proportions of heads (to examine heads-tails bias) dat <- escalc(measure="PR", xi=hdiff+hsame, ni=flips, data=dat) res <- rma(yi, vi, data=dat) res confint(res, type="PL") ### restructure the dataset for a bivariate meta-analysis of same-side and heads proportions dat <- dat.bartos2023 dat <- dat[rep(1:nrow(dat), each=2),] rownames(dat) <- NULL dat$outcome <- c("heads", "same") dat <- escalc(measure="PR", xi=hsame+hdiff, ni=flips, data=dat, include=outcome=="heads") dat <- escalc(measure="PR", xi=hsame+tsame, ni=flips, data=dat, include=outcome=="same") dat ### construct the 2x2 variance-covariance matrix of the proportions within persons dat$cov <- with(dat, (hsame/flips * (1-hsame/flips) - hsame/flips * tsame/flips - hsame/flips * hdiff/flips - hdiff/flips * tsame/flips) / flips) V <- lapply(split(dat, dat$person), \(x) matrix(c(x$vi[1], x$cov, x$vi[2]), nrow=2)) ### fit bivariate meta-analysis model res <- rma.mv(yi, V, mods = ~ 0 + outcome, random = ~ outcome | person, struct="UN", data=dat) res ### create plot with confidence ellipses ('ellipse' package must be installed) library(ellipse) plot(NA, xlim=c(0.45,0.62), ylim=c(0.45,0.62), bty="l", xlab="Pr(heads)", ylab="Pr(same)") abline(h=0.5, lty="dotted") abline(v=0.5, lty="dotted") # add confidence ellipses for persons invisible(tapply(dat, dat$person, \(x) { xy <- ellipse(matrix(c(x$vi[1],x$cov,x$vi[2]), nrow=2), centre=x$yi, level=0.95) lines(xy[,1],xy[,2], col="gray80") })) # add the points invisible(tapply(dat, dat$person, \(x) points(x$yi[1], x$yi[2], pch=21, bg="gray80", cex=1.5))) # add the 95% PI ellipsis based on the model xy <- ellipse(res$G, centre=coef(res), level=0.95) lines(xy[,1],xy[,2], col="gray30", lwd=3, lty="dotted") # add the 95% CI ellipsis based on the model xy <- ellipse(vcov(res), centre=coef(res), level=0.95) lines(xy[,1],xy[,2], col="gray30", lwd=3) # add the point for the pooled effects points(coef(res)[1], coef(res)[2], pch=21, bg="gray40", cex=2) ## End(Not run)
Results from 23 studies on the effectiveness of practice facilitation interventions within the primary care practice setting.
dat.baskerville2012
dat.baskerville2012
The data frame contains the following columns:
author | character |
study author(s) |
year | numeric |
publication year |
score | numeric |
quality score (0 to 12 scale) |
design | character |
study design (cct = controlled clinical trial, rct = randomized clinical trial, crct = cluster randomized clinical trial) |
alloconc | numeric |
allocation concealed (0 = no, 1 = yes) |
blind | numeric |
single- or double-blind study (0 = no, 1 = yes) |
itt | numeric |
intention to treat analysis (0 = no, 1 = yes) |
fumonths | numeric |
follow-up months |
retention | numeric |
retention (in percent) |
country | character |
country where study was conducted |
outcomes | numeric |
number of outcomes assessed |
duration | numeric |
duration of intervention |
pperf | numeric |
practices per facilitator |
meetings | numeric |
(average) number of meetings |
hours | numeric |
(average) hours per meeting |
tailor | numeric |
intervention tailored to the context and needs of the practice (0 = no, 1 = yes) |
smd | numeric |
standardized mean difference |
se | numeric |
corresponding standard error |
Baskerville et al. (2012) describe outreach or practice facilitation as a "multifaceted approach that involves skilled individuals who enable others, through a range of intervention components and approaches, to address the challenges in implementing evidence-based care guidelines within the primary care setting". The studies included in this dataset examined the effectiveness of practice facilitation interventions for improving some relevant evidence-based practice behavior. The effect was quantified in terms of a standardized mean difference, comparing the change (from pre- to post-intervention) in the intervention versus the comparison group (or the difference from baseline in prospective cohort studies).
medicine, primary care, standardized mean differences, publication bias, meta-regression
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Baskerville, N. B., Liddy, C., & Hogg, W. (2012). Systematic review and meta-analysis of practice facilitation within primary care settings. Annals of Family Medicine, 10(1), 63–74. https://doi.org/10.1370/afm.1312
### copy data into 'dat' and examine data dat <- dat.baskerville2012 dat ## Not run: ### load metafor package library(metafor) ### random-effects model res <- rma(smd, sei=se, data=dat, method="DL") print(res, digits=2) ### funnel plot funnel(res, xlab="Standardized Mean Difference", ylim=c(0,0.6)) ### rank and regression tests for funnel plot asymmetry ranktest(res) regtest(res) ### meta-regression analyses examining various potential moderators rma(smd, sei=se, mods = ~ score, data=dat, method="DL") rma(smd, sei=se, mods = ~ alloconc, data=dat, method="DL") rma(smd, sei=se, mods = ~ blind, data=dat, method="DL") rma(smd, sei=se, mods = ~ itt, data=dat, method="DL") rma(smd, sei=se, mods = ~ duration, data=dat, method="DL") rma(smd, sei=se, mods = ~ tailor, data=dat, method="DL") rma(smd, sei=se, mods = ~ pperf, data=dat, method="DL") rma(smd, sei=se, mods = ~ I(meetings * hours), data=dat, method="DL") ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.baskerville2012 dat ## Not run: ### load metafor package library(metafor) ### random-effects model res <- rma(smd, sei=se, data=dat, method="DL") print(res, digits=2) ### funnel plot funnel(res, xlab="Standardized Mean Difference", ylim=c(0,0.6)) ### rank and regression tests for funnel plot asymmetry ranktest(res) regtest(res) ### meta-regression analyses examining various potential moderators rma(smd, sei=se, mods = ~ score, data=dat, method="DL") rma(smd, sei=se, mods = ~ alloconc, data=dat, method="DL") rma(smd, sei=se, mods = ~ blind, data=dat, method="DL") rma(smd, sei=se, mods = ~ itt, data=dat, method="DL") rma(smd, sei=se, mods = ~ duration, data=dat, method="DL") rma(smd, sei=se, mods = ~ tailor, data=dat, method="DL") rma(smd, sei=se, mods = ~ pperf, data=dat, method="DL") rma(smd, sei=se, mods = ~ I(meetings * hours), data=dat, method="DL") ## End(Not run)
Results from 10 trials reporting the physicians' judgement on the overall efficacy of ketotifen for long-term control of asthma and wheeze in children.
dat.bassler2004
dat.bassler2004
The data frame contains the following columns:
study | character |
study label |
Ee | integer |
number of children with treament success (ketotifen group) |
Ne | integer |
number of children (ketotifen group) |
Ec | integer |
number of children with treament success (control group) |
Nc | integer |
number of children (control group) |
blind | character |
blinding of clinicians |
Results from 10 trials reporting the physicians' judgement on the overall efficacy of Ketotifen for long-term control of asthma and wheeze in children. A prespecified subgroup analysis was conducted to evaluate whether the treatment effect is different in trials with adequate blinding compared to trials with inadequate / unclear blinding.
This data set is used as an example in Schwarzer et al. (2015).
risk ratios, medicine, subgroup analysis
Guido Schwarzer, [email protected], https://github.com/guido-s/
Bassler D., Mitra A. A. D., Ducharme F. M., Forster J., & Schwarzer, G. (2004). Ketotifen alone or as additional medication for long-term control of asthma and wheeze in children. Cochrane Database of Systematic Reviews, 1, CD001384. https://doi.org/10.1002/14651858.CD001384.pub2
Schwarzer, G., Carpenter, J. R., & Rücker, G. (2015). Meta-analysis with R. Cham, Switzerland: Springer.
### Show full data set dat.bassler2004 ## Not run: ### Load meta package suppressPackageStartupMessages(library("meta")) ### Use DerSimonian-Laird estimator (which was the default in meta in the year 2015). ### Furthermore, print meta-analysis results with two digits. oldset <- settings.meta(method.tau = "DL", digits = 2) ### Calculate experimental and control event rates with(dat.bassler2004, summary(Ee / Ne)) with(dat.bassler2004, summary(Ec / Nc)) ### Conduct meta-analysis using the inverse variance method mb3 <- metabin(Ee, Ne, Ec, Nc, method = "I", data = dat.bassler2004, studlab = study) mb3 ### Conduct subgroup analysis comparing trials with adequate blinding ### to trials with inadequate or unclear blinding mb3s <- update(mb3, subgroup = blind, print.subgroup.name = FALSE) mb3s ### Conduct subgroup analysis assuming common between-study variance in subgroups mb3s.c <- update(mb3s, tau.common = TRUE) mb3s.c ### Use previous settings settings.meta(oldset) ## End(Not run)
### Show full data set dat.bassler2004 ## Not run: ### Load meta package suppressPackageStartupMessages(library("meta")) ### Use DerSimonian-Laird estimator (which was the default in meta in the year 2015). ### Furthermore, print meta-analysis results with two digits. oldset <- settings.meta(method.tau = "DL", digits = 2) ### Calculate experimental and control event rates with(dat.bassler2004, summary(Ee / Ne)) with(dat.bassler2004, summary(Ec / Nc)) ### Conduct meta-analysis using the inverse variance method mb3 <- metabin(Ee, Ne, Ec, Nc, method = "I", data = dat.bassler2004, studlab = study) mb3 ### Conduct subgroup analysis comparing trials with adequate blinding ### to trials with inadequate or unclear blinding mb3s <- update(mb3, subgroup = blind, print.subgroup.name = FALSE) mb3s ### Conduct subgroup analysis assuming common between-study variance in subgroups mb3s.c <- update(mb3s, tau.common = TRUE) mb3s.c ### Use previous settings settings.meta(oldset) ## End(Not run)
Results from 13 studies examining the effectiveness of the Bacillus Calmette-Guerin (BCG) vaccine against tuberculosis.
dat.bcg
dat.bcg
The data frame contains the following columns:
trial | numeric |
trial number |
author | character |
author(s) |
year | numeric |
publication year |
tpos | numeric |
number of TB positive cases in the treated (vaccinated) group |
tneg | numeric |
number of TB negative cases in the treated (vaccinated) group |
cpos | numeric |
number of TB positive cases in the control (non-vaccinated) group |
cneg | numeric |
number of TB negative cases in the control (non-vaccinated) group |
ablat | numeric |
absolute latitude of the study location (in degrees) |
alloc | character |
method of treatment allocation (random, alternate, or systematic assignment) |
The 13 studies provide data in terms of \(2 \times 2\) tables in the form:
TB positive | TB negative | |
vaccinated group | tpos |
tneg |
control group | cpos |
cneg
|
The goal of the meta-analysis was to examine the overall effectiveness of the BCG vaccine for preventing tuberculosis and to examine moderators that may potentially influence the size of the effect.
The dataset has been used in several publications to illustrate meta-analytic methods (see ‘References’).
medicine, risk ratios, meta-regression
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Colditz, G. A., Brewer, T. F., Berkey, C. S., Wilson, M. E., Burdick, E., Fineberg, H. V., & Mosteller, F. (1994). Efficacy of BCG vaccine in the prevention of tuberculosis: Meta-analysis of the published literature. Journal of the American Medical Association, 271(9), 698–702. https://doi.org/10.1001/jama.1994.03510330076038
Berkey, C. S., Hoaglin, D. C., Mosteller, F., & Colditz, G. A. (1995). A random-effects regression model for meta-analysis. Statistics in Medicine, 14(4), 395–411. https://doi.org/10.1002/sim.4780140406
van Houwelingen, H. C., Arends, L. R., & Stijnen, T. (2002). Advanced methods in meta-analysis: Multivariate approach and meta-regression. Statistics in Medicine, 21(4), 589–624. https://doi.org/10.1002/sim.1040
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
### copy data into 'dat' and examine data dat <- dat.bcg dat ## Not run: ### load metafor package library(metafor) ### calculate log risk ratios and corresponding sampling variances dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat, slab=paste0(author, ", ", year)) dat ### random-effects model res <- rma(yi, vi, data=dat) res ### average risk ratio with 95% CI predict(res, transf=exp) ### mixed-effects model with absolute latitude and publication year as moderators res <- rma(yi, vi, mods = ~ ablat + year, data=dat) res ### predicted average risk ratios for 10-60 degrees absolute latitude ### holding the publication year constant at 1970 predict(res, newmods=cbind(seq(from=10, to=60, by=10), 1970), transf=exp) ### note: the interpretation of the results is difficult because absolute ### latitude and publication year are strongly correlated (the more recent ### studies were conducted closer to the equator) plot(ablat ~ year, data=dat, pch=19, xlab="Publication Year", ylab="Absolute Lattitude") cor(dat$ablat, dat$year) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.bcg dat ## Not run: ### load metafor package library(metafor) ### calculate log risk ratios and corresponding sampling variances dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat, slab=paste0(author, ", ", year)) dat ### random-effects model res <- rma(yi, vi, data=dat) res ### average risk ratio with 95% CI predict(res, transf=exp) ### mixed-effects model with absolute latitude and publication year as moderators res <- rma(yi, vi, mods = ~ ablat + year, data=dat) res ### predicted average risk ratios for 10-60 degrees absolute latitude ### holding the publication year constant at 1970 predict(res, newmods=cbind(seq(from=10, to=60, by=10), 1970), transf=exp) ### note: the interpretation of the results is difficult because absolute ### latitude and publication year are strongly correlated (the more recent ### studies were conducted closer to the equator) plot(ablat ~ year, data=dat, pch=19, xlab="Publication Year", ylab="Absolute Lattitude") cor(dat$ablat, dat$year) ## End(Not run)
Results from controlled and uncontrolled studies on the effectiveness of allogeneic bone-marrow transplantation (BMT) and conventional chemotherapy (CMO) in the treatment of acute nonlymphocytic leukemia.
dat.begg1989
dat.begg1989
The data frame contains the following columns:
study | numeric |
study number |
trt | character |
treatment (BMT or CMO) |
arms | numeric |
number of arms in the study (1 = uncontrolled studies; 2 = controlled studies) |
yi | numeric |
2-year disease-free survival rates |
sei | numeric |
corresponding standard errors |
vi | numeric |
corresponding sampling variances |
The dataset includes the results from controlled and uncontrolled studies on the 2-year disease-free survival rate in patients with acute nonlymphocytic leukemia receiving either allogeneic bone-marrow transplantation (BMT) or conventional chemotherapy (CMO). In the controlled (two-arm) studies (studies 1-4), a cohort of patients in complete remission and potentially eligible for BMT was assembled, and those who consented and for whom a donor could be found received BMT, with the remaining patients used as controls (receiving CMO). In the uncontrolled (one-arm) studies (studies 5-16), only a single group was studied, receiving either BMT or CMO.
The data in this dataset were obtained from Table 1 in Begg and Pilote (1991, p. 902).
medicine, oncology, single-arm studies, multilevel models
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Begg, C. B., & Pilote, L. (1991). A model for incorporating historical controls into a meta-analysis. Biometrics, 47(3), 899–906. https://doi.org/10.2307/2532647
Begg, C. B., Pilote, L., & McGlave, P. B. (1989). Bone marrow transplantation versus chemotherapy in acute non-lymphocytic leukemia: A meta-analytic review. European Journal of Cancer and Clinical Oncology, 25(11), 1519–1523. https://doi.org/10.1016/0277-5379(89)90291-5
### copy data into 'dat' and examine data dat <- dat.begg1989 dat ## Not run: ### load metafor package library(metafor) ### turn trt and arms into factors and set reference levels dat$trt <- relevel(factor(dat$trt), ref="CMO") dat$arms <- relevel(factor(dat$arms), ref="2") ### create data frame with the treatment differences for the controlled studies dat2 <- data.frame(yi = dat$yi[c(1,3,5,7)] - dat$yi[c(2,4,6,8)], vi = dat$vi[c(1,3,5,7)] + dat$vi[c(2,4,6,8)]) dat2 ### DerSimonian and Laird method using the treatment differences res <- rma(yi, vi, data=dat2, method="DL", digits=2) res ### Begg & Pilote (1991) model incorporating the uncontrolled studies res <- rma.mv(yi, vi, mods = ~ trt, random = ~ 1 | study, data=dat, method="ML", digits=2) res ### model involving bias terms for the uncontrolled studies res <- rma.mv(yi, vi, mods = ~ trt + trt:arms, random = ~ 1 | study, data=dat, method="ML", digits=2) res ### model with a random treatment effect res <- rma.mv(yi, vi, mods = ~ trt, random = list(~ 1 | study, ~ trt | study), struct="UN", tau2=c(0,NA), rho=0, data=dat, method="ML", digits=2) res ### model with a random treatment effect, but with equal variances in both arms res <- rma.mv(yi, vi, mods = ~ trt, random = list(~ 1 | study, ~ trt | study), struct="CS", rho=0, data=dat, method="ML", digits=2) res ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.begg1989 dat ## Not run: ### load metafor package library(metafor) ### turn trt and arms into factors and set reference levels dat$trt <- relevel(factor(dat$trt), ref="CMO") dat$arms <- relevel(factor(dat$arms), ref="2") ### create data frame with the treatment differences for the controlled studies dat2 <- data.frame(yi = dat$yi[c(1,3,5,7)] - dat$yi[c(2,4,6,8)], vi = dat$vi[c(1,3,5,7)] + dat$vi[c(2,4,6,8)]) dat2 ### DerSimonian and Laird method using the treatment differences res <- rma(yi, vi, data=dat2, method="DL", digits=2) res ### Begg & Pilote (1991) model incorporating the uncontrolled studies res <- rma.mv(yi, vi, mods = ~ trt, random = ~ 1 | study, data=dat, method="ML", digits=2) res ### model involving bias terms for the uncontrolled studies res <- rma.mv(yi, vi, mods = ~ trt + trt:arms, random = ~ 1 | study, data=dat, method="ML", digits=2) res ### model with a random treatment effect res <- rma.mv(yi, vi, mods = ~ trt, random = list(~ 1 | study, ~ trt | study), struct="UN", tau2=c(0,NA), rho=0, data=dat, method="ML", digits=2) res ### model with a random treatment effect, but with equal variances in both arms res <- rma.mv(yi, vi, mods = ~ trt, random = list(~ 1 | study, ~ trt | study), struct="CS", rho=0, data=dat, method="ML", digits=2) res ## End(Not run)
Results from 5 trials comparing surgical and non-surgical treatments for medium-severity periodontal disease one year after treatment.
dat.berkey1998
dat.berkey1998
The data frame contains the following columns:
trial | numeric |
trial number |
author | character |
study author(s) |
year | numeric |
publication year |
ni | numeric |
number of patients |
outcome | character |
outcome (PD = probing depth; AL = attachment level) |
yi | numeric |
observed mean difference in outcome (surgical versus non-surgical) |
vi | numeric |
corresponding sampling variance |
v1i | numeric |
variances and covariances of the observed effects |
v2i | numeric |
variances and covariances of the observed effects |
The dataset includes the results from 5 trials that compared surgical and non-surgical methods for the treatment of medium-severity periodontal disease. Reported outcomes include the change in probing depth (PD) and attachment level (AL) one year after the treatment. The outcome measure used for this meta-analysis was the (raw) mean difference, calculated in such a way that positive values indicate that surgery was more effective than non-surgical treatment in decreasing the probing depth and increasing the attachment level (so, the results from the various trials indicate that surgery is preferable for reducing the probing depth, while non-surgical treatment is preferable for increasing the attachment level). Since each trial provides effect size estimates for both outcomes, the estimates are correlated. A multivariate model can be used to meta-analyze the two outcomes simultaneously.
The v1i
and v2i
values are the variances and covariances of the observed effects. In particular, for each study, variables v1i
and v2i
form a \(2 \times 2\) variance-covariance matrix of the observed effects, with the diagonal elements corresponding to the sampling variances of the mean differences (the first for probing depth, the second for attachment level) and the off-diagonal value corresponding to the covariance of the two mean differences. Below, the full (block diagonal) variance-covariance for all studies is constructed from these two variables.
medicine, dentistry, raw mean differences, multivariate models
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Berkey, C. S., Antczak-Bouckoms, A., Hoaglin, D. C., Mosteller, F., & Pihlstrom, B. L. (1995). Multiple-outcomes meta-analysis of treatments for periodontal disease. Journal of Dental Research, 74(4), 1030–1039. https://doi.org/10.1177/00220345950740040201
Berkey, C. S., Hoaglin, D. C., Antczak-Bouckoms, A., Mosteller, F., & Colditz, G. A. (1998). Meta-analysis of multiple outcomes by regression with random effects. Statistics in Medicine, 17(22), 2537–2550. https://doi.org/10.1002/(sici)1097-0258(19981130)17:22<2537::aid-sim953>3.0.co;2-c
### copy data into 'dat' and examine data dat <- dat.berkey1998 dat ## Not run: ### load metafor package library(metafor) ### construct block diagonal var-cov matrix of the observed outcomes based on variables v1i and v2i V <- vcalc(vi=1, cluster=author, rvars=c(v1i, v2i), data=dat) ### fit multiple outcomes (meta-regression) model (with REML estimation) res <- rma.mv(yi, V, mods = ~ 0 + outcome, random = ~ outcome | trial, struct="UN", data=dat) print(res, digits=3) ### test/estimate difference between the two outcomes anova(res, X=c(1,-1)) ### fit model including publication year as moderator for both outcomes (with ML estimation) res <- rma.mv(yi, V, mods = ~ 0 + outcome + outcome:I(year - 1983), random = ~ outcome | trial, struct="UN", data=dat, method="ML") print(res, digits=3) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.berkey1998 dat ## Not run: ### load metafor package library(metafor) ### construct block diagonal var-cov matrix of the observed outcomes based on variables v1i and v2i V <- vcalc(vi=1, cluster=author, rvars=c(v1i, v2i), data=dat) ### fit multiple outcomes (meta-regression) model (with REML estimation) res <- rma.mv(yi, V, mods = ~ 0 + outcome, random = ~ outcome | trial, struct="UN", data=dat) print(res, digits=3) ### test/estimate difference between the two outcomes anova(res, X=c(1,-1)) ### fit model including publication year as moderator for both outcomes (with ML estimation) res <- rma.mv(yi, V, mods = ~ 0 + outcome + outcome:I(year - 1983), random = ~ outcome | trial, struct="UN", data=dat, method="ML") print(res, digits=3) ## End(Not run)
Results from 46 studies synthesising maternal nutritional effects on coping styles in rodents.
dat.besson2016
dat.besson2016
The data frame contains the following columns:
comp_ID | character |
effect-size unique identifier |
study_ID | character |
study unique identifier |
dam_ID | character |
dam unique identifier (group of dams subjected to the same treatment) |
animal_ID | character |
offspring unique identifier (group of offspring from the same dam group subjected to the same treatment) |
Reference | character |
author’s names and date |
species | character |
species [rats or mice] |
strain | character |
strain |
manip_type | character |
maternal nutritional manipulation type [protein or calorie] |
manip_direction | character |
direction of maternal nutritional manipulation [- = restriction, + = overfeeding] |
nom_manip_val | character |
degree of maternal nutritional manipulation as described in the original publications [% = percentage of caloric or protein restriction, # = increase in caloric intake] |
exp | character |
percentage of caloric or protein maternal restriction or increase in caloric intake of the experimental group |
control | character |
percentage of caloric or protein maternal restriction or increase in caloric intake for the control group |
manip_parameter | character |
protein content, percentage fat or intake |
vitmin_eql | character |
were vitamins equalized across maternal diets? [yes or no] |
adlib_con | character |
were maternal control groups fed ad libitum? [yes or no] |
adlib_exp | character |
were maternal experimental groups fed ad libitum? [yes or no] |
diet_con | character |
name of maternal control diet? |
diet_exp | character |
name of maternal experimental diet? |
dam_diet_start_dPC | numeric |
start of the dam diet [in days post-conception] |
dam_diet_end_dPC | numeric |
end of the dam diet [in days post-conception] |
diet_label | character |
period of maternal diet manipulation [pregestation = pre-gestation, pre = pregnancy, lact = lactation, or pre+lact = pregnancy and lactation] |
age_mating | numeric |
dam age at mating if known |
n_con_dam | integer |
sample size of the control dam groups |
n_exp_dam | integer |
sample size of the experimental dam groups |
multi_use_con | character |
were control groups used multiple time? [yes or no] |
dam_housing | character |
how were dams housed? [pair, group, or single] |
temperature | numeric |
temperature during the experiment [°C] |
photoperiod | integer |
photoperiod during the experiment [number of hours of light] |
litter_size | integer |
size of the litter [number of pups per dam] |
litter_size_equalized | character |
has litter size been equalized? [yes or no] |
crossfostered | character |
have pups been cross-fostered? [yes or no] |
sex | character |
sex of the offspring that were tested [m = male, f = female, both = mixed sex] |
housing | character |
offspring housing during the test period [dam, pair, single, or group] |
bodymass_mean_contr | numeric |
mean body mass of control offspring close to or during the testing period [g] |
bodymass_SE_contr | numeric |
S.E. for body mass of control offspring close to or during the testing period |
bodymass_mean_exp | numeric |
mean body mass of experimental offspring close to or during the testing period [g] |
bodymass_SE_exp | numeric |
S.E. for body mass of experimental offspring close to or during the testing period |
bm_N_contr | integer |
sample size for body mass of control offspring close to or during the testing period |
bm_N_exp | integer |
sample size for body mass of experimental offspring close to or during the testing period |
bm_dPP | integer |
age of offspring when body mass was measured [in days post-parturition] |
offspring_diet | character |
offspring diet after weaning [type of control diet] |
offspring_con_adlib | character |
were control offspring fed ad libitum after weaning? [yes or no] |
offspring_diet_level | character |
name of offspring diet after weaning |
offspring_diet_end_dPP | integer |
end of the offspring diet [in days post-parturition] |
post_diet_adlib | character |
were experimental offspring fed ad libitum after weaning? [yes or no] |
response_age_dPP | numeric |
offspring age when behavioural testing started [in days post-parturition] |
authors_behaviour_classification | character |
author's classification of offspring behaviour [anxiety, exploration, or activity] |
our_behaviour_classification | character |
our classification of offspring behaviour [anxiety, exploration, or activity] |
response_test | character |
type of test used [elevated T-maze (ETM), open field, etc.] to measure offspring behaviour |
time_trial | integer |
duration of the testing [min] |
measure | character |
measures taken during testing [total distance moved, time spent in open arm, etc.] |
unit | character |
unit of the behavioural measure taken [min, s, m, number (#), etc.] |
high_better | character |
for activity and exploration, a higher number is assumed to be better (i.e., animals were more active), but the opposite was assumed for anxiety (i.e., they were more anxious) [yes or no] |
night.day | character |
time of day when behaviours were measured [night or day] |
comparison | character |
for a given control-treatment group comparison, animal group codes as used in the original article [e.g., LP, HP]. This field allows identification of exactly which data (i.e., comparison of which pairs of groups) were extracted from the original paper, and is not used in our analyses. For our analyses the groups were re-coded as control/experimental. |
exp_mean | numeric |
mean of the offspring behaviour measured for the experimental group |
exp_se | numeric |
S.E. of the offspring behaviour measured for the experimental group |
exp_n | integer |
sample size for the offspring experimental group |
con_mean | numeric |
mean of offspring behaviour measured for the control group |
con_se | numeric |
S.E. of the offspring behaviour measured for the control group |
con_n | integer |
sample size for the offspring control group |
con_ID | character |
identifier for shared control groups within experiment |
percentage | character |
is the offspring behaviour measure a percentage? [yes or no] |
Data_source | character |
figure or table number in the original paper from which the data were extracted |
measure_comments | character |
any comments on the offspring behaviour measures |
SE_imputed | character |
was S.E. imputed for the offspring behaviour measure? [yes or no] |
Comments | character |
any comments on the data |
Data from experiments where dams were subject to caloric or protein restriction or were overfed around gestation were included. Offspring activity, exploration, or anxiety were measured outcomes variables from maternal experimental treatments. Multilevel meta-analysis and meta-regression models were used to analyze the meta-analytic data.
ecology, evolution, standardized mean differences
Daniel Noble, [email protected]
Besson, A. A., Lagisz, M., Senior, A. M., Hector, K. L., & Nakagawa, S. (2016). Effect of maternal diet on offspring coping styles in rodents: A systematic review and meta-analysis. Biological Reviews, 91(4), 1065–1080. https://doi.org/10.1111/brv.12210
### copy data into 'dat' and examine data dat <- dat.besson2016 head(dat) ## Not run: ### load metafor library(metafor) ### compute SD from SE dat$sd_c <- with(dat, con_se * sqrt(con_n)) dat$sd_e <- with(dat, exp_se * sqrt(exp_n)) ### compute standardized mean differences and corresponding sampling variances dat <- escalc(measure="SMD", m1i=exp_mean, m2i=con_mean, sd1i=sd_e, sd2i=sd_c, n1i=exp_n, n2i=con_n, data=dat, add.measure=TRUE) ### fit model mod1 <- rma.mv(yi ~ 1, V = vi, random = list(~ 1 | study_ID, ~ 1 | comp_ID), data = dat) mod1 ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.besson2016 head(dat) ## Not run: ### load metafor library(metafor) ### compute SD from SE dat$sd_c <- with(dat, con_se * sqrt(con_n)) dat$sd_e <- with(dat, exp_se * sqrt(exp_n)) ### compute standardized mean differences and corresponding sampling variances dat <- escalc(measure="SMD", m1i=exp_mean, m2i=con_mean, sd1i=sd_e, sd2i=sd_c, n1i=exp_n, n2i=con_n, data=dat, add.measure=TRUE) ### fit model mod1 <- rma.mv(yi ~ 1, V = vi, random = list(~ 1 | study_ID, ~ 1 | comp_ID), data = dat) mod1 ## End(Not run)
Results from 9 studies on the reliability of the Center for Epidemiologic Studies Depression (CES-D) Scale administered to children providing care to an elderly parent.
dat.bonett2010
dat.bonett2010
The data frame contains the following columns:
study | numeric |
study number |
source | character |
source of data |
ni | numeric |
sample size |
mi | numeric |
number of items in the scale |
ai | numeric |
observed value of Cronbach's alpha |
caregivers | character |
gender of the children in the sample |
The Center for Epidemiologic Studies Depression (CES-D) Scale is a 20-item questionnaire assessing various symptoms of depression, with each item scored on a 4-point scale. The scale has been used in several studies to examine depressive symptoms in children providing care to an elderly parent. The dataset includes information on the reliability of the scale as measured with Cronbach's alpha in 9 such studies. Also, the gender composition of the children in each sample is indicated.
psychology, Cronbach's alpha, reliability generalization, meta-regression
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Bonett, D. G. (2010). Varying coefficient meta-analytic methods for alpha reliability. Psychological Methods, 15(4), 368–385. https://doi.org/10.1037/a0020142
Bonett, D. G. (2002). Sample size requirements for testing and estimating coefficient alpha. Journal of Educational and Behavioral Statistics, 27(4), 335–340. https://doi.org/10.3102/10769986027004335
Hakstian, A. R., & Whalen, T. E. (1976). A k-sample significance test for independent alpha coefficients. Psychometrika, 41(2), 219–231. https://doi.org/10.1007/BF02291840
### copy data into 'dat' and examine data dat <- dat.bonett2010 dat ## Not run: ### load metafor package library(metafor) ### meta-analysis using the raw alpha values res <- rma(measure="ARAW", ai=ai, mi=mi, ni=ni, data=dat) res ### meta-analysis using transformed alpha values (using the ### transformation suggested by Hakstian & Whalen, 1976) res <- rma(measure="AHW", ai=ai, mi=mi, ni=ni, data=dat) res predict(res, transf=transf.iahw) ### meta-analysis using transformed alpha values (using the ### transformation suggested by Bonett, 2002) res <- rma(measure="ABT", ai=ai, mi=mi, ni=ni, data=dat) res predict(res, transf=transf.iabt) ### forest plot forest(res, slab=source, header=TRUE, top=2, xlim=c(0,4.5), atransf=transf.iabt, refline=coef(res)) ### examine whether female/mixed samples yield different alphas (with raw alphas) res <- rma(measure="ARAW", ai=ai, mi=mi, ni=ni, mods = ~ caregivers, data=dat) res predict(res, newmods=c(0,1), digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.bonett2010 dat ## Not run: ### load metafor package library(metafor) ### meta-analysis using the raw alpha values res <- rma(measure="ARAW", ai=ai, mi=mi, ni=ni, data=dat) res ### meta-analysis using transformed alpha values (using the ### transformation suggested by Hakstian & Whalen, 1976) res <- rma(measure="AHW", ai=ai, mi=mi, ni=ni, data=dat) res predict(res, transf=transf.iahw) ### meta-analysis using transformed alpha values (using the ### transformation suggested by Bonett, 2002) res <- rma(measure="ABT", ai=ai, mi=mi, ni=ni, data=dat) res predict(res, transf=transf.iabt) ### forest plot forest(res, slab=source, header=TRUE, top=2, xlim=c(0,4.5), atransf=transf.iabt, refline=coef(res)) ### examine whether female/mixed samples yield different alphas (with raw alphas) res <- rma(measure="ARAW", ai=ai, mi=mi, ni=ni, mods = ~ caregivers, data=dat) res predict(res, newmods=c(0,1), digits=2) ## End(Not run)
Results from 21 studies on gender differences in grant and fellowship awards.
dat.bornmann2007
dat.bornmann2007
The data frame contains the following columns:
study | character |
study reference |
obs | numeric |
observation within study |
doctype | character |
document type |
gender | character |
gender of the study authors |
year | numeric |
(average) cohort year |
org | character |
funding organization / program |
country | character |
country of the funding organization / program |
type | character |
fellowship or grant application |
discipline | character |
discipline / field |
waward | numeric |
number of women who received a grant/fellowship award |
wtotal | numeric |
number of women who applied for an award |
maward | numeric |
number of men who received a grant/fellowship award |
mtotal | numeric |
number of men who applied for an award |
The studies in this dataset examine whether the chances of receiving a grant or fellowship award differs for men and women. Note that many studies provide multiple comparisons (e.g., for different years / cohorts / disciplines). A multilevel meta-analysis model can be used to account for the multilevel structure in these data.
sociology, odds ratios, multilevel models
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Bornmann, L., Mutz, R., & Daniel, H. (2007). Gender differences in grant peer review: A meta-analysis. Journal of Informetrics, 1(3), 226–238. https://doi.org/10.1016/j.joi.2007.03.001
Marsh, H. W., Bornmann, L., Mutz, R., Daniel, H.-D., & O'Mara, A. (2009). Gender effects in the peer reviews of grant proposals: A comprehensive meta-analysis comparing traditional and multilevel approaches. Review of Educational Research, 79(3), 1290–1326. https://doi.org/10.3102/0034654309334143
### copy data into 'dat' and examine data dat <- dat.bornmann2007 head(dat, 16) ## Not run: ### load metafor package library(metafor) ### calculate log odds ratios and corresponding sampling variances dat <- escalc(measure="OR", ai=waward, n1i=wtotal, ci=maward, n2i=mtotal, data=dat) ### fit multilevel meta-analysis model res <- rma.mv(yi, vi, random = ~ 1 | study/obs, data=dat) res ### estimated average odds ratio (with 95% CI/PI) predict(res, transf=exp, digits=2) ### test for a difference between fellowship and grant applications res <- rma.mv(yi, vi, mods = ~ type, random = ~ 1 | study/obs, data=dat) res predict(res, newmods=0:1, transf=exp, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.bornmann2007 head(dat, 16) ## Not run: ### load metafor package library(metafor) ### calculate log odds ratios and corresponding sampling variances dat <- escalc(measure="OR", ai=waward, n1i=wtotal, ci=maward, n2i=mtotal, data=dat) ### fit multilevel meta-analysis model res <- rma.mv(yi, vi, random = ~ 1 | study/obs, data=dat) res ### estimated average odds ratio (with 95% CI/PI) predict(res, transf=exp, digits=2) ### test for a difference between fellowship and grant applications res <- rma.mv(yi, vi, mods = ~ type, random = ~ 1 | study/obs, data=dat) res predict(res, newmods=0:1, transf=exp, digits=2) ## End(Not run)
Results from 47 studies on the association between handedness and eye-dominance.
dat.bourassa1996
dat.bourassa1996
The data frame contains the following columns:
study | numeric |
study number |
sample | numeric |
sample number |
author | character |
(first) author |
year | numeric |
publication year |
selection | character |
selection of subjects on the basis of eyedness or handedness |
investigator | character |
investigator (psychologist, educationalist, or other) |
hand_assess | character |
method to assess handedness (questionnaire or performance based) |
eye_assess | character |
method to assess eyedness (see ‘Details’) |
mage | numeric |
mean age of sample |
lh.le | numeric |
number of left-handed left-eyed individuals |
lh.re | numeric |
number of left-handed right-eyed individuals |
rh.le | numeric |
number of right-handed left-eyed individuals |
rh.re | numeric |
number of right-handed right-eyed individuals |
sex | character |
sex of the sample (combined, male, or female) |
The 47 studies included in this meta-analysis examined the association between handedness and eye-dominance (ocular dominance or eyedness). Results are given in terms of \(2 \times 2\) tables, indicating the number of left-handed left-eyed, left-handed right-eyed, right-handed left-eyed, and right-handed right-eyed individuals. Note that some studies included multiple (independent) samples, so that the meta-analysis included 54 samples in total. Also, for some studies, the combined data of the males and females are further broken down into the two subgroups.
In some studies, there was indication that the selection of subjects was not random with respect to handedness and/or eyedness. While this should not influence the size of the association as measured with the odds ratio, this invalidates those studies for assessing the overall percentage of left-eyed and left-handed individuals.
Handedness was assessed in the individual studies either based on a questionnaire or inventory or based on task performance. Eyedness was assessed based on various methods: E.1
methods are based on task performance, while E.2.a
denotes assessment based on a questionnaire. The performance based methods could be further broken down into: E.1.a.i
(monocular procedure with object/instrument held in one hand), E.1.a.ii
(monocular procedure with object/instrument held in both hands), E.1.b
(binocular procedure), E.1.c
(a combination of the previous methods), and E.1.d
(some other method).
psychology, odds ratios
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Bourassa, D. C., McManus, I. C., & Bryden, M. P. (1996). Handedness and eye-dominance: A meta-analysis of their relationship. Laterality, 1(1), 5–34. https://doi.org/10.1080/713754206
### copy data into 'dat' and examine data dat <- dat.bourassa1996 head(dat, 10) ## Not run: ### load metafor package library(metafor) ### calculate log(OR) and corresponding sampling variance with 1/2 correction dat <- escalc(measure="OR", ai=lh.le, bi=lh.re, ci=rh.le, di=rh.re, data=dat, add=1/2, to="all") head(dat, 10) ### overall association between handedness and eyedness res <- rma(yi, vi, data=dat, subset=sex=="combined") res predict(res, transf=exp, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.bourassa1996 head(dat, 10) ## Not run: ### load metafor package library(metafor) ### calculate log(OR) and corresponding sampling variance with 1/2 correction dat <- escalc(measure="OR", ai=lh.le, bi=lh.re, ci=rh.le, di=rh.re, data=dat, add=1/2, to="all") head(dat, 10) ### overall association between handedness and eyedness res <- rma(yi, vi, data=dat, subset=sex=="combined") res predict(res, transf=exp, digits=2) ## End(Not run)
Results from 4 trials examining the effectiveness of intensive (high dose) versus moderate (standard dose) statin therapy for preventing coronary death or myocardial infarction.
dat.cannon2006
dat.cannon2006
The data frame contains the following columns:
trial | character |
trial name |
pop | character |
study population (post-ACS: post acute coronary syndrome; stable CAD: stable coronary artery disease) |
nt | numeric |
number of patients in the high dose group |
nc | numeric |
number of patients in the standard dose group |
ep1t | numeric |
number of events in the high dose group for end point 1: coronary death or non-fatal myocardial infarction |
ep1c | numeric |
number of events in the standard dose group for end point 1: coronary death or non-fatal myocardial infarction |
ep2t | numeric |
number of events in the high dose group for end point 2: coronary death or any cardiovascular event (MI, stroke, hospitalization for unstable angina, or revascularization) |
ep2c | numeric |
number of events in the standard dose group for end point 2: coronary death or any cardiovascular event (MI, stroke, hospitalization for unstable angina, or revascularization) |
ep3t | numeric |
number of events in the high dose group for end point 3: cardiovascular death |
ep3c | numeric |
number of events in the standard dose group for end point 3: cardiovascular death |
ep4t | numeric |
number of events in the high dose group for end point 4: non-cardiovascular death |
ep4c | numeric |
number of events in the standard dose group for end point 4: non-cardiovascular death |
ep5t | numeric |
number of events in the high dose group for end point 5: deaths (all-cause mortality) |
ep5c | numeric |
number of events in the standard dose group for end point 5: deaths (all-cause mortality) |
ep6t | numeric |
number of events in the high dose group for end point 6: stroke |
ep6c | numeric |
number of events in the standard dose group for end point 6: stroke |
The data were obtained from Figures 2, 3, 4, and 5 in Cannon et al. (2006). The authors used the Mantel-Haenszel method for combining the results from the 4 trials. This approach is implemented in the rma.mh
function.
medicine, cardiology, odds ratios, Mantel-Haenszel method
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Cannon, C. P., Steinberg, B. A., Murphy, S. A., Mega, J. L., & Braunwald, E. (2006). Meta-analysis of cardiovascular outcomes trials comparing intensive versus moderate statin therapy. Journal of the American College of Cardiology, 48(3), 438–445. https://doi.org/10.1016/j.jacc.2006.04.070
### copy data into 'dat' and examine data dat <- dat.cannon2006 dat ## Not run: ### load metafor package library(metafor) ### meta-analysis of log odds ratios using the MH method for endpoint 1 res <- rma.mh(measure="OR", ai=ep1t, n1i=nt, ci=ep1c, n2i=nc, data=dat, slab=trial) print(res, digits=2) ### forest plot forest(res, xlim=c(-.8,.8), atransf=exp, at=log(c(2/3, 1, 3/2)), header=TRUE, top=2, cex=1.2, xlab="Odds Ratio") mtext("(high dose better)", side=1, line=par("mgp")[1]-0.5, at=log(2/3), cex=1.2, font=3) mtext("(standard dose better)", side=1, line=par("mgp")[1]-0.5, at=log(3/2), cex=1.2, font=3) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.cannon2006 dat ## Not run: ### load metafor package library(metafor) ### meta-analysis of log odds ratios using the MH method for endpoint 1 res <- rma.mh(measure="OR", ai=ep1t, n1i=nt, ci=ep1c, n2i=nc, data=dat, slab=trial) print(res, digits=2) ### forest plot forest(res, xlim=c(-.8,.8), atransf=exp, at=log(c(2/3, 1, 3/2)), header=TRUE, top=2, cex=1.2, xlab="Odds Ratio") mtext("(high dose better)", side=1, line=par("mgp")[1]-0.5, at=log(2/3), cex=1.2, font=3) mtext("(standard dose better)", side=1, line=par("mgp")[1]-0.5, at=log(3/2), cex=1.2, font=3) ## End(Not run)
Results from 20 studies on the correlation between course instructor ratings and student achievement.
dat.cohen1981
dat.cohen1981
The data frame contains the following columns:
study | character |
study author(s) and year |
sample | character |
course type |
control | character |
ability control |
ni | numeric |
sample size of the study (number of sections) |
ri | numeric |
observed correlation |
The studies included in this dataset examined to what extent students' ratings of a course instructor correlated with their achievement in the course. Instead of correlating individual ratings and achievement scores, the studies were carried out in multisection courses, in which the sections had different instructors but all sections used a common achievement measure (e.g., a final exam). The correlation coefficients reflect the correlation between the mean instructor rating and the mean achievement score of each section. Hence, the unit of analysis are the sections, not the individuals.
Note that this dataset (extracted from Table A.3 in Cooper & Hedges, 1994) only contains studies with at least 10 sections.
education, correlation coefficients
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Cooper, H., & Hedges, L. V. (1994). Appendix A: Data Sets. In H. Cooper & L. V. Hedges (Eds.), The handbook of research synthesis (pp. 543–547). New York: Russell Sage Foundation.
Cohen, P. A. (1981). Student ratings of instruction and student achievement: A meta-analysis of multisection validity studies. Review of Educational Research, 51(3), 281–309. https://doi.org/10.3102/00346543051003281
### copy data into 'dat' and examine data dat <- dat.cohen1981 dat[c(1,4,5)] ## Not run: ### load metafor package library(metafor) ### calculate r-to-z transformed correlations and corresponding sampling variances dat <- escalc(measure="ZCOR", ri=ri, ni=ni, data=dat[c(1,4,5)]) dat ### meta-analysis of the transformed correlations using a random-effects model res <- rma(yi, vi, data=dat, digits=2) res ### predicted average correlation with 95% CI predict(res, transf=transf.ztor) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.cohen1981 dat[c(1,4,5)] ## Not run: ### load metafor package library(metafor) ### calculate r-to-z transformed correlations and corresponding sampling variances dat <- escalc(measure="ZCOR", ri=ri, ni=ni, data=dat[c(1,4,5)]) dat ### meta-analysis of the transformed correlations using a random-effects model res <- rma(yi, vi, data=dat, digits=2) res ### predicted average correlation with 95% CI predict(res, transf=transf.ztor) ## End(Not run)
Results from 13 studies examining the effectiveness of the Bacillus Calmette-Guerin (BCG) vaccine against tuberculosis.
dat.colditz1994
dat.colditz1994
The data frame contains the following columns:
trial | numeric |
trial number |
author | character |
author(s) |
year | numeric |
publication year |
tpos | numeric |
number of TB positive cases in the treated (vaccinated) group |
tneg | numeric |
number of TB negative cases in the treated (vaccinated) group |
cpos | numeric |
number of TB positive cases in the control (non-vaccinated) group |
cneg | numeric |
number of TB negative cases in the control (non-vaccinated) group |
ablat | numeric |
absolute latitude of the study location (in degrees) |
alloc | character |
method of treatment allocation (random, alternate, or systematic assignment) |
The 13 studies provide data in terms of \(2 \times 2\) tables in the form:
TB positive | TB negative | |
vaccinated group | tpos |
tneg |
control group | cpos |
cneg
|
The goal of the meta-analysis was to examine the overall effectiveness of the BCG vaccine for preventing tuberculosis and to examine moderators that may potentially influence the size of the effect.
The dataset has been used in several publications to illustrate meta-analytic methods (see ‘References’).
medicine, risk ratios, meta-regression
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Colditz, G. A., Brewer, T. F., Berkey, C. S., Wilson, M. E., Burdick, E., Fineberg, H. V., & Mosteller, F. (1994). Efficacy of BCG vaccine in the prevention of tuberculosis: Meta-analysis of the published literature. Journal of the American Medical Association, 271(9), 698–702. https://doi.org/10.1001/jama.1994.03510330076038
Berkey, C. S., Hoaglin, D. C., Mosteller, F., & Colditz, G. A. (1995). A random-effects regression model for meta-analysis. Statistics in Medicine, 14(4), 395–411. https://doi.org/10.1002/sim.4780140406
van Houwelingen, H. C., Arends, L. R., & Stijnen, T. (2002). Advanced methods in meta-analysis: Multivariate approach and meta-regression. Statistics in Medicine, 21(4), 589–624. https://doi.org/10.1002/sim.1040
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
### copy data into 'dat' and examine data dat <- dat.colditz1994 dat ## Not run: ### load metafor package library(metafor) ### calculate log risk ratios and corresponding sampling variances dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat, slab=paste0(author, ", ", year)) dat ### random-effects model res <- rma(yi, vi, data=dat) res ### average risk ratio with 95% CI predict(res, transf=exp) ### mixed-effects model with absolute latitude and publication year as moderators res <- rma(yi, vi, mods = ~ ablat + year, data=dat) res ### predicted average risk ratios for 10-60 degrees absolute latitude ### holding the publication year constant at 1970 predict(res, newmods=cbind(seq(from=10, to=60, by=10), 1970), transf=exp) ### note: the interpretation of the results is difficult because absolute ### latitude and publication year are strongly correlated (the more recent ### studies were conducted closer to the equator) plot(ablat ~ year, data=dat, pch=19, xlab="Publication Year", ylab="Absolute Lattitude") cor(dat$ablat, dat$year) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.colditz1994 dat ## Not run: ### load metafor package library(metafor) ### calculate log risk ratios and corresponding sampling variances dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat, slab=paste0(author, ", ", year)) dat ### random-effects model res <- rma(yi, vi, data=dat) res ### average risk ratio with 95% CI predict(res, transf=exp) ### mixed-effects model with absolute latitude and publication year as moderators res <- rma(yi, vi, mods = ~ ablat + year, data=dat) res ### predicted average risk ratios for 10-60 degrees absolute latitude ### holding the publication year constant at 1970 predict(res, newmods=cbind(seq(from=10, to=60, by=10), 1970), transf=exp) ### note: the interpretation of the results is difficult because absolute ### latitude and publication year are strongly correlated (the more recent ### studies were conducted closer to the equator) plot(ablat ~ year, data=dat, pch=19, xlab="Publication Year", ylab="Absolute Lattitude") cor(dat$ablat, dat$year) ## End(Not run)
Results from studies examining the effectiveness of histamine H2 antagonists (cimetidine or ranitidine) in treating patients with acute upper gastrointestinal hemorrhage.
dat.collins1985a
dat.collins1985a
The data frame contains the following columns:
id | numeric |
study number |
trial | character |
first author of trial |
year | numeric |
year of publication |
ref | numeric |
reference number |
trt | character |
C = cimetidine, R = ranitidine |
ctrl | character |
P = placebo, AA = antacids, UT = usual treatment |
nti | numeric |
number of patients in treatment group |
b.xti | numeric |
number of patients in treatment group with persistent or recurrent bleedings |
o.xti | numeric |
number of patients in treatment group in need of operation |
d.xti | numeric |
number of patients in treatment group that died |
nci | numeric |
number of patients in control group |
b.xci | numeric |
number of patients in control group with persistent or recurrent bleedings |
o.xci | numeric |
number of patients in control group in need of operation |
d.xci | numeric |
number of patients in control group that died |
The data were obtained from Tables 1 and 2 in Collins and Langman (1985). The authors used Peto's (one-step) method for meta-analyzing the 27 trials. This approach is implemented in the rma.peto
function. Using the same dataset, van Houwelingen, Zwinderman, and Stijnen (1993) describe some alternative approaches for analyzing these data, including fixed- and random-effects conditional logistic models. Those are implemented in the rma.glmm
function.
medicine, odds ratios, Peto's method, generalized linear models
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Collins, R., & Langman, M. (1985). Treatment with histamine H2 antagonists in acute upper gastrointestinal hemorrhage. New England Journal of Medicine, 313(11), 660–666. https://doi.org/10.1056/NEJM198509123131104
van Houwelingen, H. C., Zwinderman, K. H., & Stijnen, T. (1993). A bivariate approach to meta-analysis. Statistics in Medicine, 12(24), 2273–2284. https://doi.org/10.1002/sim.4780122405
### copy data into 'dat' and examine data dat <- dat.collins1985a dat ## Not run: ### load metafor package library(metafor) ### meta-analysis of log ORs using Peto's method (outcome: persistent or recurrent bleedings) res <- rma.peto(ai=b.xti, n1i=nti, ci=b.xci, n2i=nci, data=dat) print(res, digits=2) ### meta-analysis of log ORs using a conditional logistic regression model (FE model) res <- rma.glmm(measure="OR", ai=b.xti, n1i=nti, ci=b.xci, n2i=nci, data=dat, model="CM.EL", method="FE") summary(res) predict(res, transf=exp, digits=2) ### plot the likelihoods of the odds ratios llplot(measure="OR", ai=b.xti, n1i=nti, ci=b.xci, n2i=nci, data=dat, lwd=1, refline=NA, xlim=c(-4,4), drop00=FALSE) ### meta-analysis of log odds ratios using a conditional logistic regression model (RE model) res <- rma.glmm(measure="OR", ai=b.xti, n1i=nti, ci=b.xci, n2i=nci, data=dat, model="CM.EL", method="ML") summary(res) predict(res, transf=exp, digits=2) ### meta-analysis of log ORs using Peto's method (outcome: need for surgery) res <- rma.peto(ai=o.xti, n1i=nti, ci=o.xci, n2i=nci, data=dat) print(res, digits=2) ### meta-analysis of log ORs using Peto's method (outcome: death) res <- rma.peto(ai=d.xti, n1i=nti, ci=d.xci, n2i=nci, data=dat) print(res, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.collins1985a dat ## Not run: ### load metafor package library(metafor) ### meta-analysis of log ORs using Peto's method (outcome: persistent or recurrent bleedings) res <- rma.peto(ai=b.xti, n1i=nti, ci=b.xci, n2i=nci, data=dat) print(res, digits=2) ### meta-analysis of log ORs using a conditional logistic regression model (FE model) res <- rma.glmm(measure="OR", ai=b.xti, n1i=nti, ci=b.xci, n2i=nci, data=dat, model="CM.EL", method="FE") summary(res) predict(res, transf=exp, digits=2) ### plot the likelihoods of the odds ratios llplot(measure="OR", ai=b.xti, n1i=nti, ci=b.xci, n2i=nci, data=dat, lwd=1, refline=NA, xlim=c(-4,4), drop00=FALSE) ### meta-analysis of log odds ratios using a conditional logistic regression model (RE model) res <- rma.glmm(measure="OR", ai=b.xti, n1i=nti, ci=b.xci, n2i=nci, data=dat, model="CM.EL", method="ML") summary(res) predict(res, transf=exp, digits=2) ### meta-analysis of log ORs using Peto's method (outcome: need for surgery) res <- rma.peto(ai=o.xti, n1i=nti, ci=o.xci, n2i=nci, data=dat) print(res, digits=2) ### meta-analysis of log ORs using Peto's method (outcome: death) res <- rma.peto(ai=d.xti, n1i=nti, ci=d.xci, n2i=nci, data=dat) print(res, digits=2) ## End(Not run)
Results from 9 studies examining the effects of diuretics in pregnancy on various outcomes.
dat.collins1985b
dat.collins1985b
The data frame contains the following columns:
id | numeric |
study number |
author | character |
study author(s) |
year | numeric |
publication year |
pre.nti | numeric |
number of women in treatment group followed up for pre-eclampsia outcome |
pre.nci | numeric |
number of women in control/placebo group followed up for pre-eclampsia outcome |
pre.xti | numeric |
number of women in treatment group with any form of pre-eclampsia |
pre.xci | numeric |
number of women in control/placebo group with any form of pre-eclampsia |
oedema | numeric |
dummy variable indicating whether oedema was a diagnostic criterion |
fup.nti | numeric |
number of women in treatment group followed up for mortality outcomes |
fup.nci | numeric |
number of women in control/placebo group followed up for mortality outcomes |
ped.xti | numeric |
number of perinatal deaths in treatment group |
ped.xci | numeric |
number of perinatal deaths in control/placebo group |
stb.xti | numeric |
number of stillbirths in treatment group |
stb.xci | numeric |
number of stillbirths in control/placebo group |
ned.xti | numeric |
number of neonatal deaths in treatment group |
ned.xci | numeric |
number of neonatal deaths in control/placebo group |
The 9 studies in this dataset examined the effects of diuretics in pregnancy on various outcomes, including the presence of any form of pre-eclampsia, perinatal death, stillbirth, and neonatal death.
medicine, obstetrics, odds ratios, Peto's method
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Collins, R., Yusuf, S., & Peto, R. (1985). Overview of randomised trials of diuretics in pregnancy. British Medical Journal, 290(6461), 17–23. https://doi.org/10.1136/bmj.290.6461.17
### copy data into 'dat' and examine data dat <- dat.collins1985b dat ## Not run: ### load metafor package library(metafor) ### calculate (log) odds ratio and sampling variance dat <- escalc(measure="OR", n1i=pre.nti, n2i=pre.nci, ai=pre.xti, ci=pre.xci, data=dat) summary(dat, digits=2, transf=exp) ### meta-analysis using Peto's method for any form of pre-eclampsia rma.peto(n1i=pre.nti, n2i=pre.nci, ai=pre.xti, ci=pre.xci, data=dat, digits=2) ### meta-analysis including only studies where oedema was not a diagnostic criterion rma.peto(n1i=pre.nti, n2i=pre.nci, ai=pre.xti, ci=pre.xci, data=dat, digits=2, subset=(oedema==0)) ### meta-analyses of mortality outcomes (perinatal deaths, stillbirths, and neonatal deaths) rma.peto(n1i=fup.nti, n2i=fup.nci, ai=ped.xti, ci=ped.xci, data=dat, digits=2) rma.peto(n1i=fup.nti, n2i=fup.nci, ai=stb.xti, ci=stb.xci, data=dat, digits=2) rma.peto(n1i=fup.nti, n2i=fup.nci, ai=ned.xti, ci=ned.xci, data=dat, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.collins1985b dat ## Not run: ### load metafor package library(metafor) ### calculate (log) odds ratio and sampling variance dat <- escalc(measure="OR", n1i=pre.nti, n2i=pre.nci, ai=pre.xti, ci=pre.xci, data=dat) summary(dat, digits=2, transf=exp) ### meta-analysis using Peto's method for any form of pre-eclampsia rma.peto(n1i=pre.nti, n2i=pre.nci, ai=pre.xti, ci=pre.xci, data=dat, digits=2) ### meta-analysis including only studies where oedema was not a diagnostic criterion rma.peto(n1i=pre.nti, n2i=pre.nci, ai=pre.xti, ci=pre.xci, data=dat, digits=2, subset=(oedema==0)) ### meta-analyses of mortality outcomes (perinatal deaths, stillbirths, and neonatal deaths) rma.peto(n1i=fup.nti, n2i=fup.nci, ai=ped.xti, ci=ped.xci, data=dat, digits=2) rma.peto(n1i=fup.nti, n2i=fup.nci, ai=stb.xti, ci=stb.xci, data=dat, digits=2) rma.peto(n1i=fup.nti, n2i=fup.nci, ai=ned.xti, ci=ned.xci, data=dat, digits=2) ## End(Not run)
Results from 10 studies on the relationship between the Competitive State Anxiety Inventory-2 (CSAI-2) and sport performance.
dat.craft2003
dat.craft2003
The data frame contains the following columns:
study | numeric |
study number |
ni | numeric |
sample size |
sport | character |
type of sport (T = team sport, I = individual sport) |
ri | numeric |
correlation coefficient |
var1 | character |
variable 1 of the correlation coefficient (see ‘Details’) |
var2 | character |
variable 2 of the correlation coefficient (see ‘Details’) |
The 10 studies included in this dataset are a subset of the studies included in the meta-analysis by Craft et al. (2003) on the relationship between the Competitive State Anxiety Inventory-2 (CSAI-2) and sport performance.
The CSAI-2 has three subscales: cognitive anxiety (acog
), somatic anxiety (asom
), and self-confidence (conf
). The studies included in this dataset administered the CSAI-2 prior to some sport competition and then measured sport performance based on the competition. Most studies provided all 6 correlations (3 for the correlations among the 3 subscales and 3 for the correlations between the subscales and sport performance), but 2 studies (with study numbers 6 and 17) only provided a subset.
psychology, correlation coefficients, multivariate models
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Becker, B. J., & Aloe, A. M. (2019). Model-based meta-analysis and related approaches. In H. Cooper, L. V. Hedges, & J. C. Valentine (Eds.), The handbook of research synthesis and meta-analysis (3nd ed., pp. 339–363). New York: Russell Sage Foundation.
Craft, L. L., Magyar, T. M., Becker, B. J., & Feltz, D. L. (2003). The relationship between the Competitive State Anxiety Inventory-2 and sport performance: A meta-analysis. Journal of Sport and Exercise Psychology, 25(1), 44–65. https://doi.org/10.1123/jsep.25.1.44
### copy data into 'dat' and examine data dat <- dat.craft2003 head(dat, 18) ## Not run: ### load metafor package library(metafor) ### construct dataset and var-cov matrix of the correlations tmp <- rcalc(ri ~ var1 + var2 | study, ni=ni, data=dat) V <- tmp$V dat <- tmp$dat ### examine data for study 1 dat[dat$study == 1,] V[dat$study == 1, dat$study == 1] ### examine data for study 6 dat[dat$study == 6,] V[dat$study == 6, dat$study == 6] ### examine data for study 17 dat[dat$study == 17,] V[dat$study == 17, dat$study == 17] ### multivariate random-effects model res <- rma.mv(yi, V, mods = ~ 0 + var1.var2, random = ~ var1.var2 | study, struct="UN", data=dat) res ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.craft2003 head(dat, 18) ## Not run: ### load metafor package library(metafor) ### construct dataset and var-cov matrix of the correlations tmp <- rcalc(ri ~ var1 + var2 | study, ni=ni, data=dat) V <- tmp$V dat <- tmp$dat ### examine data for study 1 dat[dat$study == 1,] V[dat$study == 1, dat$study == 1] ### examine data for study 6 dat[dat$study == 6,] V[dat$study == 6, dat$study == 6] ### examine data for study 17 dat[dat$study == 17,] V[dat$study == 17, dat$study == 17] ### multivariate random-effects model res <- rma.mv(yi, V, mods = ~ 0 + var1.var2, random = ~ var1.var2 | study, struct="UN", data=dat) res ## End(Not run)
Results from 68 studies on the relationship between class attendence and class performance and/or grade point average in college students.
dat.crede2010
dat.crede2010
The data frame contains the following columns:
studyid | numeric |
study number |
year | numeric |
publication year |
source | character |
study source (journal, dissertation, other) |
sampleid | numeric |
sample within study number |
criterion | character |
criterion variable (grade, gpa) |
class | character |
class type (science, nonscience) |
ni | numeric |
sample size |
ri | numeric |
observed correlation |
The 68 studies included in this dataset provide information about the relationship between class attendance of college students and their performance (i.e., grade) in the class and/or their overall grade point average. Some studies included multiple samples and hence the dataset actually contains 97 correlation coefficients.
The dataset was obtained via personal communication. Note that this dataset differs just slightly from the one used by Credé et al. (2010).
education, correlation coefficients, multilevel models
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Personal communication.
Credé, M., Roch, S. G., & Kieszczynka, U. M. (2010). Class attendance in college: A meta-analytic review of the relationship of class attendance with grades and student characteristics. Review of Educational Research, 80(2), 272–295. https://doi.org/10.3102/0034654310362998
### copy data into 'dat' and examine data dat <- dat.crede2010 head(dat, 18) ## Not run: ### load metafor package library(metafor) ### calculate r-to-z transformed correlations and corresponding sampling variances dat <- escalc(measure="ZCOR", ri=ri, ni=ni, data=dat) ############################################################################ ### meta-analysis for the relationship between attendance and grades res <- rma(yi, vi, data=dat, subset=criterion=="grade") res ### estimated average correlation with 95% CI/PI predict(res, transf=transf.ztor, digits=2) ### examine if relationship between attendance and grades differs for nonscience/science classes res <- rma(yi, vi, mods = ~ class, data=dat, subset=criterion=="grade") res ### estimated average correlations for nonscience and science classes predict(res, newmods=c(0,1), transf=transf.ztor, digits=2) ### examine if relationship between attendance and grades has changed over time res <- rma(yi, vi, mods = ~ year, data=dat, subset=criterion=="grade") res ############################################################################ ### meta-analysis for the relationship between attendance and GPA res <- rma(yi, vi, data=dat, subset=criterion=="gpa") res ### estimated average correlation with 95% CI/PI predict(res, transf=transf.ztor, digits=2) ### examine if relationship between attendance and GPA has changed over time res <- rma(yi, vi, mods = ~ year, data=dat, subset=criterion=="gpa") res ############################################################################ ### use a multilevel model to examine the relationship between attendance and grades res <- rma.mv(yi, vi, random = ~ 1 | studyid/sampleid, data=dat, subset=criterion=="grade") res predict(res, transf=transf.ztor, digits=2) ### use a multilevel model to examine the relationship between attendance and gpa res <- rma.mv(yi, vi, random = ~ 1 | studyid/sampleid, data=dat, subset=criterion=="gpa") res predict(res, transf=transf.ztor, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.crede2010 head(dat, 18) ## Not run: ### load metafor package library(metafor) ### calculate r-to-z transformed correlations and corresponding sampling variances dat <- escalc(measure="ZCOR", ri=ri, ni=ni, data=dat) ############################################################################ ### meta-analysis for the relationship between attendance and grades res <- rma(yi, vi, data=dat, subset=criterion=="grade") res ### estimated average correlation with 95% CI/PI predict(res, transf=transf.ztor, digits=2) ### examine if relationship between attendance and grades differs for nonscience/science classes res <- rma(yi, vi, mods = ~ class, data=dat, subset=criterion=="grade") res ### estimated average correlations for nonscience and science classes predict(res, newmods=c(0,1), transf=transf.ztor, digits=2) ### examine if relationship between attendance and grades has changed over time res <- rma(yi, vi, mods = ~ year, data=dat, subset=criterion=="grade") res ############################################################################ ### meta-analysis for the relationship between attendance and GPA res <- rma(yi, vi, data=dat, subset=criterion=="gpa") res ### estimated average correlation with 95% CI/PI predict(res, transf=transf.ztor, digits=2) ### examine if relationship between attendance and GPA has changed over time res <- rma(yi, vi, mods = ~ year, data=dat, subset=criterion=="gpa") res ############################################################################ ### use a multilevel model to examine the relationship between attendance and grades res <- rma.mv(yi, vi, random = ~ 1 | studyid/sampleid, data=dat, subset=criterion=="grade") res predict(res, transf=transf.ztor, digits=2) ### use a multilevel model to examine the relationship between attendance and gpa res <- rma.mv(yi, vi, random = ~ 1 | studyid/sampleid, data=dat, subset=criterion=="gpa") res predict(res, transf=transf.ztor, digits=2) ## End(Not run)
26 studies reporting estimates of the birth prevalence of Duchenne muscular dystrophy.
dat.crisafulli2020
dat.crisafulli2020
The data frame contains the following columns:
study | character |
study label (first author, year) |
pubyear | integer |
publication year |
country | factor |
origin of investigated population |
from, to | integer |
time span of investigation (years) |
cases | integer |
number of DMD cases |
total | integer |
corresponding total population |
Duchenne muscular dystrophy (DMD) is a rare disease that is caused by a genetic mutation and is characterized by impairment through muscle weakness and a reduced life expectancy.
Crisafulli et al. (2020) reported on a systematic review of data on the epidemiology of DMD, including estimates of the birth prevalence (which is of the order of a few per ten thousand). One of the originally reported studies (Koenig, 2019) is omitted here, as it constitutes an obvious outlier, and the reliability of the reported data is doubtful; Crisafulli et al. (2020) pointed out that “Concerning birth prevalence, Koenig et al. were found to be outliers. This study had problems with data collection in the last study year, as due to privacy issues, DMD cases were under-reported.”
medicine, epidemiology, proportions, dose-response models
Christian Roever, [email protected]
Crisafulli, S., Sultana, J., Fontana, A., Salvo, F., Messina, S., & Trifiro, G. (2020). Global epidemiology of Duchenne muscular dystrophy: an updated systematic review and meta-analysis. Orphanet Journal of Rare Diseases, 15, 141. https://doi.org/10.1186/s13023-020-01430-8
# show (some) data head(dat.crisafulli2020) ## Not run: # compute logarithmic proportions and associated standard errors library(metafor) logp <- escalc(measure="PLN", xi=cases, ni=total, slab=study, data=dat.crisafulli2020) # perform meta-analysis rma01 <- rma.uni(logp) # show results rma01 # illustrate in a forest plot forest(rma01, header=TRUE, xlim=c(-12,-5)) ## End(Not run)
# show (some) data head(dat.crisafulli2020) ## Not run: # compute logarithmic proportions and associated standard errors library(metafor) logp <- escalc(measure="PLN", xi=cases, ni=total, slab=study, data=dat.crisafulli2020) # perform meta-analysis rma01 <- rma.uni(logp) # show results rma01 # illustrate in a forest plot forest(rma01, header=TRUE, xlim=c(-12,-5)) ## End(Not run)
Results from 21 cross-over studies evaluating the effect of potassium supplementation to reduce diastolic blood pressure.
dat.curtin2002
dat.curtin2002
The data frame contains the following columns:
author | character |
first author |
year | character |
year of publication |
N | integer |
total sample size |
mean | numeric |
mean difference in diastolic blood pressure |
SE | numeric |
standard error |
corr | numeric |
within-patient correlation |
Results from 21 cross-over studies evaluating the effect of potassium supplementation to reduce diastolic blood pressure (Curtin et al., 2002, Table II).
This data set is used as an example in Schwarzer et al. (2015), Chapter 2.
raw mean differences
Guido Schwarzer, [email protected], https://github.com/guido-s/
Curtin, F., Altman, D. G., & Elbourne, D. (2002). Meta-analysis combining parallel and cross-over clinical trials. I: Continuous outcomes. Statistics in Medicine, 21(15), 2131–2144. https://doi.org/10.1002/sim.1205
Schwarzer, G., Carpenter, J. R., & Rücker, G. (2015). Meta-analysis with R. Cham, Switzerland: Springer.
### Show first five studies head(dat.curtin2002, 5) ## Not run: ### Load meta package suppressPackageStartupMessages(library("meta")) ### Use DerSimonian-Laird estimator (which was the default in meta in the year 2015). ### Furthermore, print meta-analysis results with two digits. oldset <- settings.meta(method.tau = "DL", digits = 2) ### Conduct meta-analysis mg2 <- metagen(mean, SE, studlab = paste(author, year), data = dat.curtin2002, sm = "MD") mg2 ### Use previous settings settings.meta(oldset) ## End(Not run)
### Show first five studies head(dat.curtin2002, 5) ## Not run: ### Load meta package suppressPackageStartupMessages(library("meta")) ### Use DerSimonian-Laird estimator (which was the default in meta in the year 2015). ### Furthermore, print meta-analysis results with two digits. oldset <- settings.meta(method.tau = "DL", digits = 2) ### Conduct meta-analysis mg2 <- metagen(mean, SE, studlab = paste(author, year), data = dat.curtin2002, sm = "MD") mg2 ### Use previous settings settings.meta(oldset) ## End(Not run)
Results from studies examining the effects of elevated CO2 levels on woody plant mass.
dat.curtis1998
dat.curtis1998
The data frame contains the following columns:
id | numeric |
observation number |
paper | numeric |
paper number |
genus | character |
genus name |
species | character |
species name |
fungrp | character |
plant functional group |
co2.ambi | numeric |
ambient CO2 level (control group) |
co2.elev | numeric |
elevated CO2 level (treatment group) |
units | character |
units for CO2 exposure levels |
time | numeric |
maximum length of time (days) of CO2 exposure |
pot | character |
growing method (see ‘Details’) |
method | character |
CO2 exposure facility (see ‘Details’) |
stock | character |
planting stock code |
xtrt | character |
interacting treatment code (see ‘Details’) |
level | character |
interacting treatment level codes (see ‘Details’) |
m1i | numeric |
mean plant mass under elevated CO2 level (treatment group) |
sd1i | numeric |
standard deviation of plant mass underelevated CO2 level (treatment group) |
n1i | numeric |
number of observations under elevated CO2 level (treatment group) |
m2i | numeric |
mean plant mass under ambient CO2 level (control group) |
sd2i | numeric |
standard deviation of plant mass under ambient CO2 level (control group) |
n2i | numeric |
number of observations under ambient CO2 level (control group) |
The studies included in this dataset compared the total above- plus below-ground biomass (in grams) for plants that were either exposed to ambient (around 35 Pa) and elevated CO2 levels (around twice the ambient level). The co2.ambi
and co2.elev
variables indicate the CO2 levels in the control and treatment groups, respectively (with the units
variable specifying the units for the CO2 exposure levels). Many of the studies also varied one or more additional environmental variables (defined by the xtrt
and level
variables):
NONE = no additional treatment factor
FERT = soil fertility (either a CONTROL
, HIGH
, or LOW
level)
LIGHT = light treatment (always a LOW
light level)
FERT+L = soil fertility and light (a LOW
light and soil fertility level)
H2O = well watered vs drought (either a WW
or DRT
level)
TEMP = temperature treatment (either a HIGH
or LOW
level)
OZONE = ozone exposure (either a HIGH
or LOW
level)
UVB = ultraviolet-B radiation exposure (either a HIGH
or LOW
level)
In addition, the studies differed with respect to various design variables, including CO2 exposure duration (time
), growing method (pot
: number = pot size in liters; GRND
= plants rooted in ground; HYDRO
= solution or aeroponic culture), CO2 exposure facility (method
: GC
= growth chamber; GH
= greenhouse; OTC
= field-based open-top chamber), and planting stock (stock
: SEED
= plants started from seeds; SAP
= plants started from cuttings). The goal of the meta-analysis was to examine the effects of elevated CO2 levels on plant physiology and growth and the interacting effects of the environmental (and design) variables.
ecology, ratios of means
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Hedges, L. V., Gurevitch, J., & Curtis, P. S. (1999). The meta-analysis of response ratios in experimental ecology. Ecology, 80(4), 1150–1156. https://doi.org/10.1890/0012-9658(1999)080[1150:TMAORR]2.0.CO;2
(data obtained from Ecological Archives, E080-008-S1, at: https://doi.org/10.6084/m9.figshare.c.3297278
)
Curtis, P. S., & Wang, X. (1998). A meta-analysis of elevated CO2 effects on woody plant mass, form, and physiology. Oecologia, 113(3), 299–313. https://doi.org/10.1007/s004420050381
### copy data into 'dat' and examine data dat <- dat.curtis1998 head(dat) ## Not run: ### load metafor package library(metafor) ### calculate (log transformed) ratios of means and corresponding sampling variances dat <- escalc(measure="ROM", m1i=m1i, sd1i=sd1i, n1i=n1i, m2i=m2i, sd2i=sd2i, n2i=n2i, data=dat) head(dat) ### meta-analysis using a random-effects model res <- rma(yi, vi, method="DL", data=dat) res ### average ratio of means with 95% CI predict(res, transf=exp, digits=2) ### meta-analysis for plants grown under nutrient stress res <- rma(yi, vi, method="DL", data=dat, subset=(xtrt=="FERT" & level=="LOW")) predict(res, transf=exp, digits=2) ### meta-analysis for plants grown under low light conditions res <- rma(yi, vi, method="DL", data=dat, subset=(xtrt=="LIGHT" & level=="LOW")) predict(res, transf=exp, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.curtis1998 head(dat) ## Not run: ### load metafor package library(metafor) ### calculate (log transformed) ratios of means and corresponding sampling variances dat <- escalc(measure="ROM", m1i=m1i, sd1i=sd1i, n1i=n1i, m2i=m2i, sd2i=sd2i, n2i=n2i, data=dat) head(dat) ### meta-analysis using a random-effects model res <- rma(yi, vi, method="DL", data=dat) res ### average ratio of means with 95% CI predict(res, transf=exp, digits=2) ### meta-analysis for plants grown under nutrient stress res <- rma(yi, vi, method="DL", data=dat, subset=(xtrt=="FERT" & level=="LOW")) predict(res, transf=exp, digits=2) ### meta-analysis for plants grown under low light conditions res <- rma(yi, vi, method="DL", data=dat, subset=(xtrt=="LIGHT" & level=="LOW")) predict(res, transf=exp, digits=2) ## End(Not run)
Results from 9 studies on the effectiveness of antihistamines in reducing the severity of runny nose and sneezing in the common cold.
dat.dagostino1998
dat.dagostino1998
The data frame contains the following columns:
study | numeric |
study id |
cold | character |
natural or induced cold study |
scale.rn | character |
scale for measuring runny nose severity |
scale.sn | character |
scale for measuring sneezing severity |
drug | character |
type of antihistamine studied |
tnt | numeric |
total sample size of the treatment group |
tnc | numeric |
total sample size of the control (placebo) group |
outcome | character |
outcome variable (see ‘Details’) |
mt | numeric |
mean in the treatment group |
sdt | numeric |
SD in the treatment group |
mc | numeric |
mean in the control group |
sdc | numeric |
SD in the control group |
xt | numeric |
number of patients reaching the therapy goal in the treatment group |
xc | numeric |
number of patients reaching the therapy goal in the control (placebo) group |
nt | numeric |
sample size of the treatment group for measuring the outcome |
nc | numeric |
sample size of the control group for measuring the outcome |
The studies for this meta-analysis were assembled to examine the effectiveness of antihistamines in reducing the severity of runny nose and sneezing in the common cold. Effectiveness was measured after one and two days of treatment in terms of 4 different outcome variables:
rnic1
and rnic2
(continuous): incremental change (improvement) in runny nose severity at day 1 and day 2,
rngoal1
and rngoal2
(dichotomous): reaching the goal of therapy (of at least a 50% reduction in runny nose severity) at day 1 and day 2,
snic1
and snic2
(continuous): incremental change (improvement) in sneezing severity at day 1 and day 2, and
rngoal1
and rngoal2
(dichotomous): reaching the goal of therapy (of at least a 50% reduction in sneezing severity) at day 1 and day 2.
For the continuous outcomes, standardized mean differences can be computed to quantify the difference between the treatment and control groups. For the dichotomous outcomes, one can compute (log) odds ratios to quantify the difference between the treatment and control groups.
medicine, standardized mean differences, odds ratios, multivariate models
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
D'Agostino, R. B., Sr., Weintraub, M., Russell, H. K., Stepanians, M., D'Agostino, R. B., Jr., Cantilena, L. R., Jr., Graumlich, J. F., Maldonado, S., Honig, P., & Anello, C. (1998). The effectiveness of antihistamines in reducing the severity of runny nose and sneezing: A meta-analysis. Clinical Pharmacology & Therapeutics, 64(6), 579–596. https://doi.org/10.1016/S0009-9236(98)90049-2
### copy data into 'dat' and examine data dat <- dat.dagostino1998 head(dat, 16) ## Not run: ### load metafor package library(metafor) ### compute standardized mean differences and corresponding sampling variances dat <- escalc(measure="SMD", m1i=mt, m2i=mc, sd1i=sdt, sd2i=sdc, n1i=nt, n2i=nc, data=dat, add.measure=TRUE) ### compute log odds ratios and corresponding sampling variances dat <- escalc(measure="OR", ai=xt, ci=xc, n1i=nt, n2i=nc, data=dat, replace=FALSE, add.measure=TRUE, add=1/2, to="all") ### inspect data for the first study head(dat, 8) ### fit a random-effects model for incremental change in runny nose severity at day 1 res <- rma(yi, vi, data=dat, subset=outcome=="rnic1") res ### fit a random-effects model for reaching the goal of therapy for runny nose severity at day 1 res <- rma(yi, vi, data=dat, subset=outcome=="rngoal1") res predict(res, transf=exp) ### construct approximate V matrix assuming a correlation of 0.7 for sampling errors within studies dat$esid <- ave(dat$study, dat$study, FUN=seq) V <- vcalc(vi, cluster=study, obs=esid, rho=0.7, data=dat) ### fit a model for incremental change in runny nose severity at day 1 and at day 2, allowing for ### correlated sampling errors (no random effects added, since there does not appear to be any ### noteworthy heterogeneity in these data) res <- rma.mv(yi, V, mods = ~ 0 + outcome, data=dat, subset=outcome %in% c("rnic1","rnic2")) res ### test if there is a difference in effects at day 1 and day 2 anova(res, X=c(1,-1)) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.dagostino1998 head(dat, 16) ## Not run: ### load metafor package library(metafor) ### compute standardized mean differences and corresponding sampling variances dat <- escalc(measure="SMD", m1i=mt, m2i=mc, sd1i=sdt, sd2i=sdc, n1i=nt, n2i=nc, data=dat, add.measure=TRUE) ### compute log odds ratios and corresponding sampling variances dat <- escalc(measure="OR", ai=xt, ci=xc, n1i=nt, n2i=nc, data=dat, replace=FALSE, add.measure=TRUE, add=1/2, to="all") ### inspect data for the first study head(dat, 8) ### fit a random-effects model for incremental change in runny nose severity at day 1 res <- rma(yi, vi, data=dat, subset=outcome=="rnic1") res ### fit a random-effects model for reaching the goal of therapy for runny nose severity at day 1 res <- rma(yi, vi, data=dat, subset=outcome=="rngoal1") res predict(res, transf=exp) ### construct approximate V matrix assuming a correlation of 0.7 for sampling errors within studies dat$esid <- ave(dat$study, dat$study, FUN=seq) V <- vcalc(vi, cluster=study, obs=esid, rho=0.7, data=dat) ### fit a model for incremental change in runny nose severity at day 1 and at day 2, allowing for ### correlated sampling errors (no random effects added, since there does not appear to be any ### noteworthy heterogeneity in these data) res <- rma.mv(yi, V, mods = ~ 0 + outcome, data=dat, subset=outcome %in% c("rnic1","rnic2")) res ### test if there is a difference in effects at day 1 and day 2 anova(res, X=c(1,-1)) ## End(Not run)
Results from 16 studies examining the effectiveness of topical plus systemic antibiotics to prevent respiratory tract infections (RTIs).
dat.damico2009
dat.damico2009
The data frame contains the following columns:
study | character |
first author |
year | numeric |
publication year |
xt | numeric |
number of RTIs in the treatment group |
nt | numeric |
number of patients in the treatment group |
xc | numeric |
number of RTIs in the control group |
nc | numeric |
number of patients in the control group |
conceal | numeric |
allocation concealment (0 = not adequate, 1 = adequate) |
blind | numeric |
blinding (0 = open, 1 = double-blind) |
The dataset includes the results from 16 studies that examined the effectiveness of topical plus systemic antibiotics versus no prophylaxis to prevent respiratory tract infections (RTIs).
medicine, odds ratios
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
D'Amico, R., Pifferi, S., Torri, V., Brazzi, L., Parmelli, E., & Liberati, A. (2009). Antibiotic prophylaxis to reduce respiratory tract infections and mortality in adults receiving intensive care. Cochrane Database of Systematic Reviews, 4, CD000022. https://doi.org/10.1002/14651858.CD000022.pub3
### copy data into 'dat' and examine data dat <- dat.damico2009 dat ## Not run: ### load metafor package library(metafor) ### meta-analysis of the (log) odds ratios using the Mantel-Haenszel method rma.mh(measure="OR", ai=xt, n1i=nt, ci=xc, n2i=nc, data=dat, digits=2) ### calculate log odds ratios and corresponding sampling variances dat <- escalc(measure="OR", ai=xt, n1i=nt, ci=xc, n2i=nc, data=dat) ### meta-analysis using a random-effects model res <- rma(yi, vi, data=dat, method="DL") res predict(res, transf=exp, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.damico2009 dat ## Not run: ### load metafor package library(metafor) ### meta-analysis of the (log) odds ratios using the Mantel-Haenszel method rma.mh(measure="OR", ai=xt, n1i=nt, ci=xc, n2i=nc, data=dat, digits=2) ### calculate log odds ratios and corresponding sampling variances dat <- escalc(measure="OR", ai=xt, n1i=nt, ci=xc, n2i=nc, data=dat) ### meta-analysis using a random-effects model res <- rma(yi, vi, data=dat, method="DL") res predict(res, transf=exp, digits=2) ## End(Not run)
Results from 13 trials providing information about standard care quality and HAART-adherence in control groups.
dat.debruin2009
dat.debruin2009
The data frame contains the following columns:
author | character |
(first) author of study |
year | numeric |
publication year |
scq | numeric |
standard care quality |
ni | numeric |
number of patients in the standard care group |
xi | numeric |
number of patients with an undetectable viral load in standard care group |
mi | numeric |
number of patients with a detectable viral load in standard care group |
ethnicity | character |
dominant ethnicity of the patients in the standard care group |
patients | character |
inclusion of patients continuing or starting (a new) treatment |
select | character |
baseline selection of patients with adherence problems or no selection |
sens | character |
sensitivity of viral load assessments (<400 vs. >=400 copies/ml) |
Highly active antiretroviral therapy (HAART) refers to a combination of multiple antiretroviral drugs that can effectively suppress the HIV virus. However, achieving viral suppression (to the point that the virus becomes essentially undetectable in a blood sample) requires high levels of adherence to an often complicated medication regimen. A number of trials have examined various interventions that aim to increase adherence levels. In each trial, patients receiving the intervention are compared to patients in a control group receiving standard care (often referred to as ‘care as usual’). However, the quality of standard care can vary substantially between these studies. de Bruin et al. (2009) assessed the quality of standard care provided (based on a quantification of the number of behavior change techniques applied) and examined to what extent the quality of standard care was related to the proportion of patients achieving effective viral suppression in the control groups.
psychology, medicine, proportions, single-arm studies, meta-regression
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
de Bruin, M., Viechtbauer, W., Hospers, H. J., Schaalma, H. P., & Kok, G. (2009). Standard care quality determines treatment outcomes in control groups of HAART-adherence intervention studies: Implications for the interpretation and comparison of intervention effects. Health Psychology, 28(6), 668–674. https://doi.org/10.1037/a0015989
### copy data into 'dat' and examine data dat <- dat.debruin2009 dat ## Not run: ### load metafor package library(metafor) ### calculate proportions and corresponding sampling variances dat <- escalc(measure="PR", xi=xi, ni=ni, data=dat) dat ### random-effects model res <- rma(yi, vi, data=dat) print(res, digits=2) ### mixed-effects meta-regression model with all predictors/covariates res <- rma(yi, vi, mods = ~ scq + ethnicity + patients + select + sens, data=dat) print(res, digits=3) ### mixed-effects meta-regression model with scq and ethnicity as predictors/covariates res <- rma(yi, vi, mods = ~ scq + ethnicity, data=dat) print(res, digits=3) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.debruin2009 dat ## Not run: ### load metafor package library(metafor) ### calculate proportions and corresponding sampling variances dat <- escalc(measure="PR", xi=xi, ni=ni, data=dat) dat ### random-effects model res <- rma(yi, vi, data=dat) print(res, digits=2) ### mixed-effects meta-regression model with all predictors/covariates res <- rma(yi, vi, mods = ~ scq + ethnicity + patients + select + sens, data=dat) print(res, digits=3) ### mixed-effects meta-regression model with scq and ethnicity as predictors/covariates res <- rma(yi, vi, mods = ~ scq + ethnicity, data=dat) print(res, digits=3) ## End(Not run)
Results from 20 trials examining the effectiveness of antithrombotic treatments to prevent strokes in patients with non-valvular atrial fibrillation.
dat.dogliotti2014
dat.dogliotti2014
The data frame contains the following columns:
study | character |
study label |
id | numeric |
study ID |
treatment | character |
treatment |
stroke | numeric |
number of strokes |
total | numeric |
number of individuals |
This dataset comes from a systematic review aiming to estimate the effects of eight antithrombotic treatments including placebo in reducing the incidence of major thrombotic events in patients with non-valvular atrial fibrillation (Dogliotti et al., 2014).
The review included 20 studies with 79,808 participants, four studies are three-arm studies. The primary outcome is stroke reduction (yes / no).
medicine, odds ratios, network meta-analysis, Mantel-Haenszel method
Guido Schwarzer, [email protected], https://github.com/guido-s/
Dogliotti, A., Paolasso, E., & Giugliano, R. P. (2014). Current and new oral antithrombotics in non-valvular atrial fibrillation: A network meta-analysis of 79808 patients. Heart, 100(5), 396–405. https://doi.org/10.1136/heartjnl-2013-304347
pairwise
, metabin
, netmeta
, netmetabin
### Show first 7 rows / 3 studies of the dataset head(dat.dogliotti2014, 7) ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print odds ratios and confidence limits with two digits oldset <- settings.meta(digits = 2) ### Change appearance of confidence intervals cilayout("(", "-") ### Transform data from long arm-based format to contrast-based ### format. Argument 'sm' has to be used for odds ratio as summary ### measure; by default the risk ratio is used in the metabin function ### called internally. pw <- pairwise(treat = treatment, n = total, event = stroke, studlab = study, data = dat.dogliotti2014, sm = "OR") ### Print log odds ratios (TE) and standard errors (seTE) head(pw, 5)[, 1:5] ### Conduct network meta-analysis (NMA) with placebo as reference net <- netmeta(pw, ref = "plac") ### Details on excluded study selvars <- c("studlab", "event1", "n1", "event2", "n2") subset(pw, studlab == "WASPO, 2007")[, selvars] ### Show network graph netgraph(net, seq = "optimal", number = TRUE) ### Conduct Mantel-Haenszel NMA net.mh <- netmetabin(pw, ref = "plac") ### Compare results of inverse variance and Mantel-Haenszel NMA nb <- netbind(net, net.mh, random = FALSE, name = c("Inverse variance", "Mantel-Haenszel")) forest(nb, xlim = c(0.15, 2), at = c(0.2, 0.5, 1, 2)) ### Print and plot results for inverse variance NMA net forest(net) ### Use previous settings settings.meta(oldset) ## End(Not run)
### Show first 7 rows / 3 studies of the dataset head(dat.dogliotti2014, 7) ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print odds ratios and confidence limits with two digits oldset <- settings.meta(digits = 2) ### Change appearance of confidence intervals cilayout("(", "-") ### Transform data from long arm-based format to contrast-based ### format. Argument 'sm' has to be used for odds ratio as summary ### measure; by default the risk ratio is used in the metabin function ### called internally. pw <- pairwise(treat = treatment, n = total, event = stroke, studlab = study, data = dat.dogliotti2014, sm = "OR") ### Print log odds ratios (TE) and standard errors (seTE) head(pw, 5)[, 1:5] ### Conduct network meta-analysis (NMA) with placebo as reference net <- netmeta(pw, ref = "plac") ### Details on excluded study selvars <- c("studlab", "event1", "n1", "event2", "n2") subset(pw, studlab == "WASPO, 2007")[, selvars] ### Show network graph netgraph(net, seq = "optimal", number = TRUE) ### Conduct Mantel-Haenszel NMA net.mh <- netmetabin(pw, ref = "plac") ### Compare results of inverse variance and Mantel-Haenszel NMA nb <- netbind(net, net.mh, random = FALSE, name = c("Inverse variance", "Mantel-Haenszel")) forest(nb, xlim = c(0.15, 2), at = c(0.2, 0.5, 1, 2)) ### Print and plot results for inverse variance NMA net forest(net) ### Use previous settings settings.meta(oldset) ## End(Not run)
Results from 41 trials examining the safety of inhaled medications in patients with chronic obstructive pulmonary disease.
dat.dong2013
dat.dong2013
The data frame contains the following columns:
id | integer |
study ID |
treatment | character |
treatment |
death | integer |
mortality |
randomized | integer |
number of individuals |
This network meta-analysis compared the safety of inhaled medications in patients with chronic obstructive pulmonary disease (Dong et al., 2013).
Mortality was reported in 41 randomized trials, with a total of 52 462 patients. Mortality was low, with 2 408 deaths (4.6%) reported across all studies. There were nine studies that reported zero events in at least one of the treatment arms and three additional studies had zero events in all treatment arms.
This dataset was used in Efthimiou et al. (2019) to illustrate the Mantel-Haenszel method for network meta-analysis.
medicine, odds ratios, network meta-analysis, Mantel-Haenszel method
Guido Schwarzer, [email protected], https://github.com/guido-s/
Dong, Y.-H., Lin, H.-H., Shau, W.-Y., Wu, Y.-C., Chang, C.-H., & Lai, M.-S. (2013). Comparative safety of inhaled medications in patients with chronic obstructive pulmonary disease: Systematic review and mixed treatment comparison meta-analysis of randomised controlled trials. Thorax, 68(1), 48–56. https://doi.org/10.1136/thoraxjnl-2012-201926
Efthimiou, O., Rücker, G., Schwarzer, G., Higgins, J., Egger, M., & Salanti, G. (2019). A Mantel-Haenszel model for network meta-analysis of rare events. Statistics in Medicine, 38(16), 2992–3012. https://doi.org/10.1002/sim.8158
### Show first 6 rows / 3 studies of the dataset head(dat.dong2013) ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print odds ratios and confidence limits with two digits oldset <- settings.meta(digits = 2) ### Change appearance of confidence intervals cilayout("(", "-") ### Transform data from long arm-based format to contrast-based ### format. Argument 'sm' has to be used for odds ratio as summary ### measure; by default the risk ratio is used in the metabin function ### called internally. pw <- pairwise(treatment, death, randomized, studlab = id, data = dat.dong2013, sm = "OR") ### Calculated log odds ratios (TE) and standard errors (seTE) pw[1:3, 1:9] ### Conduct Mantel-Haenszel network meta-analysis (NMA) net <- netmetabin(pw, ref = "plac") ### Network graph netgraph(net, seq = "optimal", col = "black", plastic = FALSE, points = TRUE, pch = 21, cex.points = 3, col.points = "black", bg.points = "gray", thickness = "se.fixed", number.of.studies = TRUE) ### Show results for Mantel-Haenszel NMA net forest(net) ### League table with network estimates in lower triangle and direct ### estimates in upper triangle netleague(net) ### Assess inconsistency print(netsplit(net), show = "both", ci = TRUE, overall = FALSE, nchar.trts = 6) ### Use previous settings settings.meta(oldset) ## End(Not run)
### Show first 6 rows / 3 studies of the dataset head(dat.dong2013) ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print odds ratios and confidence limits with two digits oldset <- settings.meta(digits = 2) ### Change appearance of confidence intervals cilayout("(", "-") ### Transform data from long arm-based format to contrast-based ### format. Argument 'sm' has to be used for odds ratio as summary ### measure; by default the risk ratio is used in the metabin function ### called internally. pw <- pairwise(treatment, death, randomized, studlab = id, data = dat.dong2013, sm = "OR") ### Calculated log odds ratios (TE) and standard errors (seTE) pw[1:3, 1:9] ### Conduct Mantel-Haenszel network meta-analysis (NMA) net <- netmetabin(pw, ref = "plac") ### Network graph netgraph(net, seq = "optimal", col = "black", plastic = FALSE, points = TRUE, pch = 21, cex.points = 3, col.points = "black", bg.points = "gray", thickness = "se.fixed", number.of.studies = TRUE) ### Show results for Mantel-Haenszel NMA net forest(net) ### League table with network estimates in lower triangle and direct ### estimates in upper triangle netleague(net) ### Assess inconsistency print(netsplit(net), show = "both", ci = TRUE, overall = FALSE, nchar.trts = 6) ### Use previous settings settings.meta(oldset) ## End(Not run)
Results from 19 trials examining complementary and alternative medicine (CAM) for irritable bowel syndrome (IBS).
dat.dorn2007
dat.dorn2007
The data frame contains the following columns:
id | numeric |
trial id number |
study | character |
(first) author |
year | numeric |
publication year |
country | character |
country where trial was conducted |
ibs.crit | character |
IBS diagnostic criteria (Manning, Rome I, Rome II, or Other) |
days | numeric |
number of treatment days |
visits | numeric |
number of practitioner visits |
jada | numeric |
Jadad score |
x.a | numeric |
number of responders in the active treatment group |
n.a | numeric |
number of participants in the active treatment group |
x.p | numeric |
number of responders in the placebo group |
n.p | numeric |
number of participants in the placebo group |
The dataset includes the results from 19 randomized clinical trials that examined the effectiveness of complementary and alternative medicine (CAM) for irritable bowel syndrome (IBS).
medicine, alternative medicine, risk ratios
The data were extracted from Table I in Dorn et al. (2009). Comparing the funnel plot in Figure 1 with the one obtained below indicates that the data for study 5 (Davis et al., 2006) in the table were not the ones that were used in the actual analyses.
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Dorn, S. D., Kaptchuk, T. J., Park, J. B., Nguyen, L. T., Canenguez, K., Nam, B. H., Woods, K. B., Conboy, L. A., Stason, W. B., & Lembo, A. J. (2007). A meta-analysis of the placebo response in complementary and alternative medicine trials of irritable bowel syndrome. Neurogastroenterology & Motility, 19(8), 630–637. https://doi.org/10.1111/j.1365-2982.2007.00937.x
### copy data into 'dat' and examine data dat <- dat.dorn2007 dat ## Not run: ### load metafor package library(metafor) ### calculate log risk ratios and corresponding sampling variances dat <- escalc(measure="RR", ai=x.a, n1i=n.a, ci=x.p, n2i=n.p, data=dat) ### random-effects model res <- rma(yi, vi, data=dat, digits=2, method="DL") res ### estimated average risk ratio predict(res, transf=exp) ### funnel plot with study 5 highlighted in red funnel(res, atransf=exp, at=log(c(.1, .2, .5, 1, 2, 5, 10)), ylim=c(0,1), steps=6, las=1, col=ifelse(id == 5, "red", "black")) ### change log risk ratio for study 5 dat$yi[5] <- -0.44 ### results are now more in line with what is reported in the paper ### (although the CI in the paper is not wide enough) res <- rma(yi, vi, data=dat, digits=2, method="DL") predict(res, transf=exp) ### funnel plot with study 5 highlighted in red funnel(res, atransf=exp, at=log(c(.1, .2, .5, 1, 2, 5, 10)), ylim=c(0,1), steps=6, las=1, col=ifelse(id == 5, "red", "black")) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.dorn2007 dat ## Not run: ### load metafor package library(metafor) ### calculate log risk ratios and corresponding sampling variances dat <- escalc(measure="RR", ai=x.a, n1i=n.a, ci=x.p, n2i=n.p, data=dat) ### random-effects model res <- rma(yi, vi, data=dat, digits=2, method="DL") res ### estimated average risk ratio predict(res, transf=exp) ### funnel plot with study 5 highlighted in red funnel(res, atransf=exp, at=log(c(.1, .2, .5, 1, 2, 5, 10)), ylim=c(0,1), steps=6, las=1, col=ifelse(id == 5, "red", "black")) ### change log risk ratio for study 5 dat$yi[5] <- -0.44 ### results are now more in line with what is reported in the paper ### (although the CI in the paper is not wide enough) res <- rma(yi, vi, data=dat, digits=2, method="DL") predict(res, transf=exp) ### funnel plot with study 5 highlighted in red funnel(res, atransf=exp, at=log(c(.1, .2, .5, 1, 2, 5, 10)), ylim=c(0,1), steps=6, las=1, col=ifelse(id == 5, "red", "black")) ## End(Not run)
Nine studies investigating the effect of NO2 exposure on respiratory illness in children.
dat.dumouchel1994
dat.dumouchel1994
The data frame contains the following columns:
study | character |
study label |
smoke | factor |
adjustment for smoking (y/n) |
no2 | factor |
direct measurement of NO2 concentration (y/n) |
gender | factor |
adjustment for gender (y/n) |
or | numeric |
odds ratio for childhood respiratory illness |
lower | numeric |
lower bound of 95 percent CI |
upper | numeric |
upper bound of 95 percent CI |
Hasselblad et al. (1992) investigated the effects of nitrogen dioxide (NO2) exposure on the occurrence of respiratory illness in children. Their data were picked up by DuMouchel (1994) as an illustrative example in his article on Bayesian meta-analysis, and were also part of his “hblm
” S-Plus software package. DuMouchel's dataset differs slightly from the figures quoted by Hasselblad et al. (1992), apparently because he had additional, more detailed data available.
The data set features three study-level covariables reflecting characteristics of the study designs, namely, whether the quoted estimate had been adjusted for parents' smoking status, whether NO2 exposure had been measured directly (or presence of a gas stove in the household had been used as a proxy instead), and whether the quoted effect had been adjusted for gender. Inclusion of the covariables allows to account for the studies' design features, quantify their effects, and adjust for these.
medicine, odds ratios, meta-regression
Christian Roever, [email protected]
DuMouchel, W. H. (1994). Hierarchical Bayes linear models for meta-analysis. Technical Report 27, National Institute of Statistical Sciences (NISS); Research Triangle Park, NC, USA. https://www.niss.org/research/technical-reports/hierarchical-bayes-linear-models-meta-analysis-1994
Hasselblad, V., Eddy, D. M., & Kotchmar, D. J. (1992). Synthesis of environmental evidence: Nitrogen dioxide epidemiology studies. Journal of the Air and Waste Management Association, 42(5), 662–671. https://doi.org/10.1080/10473289.1992.10467018
# show data: dat.dumouchel1994 ## Not run: # derive effect sizes (log-ORs): library(metafor) no2 <- escalc(measure="OR", yi=log(or), sei=(log(upper)-log(lower))/(2*qnorm(0.975)), slab=study, data=dat.dumouchel1994) summary(no2) # compute overall meta-analysis: library(bayesmeta) bm01 <- bayesmeta(no2, tau.prior="DuMouchel") # show results: bm01 forestplot(bm01) traceplot(bm01) # perform meta-regression; # specify regressor matrix: X <- model.matrix( ~ smoke + no2 + gender, data=no2) colnames(X) <- c("intercept", "smoke", "no2", "gender") # perform regression: bm02 <- bmr(no2, X=X, tau.prior="DuMouchel") # show results: bm02 forestplot(bm02) #forestplot(bm02, xlab="log-OR", # X.mean=rbind("none" = c(1,0,0,0), # "smoke" = c(1,1,0,0), # "no2" = c(1,0,1,0), # "gender" = c(1,0,0,1), # "all three" = c(1,1,1,1))) traceplot(bm02) ## End(Not run)
# show data: dat.dumouchel1994 ## Not run: # derive effect sizes (log-ORs): library(metafor) no2 <- escalc(measure="OR", yi=log(or), sei=(log(upper)-log(lower))/(2*qnorm(0.975)), slab=study, data=dat.dumouchel1994) summary(no2) # compute overall meta-analysis: library(bayesmeta) bm01 <- bayesmeta(no2, tau.prior="DuMouchel") # show results: bm01 forestplot(bm01) traceplot(bm01) # perform meta-regression; # specify regressor matrix: X <- model.matrix( ~ smoke + no2 + gender, data=no2) colnames(X) <- c("intercept", "smoke", "no2", "gender") # perform regression: bm02 <- bmr(no2, X=X, tau.prior="DuMouchel") # show results: bm02 forestplot(bm02) #forestplot(bm02, xlab="log-OR", # X.mean=rbind("none" = c(1,0,0,0), # "smoke" = c(1,1,0,0), # "no2" = c(1,0,1,0), # "gender" = c(1,0,0,1), # "all three" = c(1,1,1,1))) traceplot(bm02) ## End(Not run)
Results from 16 trials examining the effectiveness of intravenous magnesium in the prevention of death following acute myocardial infarction.
dat.egger2001
dat.egger2001
The data frame contains the following columns:
id | numeric |
trial id number |
study | character |
first author or trial name |
year | numeric |
publication year |
ai | numeric |
number of deaths in the magnesium group |
n1i | numeric |
number of patients in the magnesium group |
ci | numeric |
number of deaths in the control group |
n2i | numeric |
number of patients in the control group |
The dataset includes the results from 16 randomized clinical trials that examined the effectiveness of intravenous magnesium in the prevention of death following acute myocardial infarction. Studies 1-7 were included in the meta-analyses by Teo et al. (1991) and Horner (1992) and were combined with the results from the LIMIT-2 trial (Woods et al., 1992) in Yusuf et al. (1993), suggesting that magnesium is an effective treatment for reducing mortality. However, the results from the ISIS-4 mega trial (ISIS-4 Collaborative Group, 1995) indicated no reduction in mortality with magnesium treatment. Publication bias has been suggested as one possible explanation for the conflicting findings (Egger & Davey Smith, 1995).
The present dataset includes some additional trials and are based on Table 18.2 from Egger, Davey Smith, and Altman (2001).
medicine, cardiology, Peto's method, publication bias
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Egger, M., Davey Smith, G., & Altman, D. G. (Eds.) (2001). Systematic reviews in health care: Meta-analysis in context (2nd ed.). London: BMJ Books.
Egger, M., & Davey Smith, G. (1995). Misleading meta-analysis: Lessons from “an effective, safe, simple” intervention that wasn't. British Medical Journal, 310(6982), 752–754. https://doi.org/10.1136/bmj.310.6982.752
Horner, S. M. (1992). Efficacy of intravenous magnesium in acute myocardial infarction in reducing arrhythmias and mortality: Meta-analysis of magnesium in acute myocardial infarction. Circulation, 86(3), 774–779. https://doi.org/10.1161/01.cir.86.3.774
ISIS-4 Collaborative Group (1995). ISIS-4: A randomised factorial trial assessing early oral captopril, oral mononitrate, and intravenous magnesium sulphate in 58,050 patients with suspected acute myocardial infarction. Lancet, 345(8951), 669–685. https://doi.org/10.1016/S0140-6736(95)90865-X
Teo, K. K., Yusuf, S., Collins, R., Held, P. H., & Peto, R. (1991). Effects of intravenous magnesium in suspected acute myocardial infarction: Overview of randomised trials. British Medical Journal, 303(6816), 1499–1503. https://doi.org/10.1136/bmj.303.6816.1499
Woods, K. L., Fletcher, S., Roffe, C., & Haider, Y. (1992). Intravenous magnesium sulphate in suspected acute myocardial infarction: Results of the second Leicester Intravenous Magnesium Intervention Trial (LIMIT-2). Lancet, 339(8809), 1553–1558. https://doi.org/10.1016/0140-6736(92)91828-v
Yusuf, S., Teo, K., & Woods, K. (1993). Intravenous magnesium in acute myocardial infarction: An effective, safe, simple, and inexpensive treatment. Circulation, 87(6), 2043–2046. https://doi.org/10.1161/01.cir.87.6.2043
### copy data into 'dat' and examine data dat <- dat.egger2001 dat ## Not run: ### load metafor package library(metafor) ### meta-analysis of trials 1-7 using Peto's method (as in Teo et al., 1991) res <- rma.peto(ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=1:7) print(res, digits=2) ### meta-analysis of trials 1-7 and LIMIT-2 (as in Yusuf et al., 1993) res <- rma.peto(ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=c(1:7,14)) print(res, digits=2) ### meta-analysis of all trials except ISIS-4 res <- rma.peto(ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=-16) print(res, digits=2) predict(res, transf=exp, digits=2) ### meta-analysis of all trials including ISIS-4 res <- rma.peto(ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat) print(res, digits=2) predict(res, transf=exp, digits=2) ### contour-enhanced funnel plot centered at 0 funnel(res, refline=0, level=c(90, 95, 99), shade=c("white", "gray", "darkgray")) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.egger2001 dat ## Not run: ### load metafor package library(metafor) ### meta-analysis of trials 1-7 using Peto's method (as in Teo et al., 1991) res <- rma.peto(ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=1:7) print(res, digits=2) ### meta-analysis of trials 1-7 and LIMIT-2 (as in Yusuf et al., 1993) res <- rma.peto(ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=c(1:7,14)) print(res, digits=2) ### meta-analysis of all trials except ISIS-4 res <- rma.peto(ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=-16) print(res, digits=2) predict(res, transf=exp, digits=2) ### meta-analysis of all trials including ISIS-4 res <- rma.peto(ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat) print(res, digits=2) predict(res, transf=exp, digits=2) ### contour-enhanced funnel plot centered at 0 funnel(res, refline=0, level=c(90, 95, 99), shade=c("white", "gray", "darkgray")) ## End(Not run)
Results from 17 trials comparing post-operative radiation therapy with and without adjuvant chemotherapy in patients with malignant gliomas.
dat.fine1993
dat.fine1993
The data frame contains the following columns:
study | numeric |
study number |
nei | numeric |
sample size in the experimental group receiving radiotherapy plus adjuvant chemotherapy |
nci | numeric |
sample size in the control group receiving radiotherapy alone |
e1i | numeric |
number of survivors at 6 months in the experimental group |
c1i | numeric |
number of survivors at 6 months in the control group |
e2i | numeric |
number of survivors at 12 months in the experimental group |
c2i | numeric |
number of survivors at 12 months in the control group |
e3i | numeric |
number of survivors at 18 months in the experimental group |
c3i | numeric |
number of survivors at 18 months in the control group |
e4i | numeric |
number of survivors at 24 months in the experimental group |
c4i | numeric |
number of survivors at 24 months in the control group |
The 17 trials report the post-operative survival of patients with malignant gliomas receiving either radiation therapy with adjuvant chemotherapy or radiation therapy alone. Survival was assessed at 6, 12, 18, and 24 months in all but one study (which assessed survival only at 12 and at 24 months).
The data were reconstructed by Trikalinos and Olkin (2012) based on Table 2 in Fine et al. (1993) and Table 3 in Dear (1994). The data can be used to illustrate how a meta-analysis can be conducted of effect sizes reported at multiple time points using a multivariate model.
medicine, oncology, odds ratios, longitudinal models
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Dear, K. B. G. (1994). Iterative generalized least squares for meta-analysis of survival data at multiple times. Biometrics, 50(4), 989–1002. https://doi.org/10.2307/2533438
Trikalinos, T. A., & Olkin, I. (2012). Meta-analysis of effect sizes reported at multiple time points: A multivariate approach. Clinical Trials, 9(5), 610–620. https://doi.org/10.1177/1740774512453218
Fine, H. A., Dear, K. B., Loeffler, J. S., Black, P. M., & Canellos, G. P. (1993). Meta-analysis of radiation therapy with and without adjuvant chemotherapy for malignant gliomas in adults. Cancer, 71(8), 2585–2597. https://doi.org/10.1002/1097-0142(19930415)71:8<2585::aid-cncr2820710825>3.0.co;2-s
### copy data into 'dat' and examine data dat <- dat.fine1993 dat ## Not run: ### load metafor package library(metafor) ### calculate log(ORs) and sampling variances for each time point dat <- escalc(measure="OR", ai=e1i, n1i=nei, ci=c1i, n2i=nci, data=dat, var.names=c("y1i","v1i")) dat <- escalc(measure="OR", ai=e2i, n1i=nei, ci=c2i, n2i=nci, data=dat, var.names=c("y2i","v2i")) dat <- escalc(measure="OR", ai=e3i, n1i=nei, ci=c3i, n2i=nci, data=dat, var.names=c("y3i","v3i")) dat <- escalc(measure="OR", ai=e4i, n1i=nei, ci=c4i, n2i=nci, data=dat, var.names=c("y4i","v4i")) ### calculate the covariances (equations in Appendix of Trikalinos & Olkin, 2012) dat$v12i <- with(dat, nei / (e1i * (nei - e2i)) + nci / (c1i * (nci - c2i))) dat$v13i <- with(dat, nei / (e1i * (nei - e3i)) + nci / (c1i * (nci - c3i))) dat$v14i <- with(dat, nei / (e1i * (nei - e4i)) + nci / (c1i * (nci - c4i))) dat$v23i <- with(dat, nei / (e2i * (nei - e3i)) + nci / (c2i * (nci - c3i))) dat$v24i <- with(dat, nei / (e2i * (nei - e4i)) + nci / (c2i * (nci - c4i))) dat$v34i <- with(dat, nei / (e3i * (nei - e4i)) + nci / (c3i * (nci - c4i))) ### create dataset in long format dat.long <- data.frame(study=rep(1:nrow(dat), each=4), time=1:4, yi=c(t(dat[c("y1i","y2i","y3i","y4i")])), vi=c(t(dat[c("v1i","v2i","v3i","v4i")]))) ### var-cov matrices of the studies V <- lapply(split(dat, dat$study), function(x) matrix(c( x$v1i, x$v12i, x$v13i, x$v14i, x$v12i, x$v2i, x$v23i, x$v24i, x$v13i, x$v23i, x$v3i, x$v34i, x$v14i, x$v24i, x$v34i, x$v4i), nrow=4, ncol=4, byrow=TRUE)) ### remove rows for the missing time points in study 17 dat.long <- na.omit(dat.long) ### remove corresponding rows/columns from var-cov matrix V[[17]] <- V[[17]][c(2,4),c(2,4)] ### make a copy of V Vc <- V ### replace any (near) singular var-cov matrices with ridge corrected versions repl.Vi <- function(Vi) { res <- eigen(Vi) if (any(res$values <= 0.08)) { round(res$vectors %*% diag(res$values + 0.08) %*% t(res$vectors), 12) } else { Vi } } Vc <- lapply(Vc, repl.Vi) ### do not correct var-cov matrix of study 17 Vc[[17]] <- V[[17]] ### construct block diagonal matrix Vc <- bldiag(Vc) ### multivariate fixed-effects model res <- rma.mv(yi, Vc, mods = ~ 0 + factor(time), method="FE", data=dat.long) print(res, digits=3) ### multivariate random-effects model with heteroscedastic AR(1) structure for the true effects res <- rma.mv(yi, Vc, mods = ~ 0 + factor(time), random = ~ time | study, struct="HAR", data=dat.long, control=list(optimizer="hjk")) print(res, digits=3) ### profile the variance components par(mfrow=c(2,2)) profile(res, tau2=1, xlim=c( 0, 0.2)) profile(res, tau2=2, xlim=c( 0, 0.2)) profile(res, tau2=3, xlim=c( 0, 0.2)) profile(res, tau2=4, xlim=c(0.1, 0.3)) ### profile the autocorrelation coefficient par(mfrow=c(1,1)) profile(res, rho=1) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.fine1993 dat ## Not run: ### load metafor package library(metafor) ### calculate log(ORs) and sampling variances for each time point dat <- escalc(measure="OR", ai=e1i, n1i=nei, ci=c1i, n2i=nci, data=dat, var.names=c("y1i","v1i")) dat <- escalc(measure="OR", ai=e2i, n1i=nei, ci=c2i, n2i=nci, data=dat, var.names=c("y2i","v2i")) dat <- escalc(measure="OR", ai=e3i, n1i=nei, ci=c3i, n2i=nci, data=dat, var.names=c("y3i","v3i")) dat <- escalc(measure="OR", ai=e4i, n1i=nei, ci=c4i, n2i=nci, data=dat, var.names=c("y4i","v4i")) ### calculate the covariances (equations in Appendix of Trikalinos & Olkin, 2012) dat$v12i <- with(dat, nei / (e1i * (nei - e2i)) + nci / (c1i * (nci - c2i))) dat$v13i <- with(dat, nei / (e1i * (nei - e3i)) + nci / (c1i * (nci - c3i))) dat$v14i <- with(dat, nei / (e1i * (nei - e4i)) + nci / (c1i * (nci - c4i))) dat$v23i <- with(dat, nei / (e2i * (nei - e3i)) + nci / (c2i * (nci - c3i))) dat$v24i <- with(dat, nei / (e2i * (nei - e4i)) + nci / (c2i * (nci - c4i))) dat$v34i <- with(dat, nei / (e3i * (nei - e4i)) + nci / (c3i * (nci - c4i))) ### create dataset in long format dat.long <- data.frame(study=rep(1:nrow(dat), each=4), time=1:4, yi=c(t(dat[c("y1i","y2i","y3i","y4i")])), vi=c(t(dat[c("v1i","v2i","v3i","v4i")]))) ### var-cov matrices of the studies V <- lapply(split(dat, dat$study), function(x) matrix(c( x$v1i, x$v12i, x$v13i, x$v14i, x$v12i, x$v2i, x$v23i, x$v24i, x$v13i, x$v23i, x$v3i, x$v34i, x$v14i, x$v24i, x$v34i, x$v4i), nrow=4, ncol=4, byrow=TRUE)) ### remove rows for the missing time points in study 17 dat.long <- na.omit(dat.long) ### remove corresponding rows/columns from var-cov matrix V[[17]] <- V[[17]][c(2,4),c(2,4)] ### make a copy of V Vc <- V ### replace any (near) singular var-cov matrices with ridge corrected versions repl.Vi <- function(Vi) { res <- eigen(Vi) if (any(res$values <= 0.08)) { round(res$vectors %*% diag(res$values + 0.08) %*% t(res$vectors), 12) } else { Vi } } Vc <- lapply(Vc, repl.Vi) ### do not correct var-cov matrix of study 17 Vc[[17]] <- V[[17]] ### construct block diagonal matrix Vc <- bldiag(Vc) ### multivariate fixed-effects model res <- rma.mv(yi, Vc, mods = ~ 0 + factor(time), method="FE", data=dat.long) print(res, digits=3) ### multivariate random-effects model with heteroscedastic AR(1) structure for the true effects res <- rma.mv(yi, Vc, mods = ~ 0 + factor(time), random = ~ time | study, struct="HAR", data=dat.long, control=list(optimizer="hjk")) print(res, digits=3) ### profile the variance components par(mfrow=c(2,2)) profile(res, tau2=1, xlim=c( 0, 0.2)) profile(res, tau2=2, xlim=c( 0, 0.2)) profile(res, tau2=3, xlim=c( 0, 0.2)) profile(res, tau2=4, xlim=c(0.1, 0.3)) ### profile the autocorrelation coefficient par(mfrow=c(1,1)) profile(res, rho=1) ## End(Not run)
Results from 7 trials examining the effectiveness of four dopamine agonists and placebo to reduce “off-time” in patients with advanced Parkinson disease.
dat.franchini2012
dat.franchini2012
The data frame contains the following columns:
Study | character |
study label |
Treatment1 | character |
treatment 1 |
y1 | numeric |
treatment effect arm 1 |
sd1 | numeric |
standard deviation arm 2 |
n1 | integer |
sample size arm 1 |
Treatment2 | character |
treatment 2 |
y2 | numeric |
treatment effect arm 2 |
sd2 | numeric |
standard deviation arm 2 |
n2 | integer |
sample size arm 1 |
Treatment3 | character |
treatment 3 |
y3 | numeric |
treatment effect arm 3 |
sd3 | numeric |
standard deviation arm 2 |
n3 | integer |
sample size arm 1 |
This network meta-analysis compared the effectiveness of four active treatments and placebo in patients with advanced Parkinson disease (Franchini et al., 2012). The outcome is mean lost work-time reduction in patients given dopamine agonists as adjunct therapy. The data are given as sample size, mean, and standard deviation in each trial arm.
This dataset was used as an example in the supplemental material of Dias et al. (2013) where placebo is coded as 1 and the four active drugs as 2 to 5.
medicine, raw mean differences, network meta-analysis
Guido Schwarzer, [email protected], https://github.com/guido-s/
Dias, S., Sutton, A. J., Ades, A. E., & Welton, N. J. (2013). Evidence synthesis for decision making 2: A generalized linear modeling framework for pairwise and network meta-analysis of randomized controlled trials. Medical Decision Making, 33(5), 607–617. https://doi.org/10.1177/0272989X12458724
Franchini, A. J., Dias, S., Ades, A. E., Jansen, J. P., & Welton, N. J. (2012). Accounting for correlation in network meta-analysis with multi-arm trials. Research Synthesis Methods, 3(2), 142–160. https://doi.org/10.1002/jrsm.1049
### Show results from first three studies; third study is a three-arm ### study head(dat.franchini2012, 3) ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print mean differences with two digits oldset <- settings.meta(digits = 2) ### Transform data from wide arm-based format to contrast-based ### format. Argument 'sm' must not be provided as the mean difference ### is the default in R function metacont() called internally. pw <- pairwise(list(Treatment1, Treatment2, Treatment3), n = list(n1, n2, n3), mean = list(y1, y2, y3), sd = list(sd1, sd2, sd3), data = dat.franchini2012, studlab = Study, sm = "MD") ### Show calculated mean differences (TE) for first three studies pw[1:5, c(3:7, 10, 1)] ### Conduct network meta-analysis net <- netmeta(pw) net ### Draw network graph netgraph(net, points = TRUE, cex.points = 3, cex = 1.5, plastic = TRUE, thickness = "se.fixed", iterate = TRUE, start = "eigen") ### Use previous settings settings.meta(oldset) ## End(Not run)
### Show results from first three studies; third study is a three-arm ### study head(dat.franchini2012, 3) ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print mean differences with two digits oldset <- settings.meta(digits = 2) ### Transform data from wide arm-based format to contrast-based ### format. Argument 'sm' must not be provided as the mean difference ### is the default in R function metacont() called internally. pw <- pairwise(list(Treatment1, Treatment2, Treatment3), n = list(n1, n2, n3), mean = list(y1, y2, y3), sd = list(sd1, sd2, sd3), data = dat.franchini2012, studlab = Study, sm = "MD") ### Show calculated mean differences (TE) for first three studies pw[1:5, c(3:7, 10, 1)] ### Conduct network meta-analysis net <- netmeta(pw) net ### Draw network graph netgraph(net, points = TRUE, cex.points = 3, cex = 1.5, plastic = TRUE, thickness = "se.fixed", iterate = TRUE, start = "eigen") ### Use previous settings settings.meta(oldset) ## End(Not run)
Results from 4 case-control studies examining the association between the CASP8 -652 6N del promoter polymorphism and breast cancer risk.
dat.frank2008
dat.frank2008
The data frame contains the following columns:
study | character |
study identifier |
bc.ins.ins | numeric |
number of cases who have a homozygous insertion polymorphism |
bc.ins.del | numeric |
number of cases who have a heterozygous insertion/deletion polymorphism |
bc.del.del | numeric |
number of cases who have a homozygous deletion polymorphism |
ct.ins.ins | numeric |
number of controls who have a homozygous insertion polymorphism |
ct.ins.del | numeric |
number of controls who are heterozygous insertion/deletion polymorphism |
ct.del.del | numeric |
number of controls who have a homozygous deletion polymorphism |
The 4 studies included in this dataset are case-control studies that have examined the association between the CASP8 -652 6N del promoter polymorphism and breast cancer risk. Breast cancer cases and controls were genotyped and either had a homozygous insertion, a heterozygous insertion/deletion, or a homozygous deletion polymorphism.
Ziegler et al. (2011) used the same dataset to illustrate the use of meta-analytic methods to examine deviations from Hardy-Weinberg equilibrium across multiple studies. The relative excess heterozygosity (REH) is the proposed measure for such a meta-analysis, which can be computed by setting measure="REH"
.
medicine, oncology, genetics, odds ratios
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Frank, B., Rigas, S. H., Bermejo, J. L., Wiestler, M., Wagner, K., Hemminki, K., Reed, M. W., Sutter, C., Wappenschmidt, B., Balasubramanian, S. P., Meindl, A., Kiechle, M., Bugert, P., Schmutzler, R. K., Bartram, C. R., Justenhoven, C., Ko, Y.-D., Brüning, T., Brauch, H., Hamann, U., Pharoah, P. P. D., Dunning, A. M., Pooley, K. A., Easton, D. F., Cox, A. & Burwinkel, B. (2008). The CASP8 -652 6N del promoter polymorphism and breast cancer risk: A multicenter study. Breast Cancer Research and Treatment, 111(1), 139–144. https://doi.org/10.1007/s10549-007-9752-z
Ziegler, A., Steen, K. V. & Wellek, S. (2011). Investigating Hardy-Weinberg equilibrium in case-control or cohort studies or meta-analysis. Breast Cancer Research and Treatment, 128(1), 197–201. https://doi.org/10.1007/s10549-010-1295-z
### copy data into 'dat' and examine data dat <- dat.frank2008 dat ## Not run: ### load metafor package library(metafor) ### calculate log odds ratios comparing ins/del versus ins/ins dat <- escalc(measure="OR", ai=bc.ins.del, bi=bc.ins.ins, ci=ct.ins.del, di=ct.ins.ins, data=dat) ### fit random-effects model and get the pooled odds ratio (with 95% CI) res <- rma(yi, vi, data=dat) res predict(res, transf=exp, digits=2) ### calculate log odds ratios comparing del/del versus ins/ins dat <- escalc(measure="OR", ai=bc.del.del, bi=bc.ins.ins, ci=ct.del.del, di=ct.ins.ins, data=dat) ### fit random-effects model and get the pooled odds ratio (with 95% CI) res <- rma(yi, vi, data=dat) res predict(res, transf=exp, digits=2) ### calculate log odds ratios comparing ins/del+del/del versus ins/ins dat <- escalc(measure="OR", ai=bc.ins.del+bc.del.del, bi=bc.ins.ins, ci=ct.ins.del+ct.del.del, di=ct.ins.ins, data=dat) ### fit random-effects model and get the pooled odds ratio (with 95% CI) res <- rma(yi, vi, data=dat) res predict(res, transf=exp, digits=2) ############################################################################ ### compute the relative excess heterozygosity in the controls dat <- escalc(measure="REH", ai=ct.ins.ins, bi=ct.ins.del, ci=ct.del.del, slab=study, data=dat) ### fit random-effects model and get the pooled REH value (with 90% CI) res <- rma(yi, vi, data=dat, level=90) res predict(res, transf=exp, digits=2) ### draw forest plot forest(res, atransf=exp, header=TRUE, top=2, xlim=c(-1.4,1.4), at=log(c(0.5,5/7,1,7/5,2))) segments(log(5/7), -2, log(5/7), res$k+1, lty="dotted") segments(log(7/5), -2, log(7/5), res$k+1, lty="dotted") ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.frank2008 dat ## Not run: ### load metafor package library(metafor) ### calculate log odds ratios comparing ins/del versus ins/ins dat <- escalc(measure="OR", ai=bc.ins.del, bi=bc.ins.ins, ci=ct.ins.del, di=ct.ins.ins, data=dat) ### fit random-effects model and get the pooled odds ratio (with 95% CI) res <- rma(yi, vi, data=dat) res predict(res, transf=exp, digits=2) ### calculate log odds ratios comparing del/del versus ins/ins dat <- escalc(measure="OR", ai=bc.del.del, bi=bc.ins.ins, ci=ct.del.del, di=ct.ins.ins, data=dat) ### fit random-effects model and get the pooled odds ratio (with 95% CI) res <- rma(yi, vi, data=dat) res predict(res, transf=exp, digits=2) ### calculate log odds ratios comparing ins/del+del/del versus ins/ins dat <- escalc(measure="OR", ai=bc.ins.del+bc.del.del, bi=bc.ins.ins, ci=ct.ins.del+ct.del.del, di=ct.ins.ins, data=dat) ### fit random-effects model and get the pooled odds ratio (with 95% CI) res <- rma(yi, vi, data=dat) res predict(res, transf=exp, digits=2) ############################################################################ ### compute the relative excess heterozygosity in the controls dat <- escalc(measure="REH", ai=ct.ins.ins, bi=ct.ins.del, ci=ct.del.del, slab=study, data=dat) ### fit random-effects model and get the pooled REH value (with 90% CI) res <- rma(yi, vi, data=dat, level=90) res predict(res, transf=exp, digits=2) ### draw forest plot forest(res, atransf=exp, header=TRUE, top=2, xlim=c(-1.4,1.4), at=log(c(0.5,5/7,1,7/5,2))) segments(log(5/7), -2, log(5/7), res$k+1, lty="dotted") segments(log(7/5), -2, log(7/5), res$k+1, lty="dotted") ## End(Not run)
Results on depression severity from 17 studies comparing low dosage tricyclic antidepressants (TCA) and placebo for the treatment of depression.
dat.furukawa2003
dat.furukawa2003
The data frame contains the following columns:
author | character |
First author with information on dosage in parentheses |
Ne | integer |
number of patients in low TCA group |
Me | numeric |
depression severity (low TCA) |
Se | numeric |
standard deviation (low TCA) |
Nc | integer |
number of patients in placebo group |
Mc | numeric |
depression severity (placebo) |
Sc | numeric |
standard deviation (placebo) |
Furukawa et al. (2003) carried out a systematic review comparing low dosage tricyclic antidepressants (TCA) with placebo for the treatment of depression. They reported the effect on presence/absence of depression and on depression severity at various time points. Here we focus on depression severity at four weeks. Most studies used some version of the Hamilton Depression Rating Scale, however, some studies used the Montgomery-Asberg Depression Rating Scale. Accordingly, it is not possible to pool the estimated effects directly.
This data set is used as an example in Schwarzer et al. (2015).
standardized mean differences
Guido Schwarzer, [email protected], https://github.com/guido-s/
Furukawa, T. A., McGuire, H., & Barbui, C. (2003). Low dosage tricyclic antidepressants for depression. Cochrane Database of Systematic Reviews, 3, CD003197. https://doi.org/10.1002/14651858.CD003197
Schwarzer, G., Carpenter, J. R., & Rücker, G. (2015). Meta-analysis with R. Cham, Switzerland: Springer.
### Show first five studies head(dat.furukawa2003, 5) ## Not run: ### Load meta package suppressPackageStartupMessages(library("meta")) ### Use RevMan5 settings oldset <- settings.meta("RevMan5", digits = 2) ### Conduct random effects meta-analysis with Hedges' g as effect measure mc2 <- metacont(Ne, Me, Se, Nc, Mc, Sc, common = FALSE, data = dat.furukawa2003, sm = "SMD") mc2 ### Use previous settings settings.meta(oldset) ## End(Not run)
### Show first five studies head(dat.furukawa2003, 5) ## Not run: ### Load meta package suppressPackageStartupMessages(library("meta")) ### Use RevMan5 settings oldset <- settings.meta("RevMan5", digits = 2) ### Conduct random effects meta-analysis with Hedges' g as effect measure mc2 <- metacont(Ne, Me, Se, Nc, Mc, Sc, common = FALSE, data = dat.furukawa2003, sm = "SMD") mc2 ### Use previous settings settings.meta(oldset) ## End(Not run)
Results from 15 trials examining the effectiveness of self-management education and regular medical review for adults with asthma.
dat.gibson2002
dat.gibson2002
The data frame contains the following columns:
author | character |
first author of study |
year | numeric |
publication year |
n1i | numeric |
number of participants in the intervention group |
m1i | numeric |
mean number of days off work/school in the intervention group |
sd1i | numeric |
standard deviation of the number of days off work/school in the intervention group |
n2i | numeric |
number of participants in the control/comparison group |
m2i | numeric |
mean number of days off work/school in the control/comparison group |
sd2i | numeric |
standard deviation of the number of days off work/school in the control/comparison group |
ai | numeric |
number of participants who had one or more days off work/school in the intervention group |
bi | numeric |
number of participants who no days off work/school in the intervention group |
ci | numeric |
number of participants who had one or more days off work/school in the control/comparison group |
di | numeric |
number of participants who no days off work/school in the control/comparison group |
type | numeric |
numeric code for the intervention type (see ‘Details’) |
Asthma management guidelines typically recommend for patients to receive education and regular medical review. While self-management programs have been shown to increase patient knowledge, it is less clear to what extent they actually impact health outcomes. The systematic review by Gibson et al. (2002) examined the effectiveness of self-management education and regular medical review for adults with asthma. In each study, participants receiving a certain management intervention were compared against those in a control/comparison group with respect to a variety of health outcomes. One of the outcomes examined in a number of studies was the number of days off work/school.
The majority of studies reporting this outcome provided means and standard deviations allowing a meta-analysis of standardized mean differences. Seven studies also reported the number of participants who had one or more days off work/school in each group. These studies could be meta-analyzed using, for example, (log) risk ratios. Finally, one could also consider a combined analysis based on standardized mean differences computed from the means and standard deviations where available and using probit transformed risk differences (which also provide estimates of the standardized mean difference) for the remaining studies.
Some degree of patient education was provided in all studies. In addition, the type
variable indicates what additional intervention components were included in each study:
optimal self-management (writing action plan, self-monitoring, regular medical review),
self-monitoring and regular medical review,
self-monitoring only,
regular medical review only,
written action plan only.
medicine, primary care, risk ratios, standardized mean differences
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Gibson, P. G., Powell, H., Wilson, A., Abramson, M. J., Haywood, P., Bauman, A., Hensley, M. J., Walters, E. H., & Roberts, J. J. L. (2002). Self-management education and regular practitioner review for adults with asthma. Cochrane Database of Systematic Reviews, 3, CD001117. https://doi.org/10.1002/14651858.CD001117
### copy data into 'dat' and examine data dat <- dat.gibson2002 dat ## Not run: ### load metafor package library(metafor) ### compute standardized mean differences and corresponding sampling variances dat <- escalc(measure="SMD", m1i=m1i, sd1i=sd1i, n1i=n1i, m2i=m2i, sd2i=sd2i, n2i=n2i, data=dat) dat ### fit an equal-effects model to the standardized mean differences (as in Gibson et al., 2002) res <- rma(yi, vi, data=dat, method="EE") print(res, digits=2) ### compute log risk ratios and corresponding sampling variances dat <- escalc(measure="RR", ai=ai, bi=bi, ci=ci, di=di, data=dat) dat ### fit an equal-effects model to the log risk ratios res <- rma(yi, vi, data=dat, method="EE") print(res, digits=2) predict(res, transf=exp, digits=2) ### note: Gibson et al. (2002) used the Mantel-Haenszel method for their analysis rma.mh(measure="RR", ai=ai, bi=bi, ci=ci, di=di, data=dat, digits=2) ### compute standardized mean differences where possible and otherwise probit transformed ### risk differences (which also provide estimates of the standardized mean differences) dat <- escalc(measure="SMD", m1i=m1i, sd1i=sd1i, n1i=n1i, m2i=m2i, sd2i=sd2i, n2i=n2i, data=dat, add.measure=TRUE) dat <- escalc(measure="PBIT", ai=ai, bi=bi, ci=ci, di=di, data=dat, replace=FALSE, add.measure=TRUE) dat ### fit a random-effects model to these estimates res <- rma(yi, vi, data=dat) print(res, digits=2) ### meta-regression model examining if there are systematic differences based on the ### type of measure used (there are only 2 studies where measure="PBIT", so this isn't ### very conclusive here, but shown for illustration purposes) res <- rma(yi, vi, mods = ~ measure, data=dat) print(res, digits=2) predict(res, newmods=1, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.gibson2002 dat ## Not run: ### load metafor package library(metafor) ### compute standardized mean differences and corresponding sampling variances dat <- escalc(measure="SMD", m1i=m1i, sd1i=sd1i, n1i=n1i, m2i=m2i, sd2i=sd2i, n2i=n2i, data=dat) dat ### fit an equal-effects model to the standardized mean differences (as in Gibson et al., 2002) res <- rma(yi, vi, data=dat, method="EE") print(res, digits=2) ### compute log risk ratios and corresponding sampling variances dat <- escalc(measure="RR", ai=ai, bi=bi, ci=ci, di=di, data=dat) dat ### fit an equal-effects model to the log risk ratios res <- rma(yi, vi, data=dat, method="EE") print(res, digits=2) predict(res, transf=exp, digits=2) ### note: Gibson et al. (2002) used the Mantel-Haenszel method for their analysis rma.mh(measure="RR", ai=ai, bi=bi, ci=ci, di=di, data=dat, digits=2) ### compute standardized mean differences where possible and otherwise probit transformed ### risk differences (which also provide estimates of the standardized mean differences) dat <- escalc(measure="SMD", m1i=m1i, sd1i=sd1i, n1i=n1i, m2i=m2i, sd2i=sd2i, n2i=n2i, data=dat, add.measure=TRUE) dat <- escalc(measure="PBIT", ai=ai, bi=bi, ci=ci, di=di, data=dat, replace=FALSE, add.measure=TRUE) dat ### fit a random-effects model to these estimates res <- rma(yi, vi, data=dat) print(res, digits=2) ### meta-regression model examining if there are systematic differences based on the ### type of measure used (there are only 2 studies where measure="PBIT", so this isn't ### very conclusive here, but shown for illustration purposes) res <- rma(yi, vi, mods = ~ measure, data=dat) print(res, digits=2) predict(res, newmods=1, digits=2) ## End(Not run)
Results from 17 studies on the effectiveness of injected vaccines against cholera.
dat.graves2010
dat.graves2010
The data frame contains the following columns:
study | character |
author/study name and publication year |
ai | numeric |
number of cholera cases in the vaccinated group |
n1i | numeric |
number of individuals in the vaccinated group |
ci | numeric |
number of cholera cases in the placebo group |
n2i | numeric |
number of individuals in the placebo group |
Cholera is an infection caused by certain strains of the bacterium Vibrio cholerae. When untreated, mortality rates can be as high as 50-60%. Proper sanitation practices are usually effective in preventing outbreaks, but a number of oral and injectable vaccines have also been developed. The Cochrane review by Graves et al. (2010) examined the effectiveness of injectable vaccines for preventing cholera cases and death. The present dataset includes results from 17 studies that reported the number of cholera cases in vaccinated and placebo/comparison groups up to 7 months after the treatment.
medicine, risk ratios, Mantel-Haenszel method
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Graves, P. M., Deeks, J. J., Demicheli, V., & Jefferson, T. (2010). Vaccines for preventing cholera: Killed whole cell or other subunit vaccines (injected). Cochrane Database of Systematic Reviews, 8, CD000974. https://doi.org/10.1002/14651858.CD000974.pub2
### copy data into 'dat' and examine data dat <- dat.graves2010 dat ## Not run: ### load metafor package library(metafor) ### analysis using the Mantel-Haenszel method rma.mh(measure="RR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.graves2010 dat ## Not run: ### load metafor package library(metafor) ### analysis using the Mantel-Haenszel method rma.mh(measure="RR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, digits=2) ## End(Not run)
Results from 14 trials examining the mortality risk of interventions for decreasing blood loss and blood transfusion requirements during liver transplantation.
dat.gurusamy2011
dat.gurusamy2011
The data frame contains the following columns:
study | character |
study information |
treatment | character |
treatment |
death | integer |
mortality at 60 days post-transplantation |
n | integer |
number of individuals |
This network meta-analysis compared the effectiveness of seven interventions for decreasing blood loss and blood transfusion requirements during liver transplantation (Gurusamy et al., 2011).
Fourteen studies reported mortality at 60 days, in 1,002 patients. Forty-five deaths were reported across all studies (4.5%). Six studies observed deaths in all treatment arms while three studies did not observe any deaths.
This dataset was used in Efthimiou et al. (2019) to introduce the Mantel-Haenszel method for network meta-analysis.
One of the treatments (solvent detergent plasma) was only included in one study with zero events in both treatment arms; this study was excluded from all network meta-analyses. In addition, no death was observed in the antithrombin III arm of the only study evaluating this treatment which was excluded from the Mantel-Haenszel network meta-analysis.
medicine, odds ratios, network meta-analysis, Mantel-Haenszel method
Guido Schwarzer, [email protected], https://github.com/guido-s/
Gurusamy, K. S., Pissanou, T., Pikhart, H., Vaughan, J., Burroughs, A. K., & Davidson, B. R. (2011). Methods to decrease blood loss and transfusion requirements for liver transplantation. Cochrane Database of Systematic Reviews, 12, CD009052. https://doi.org/10.1002/14651858.CD009052.pub2
Efthimiou, O., Rücker, G., Schwarzer, G., Higgins, J., Egger, M., & Salanti, G. (2019). A Mantel-Haenszel model for network meta-analysis of rare events. Statistics in Medicine, 38(16), 2992–3012. https://doi.org/10.1002/sim.8158
### Show first 6 rows of the dataset head(dat.gurusamy2011) ### Only study evaluating solvent detergent plasma subset(dat.gurusamy2011, study == "Williamson 1999") ### Only study evaluating antithrombin III subset(dat.gurusamy2011, study == "Baudo 1992") ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print odds ratios and confidence limits with two digits oldset <- settings.meta(digits = 2) ### Change appearance of confidence intervals cilayout("(", "-") ### Transform data from long arm-based format to contrast-based ### format. Argument 'sm' has to be used for odds ratio as summary ### measure; by default the risk ratio is used in the metabin function ### called internally. pw <- pairwise(treatment, death, n, studlab = study, data = dat.gurusamy2011, sm = "OR") ### Conduct Mantel-Haenszel network meta-analysis (NMA) net.MH <- netmetabin(pw, ref = "cont") ### Conduct inverse variance (IV) network meta-analysis net.IV <- netmeta(pw, ref = "cont") ### Network graph (Mantel-Haenszel NMA) netgraph(net.MH, seq = "optimal", col = "black", plastic = FALSE, points = TRUE, pch = 21, cex.points = 3, col.points = "black", bg.points = "gray", thickness = "se.fixed", number.of.studies = TRUE) ### Full network graph (based on inverse variance method, including ### study comparing Antithrombin III with Control/Placebo) netgraph(net.IV, seq = "optimal", col = "black", plastic = FALSE, points = TRUE, pch = 21, cex.points = 3, col.points = "black", bg.points = "gray", thickness = "se.fixed", number.of.studies = TRUE) ### Compare results for Mantel-Haenszel and IV NMA forest(netbind(net.MH, net.IV, random = FALSE, name = c("MH NMA", "IV NMA"))) ### Show results for Mantel-Haenszel NMA net.MH forest(net.MH) ### League table with network estimates in lower triangle and direct ### estimates in upper triangle netleague(net.MH) ### Assess inconsistency print(netsplit(net.MH), show = "both", ci = TRUE, overall = FALSE, nchar.trts = 6) ### Use previous settings settings.meta(oldset) ## End(Not run)
### Show first 6 rows of the dataset head(dat.gurusamy2011) ### Only study evaluating solvent detergent plasma subset(dat.gurusamy2011, study == "Williamson 1999") ### Only study evaluating antithrombin III subset(dat.gurusamy2011, study == "Baudo 1992") ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print odds ratios and confidence limits with two digits oldset <- settings.meta(digits = 2) ### Change appearance of confidence intervals cilayout("(", "-") ### Transform data from long arm-based format to contrast-based ### format. Argument 'sm' has to be used for odds ratio as summary ### measure; by default the risk ratio is used in the metabin function ### called internally. pw <- pairwise(treatment, death, n, studlab = study, data = dat.gurusamy2011, sm = "OR") ### Conduct Mantel-Haenszel network meta-analysis (NMA) net.MH <- netmetabin(pw, ref = "cont") ### Conduct inverse variance (IV) network meta-analysis net.IV <- netmeta(pw, ref = "cont") ### Network graph (Mantel-Haenszel NMA) netgraph(net.MH, seq = "optimal", col = "black", plastic = FALSE, points = TRUE, pch = 21, cex.points = 3, col.points = "black", bg.points = "gray", thickness = "se.fixed", number.of.studies = TRUE) ### Full network graph (based on inverse variance method, including ### study comparing Antithrombin III with Control/Placebo) netgraph(net.IV, seq = "optimal", col = "black", plastic = FALSE, points = TRUE, pch = 21, cex.points = 3, col.points = "black", bg.points = "gray", thickness = "se.fixed", number.of.studies = TRUE) ### Compare results for Mantel-Haenszel and IV NMA forest(netbind(net.MH, net.IV, random = FALSE, name = c("MH NMA", "IV NMA"))) ### Show results for Mantel-Haenszel NMA net.MH forest(net.MH) ### League table with network estimates in lower triangle and direct ### estimates in upper triangle netleague(net.MH) ### Assess inconsistency print(netsplit(net.MH), show = "both", ci = TRUE, overall = FALSE, nchar.trts = 6) ### Use previous settings settings.meta(oldset) ## End(Not run)
Results from 37 studies on the risk of lung cancer in women exposed to environmental tobacco smoke (ETS) from their smoking spouse.
dat.hackshaw1998
dat.hackshaw1998
The data frame contains the following columns:
study | numeric |
study number |
author | character |
first author of study |
year | numeric |
publication year |
country | character |
country where study was conducted |
design | character |
study design (either cohort or case-control) |
cases | numeric |
number of lung cancer cases |
or | numeric |
odds ratio |
or.lb | numeric |
lower bound of 95% CI for the odds ratio |
or.ub | numeric |
upper bound of 95% CI for the odds ratio |
yi | numeric |
log odds ratio |
vi | numeric |
corresponding sampling variance |
The dataset includes the results from 37 studies (4 cohort, 33 case-control) examining if women (who are lifelong nonsmokers) have an elevated risk for lung cancer due to exposure to environmental tobacco smoke (ETS) from their smoking spouse. Values of the log odds ratio greater than 0 indicate an increased risk of cancer in exposed women compared to women not exposed to ETS from their spouse.
Note that the log odds ratios and corresponding sampling variances were back-calculated from the reported odds ratios and confidence interval (CI) bounds (see ‘Examples’). Since the reported values were rounded to some extent, this introduces some minor inaccuracies into the back-calculations. The overall estimate reported in Hackshaw et al. (1997) and Hackshaw (1998) can be fully reproduced though.
medicine, oncology, epidemiology, smoking, odds ratios
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Hackshaw, A. K., Law, M. R., & Wald, N. J. (1997). The accumulated evidence on lung cancer and environmental tobacco smoke. British Medical Journal, 315(7114), 980–988. https://doi.org/10.1136/bmj.315.7114.980
Hackshaw, A. K. (1998). Lung cancer and passive smoking. Statistical Methods in Medical Research, 7(2), 119–136. https://doi.org/10.1177/096228029800700203
### copy data into 'dat' and examine data dat <- dat.hackshaw1998 head(dat, 10) ## Not run: ### load metafor package library(metafor) ### random-effects model using the log odds ratios res <- rma(yi, vi, data=dat, method="DL") res ### estimated average odds ratio with CI (and prediction interval) predict(res, transf=exp, digits=2) ### illustrate how the log odds ratios and corresponding sampling variances ### can be back-calculated based on the reported odds ratios and CI bounds dat$yi <- NULL dat$vi <- NULL dat <- data.frame(dat) head(dat, 10) dat <- conv.wald(out=or, ci.lb=or.lb, ci.ub=or.ub, data=dat, transf=log) head(dat, 10) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.hackshaw1998 head(dat, 10) ## Not run: ### load metafor package library(metafor) ### random-effects model using the log odds ratios res <- rma(yi, vi, data=dat, method="DL") res ### estimated average odds ratio with CI (and prediction interval) predict(res, transf=exp, digits=2) ### illustrate how the log odds ratios and corresponding sampling variances ### can be back-calculated based on the reported odds ratios and CI bounds dat$yi <- NULL dat$vi <- NULL dat <- data.frame(dat) head(dat, 10) dat <- conv.wald(out=or, ci.lb=or.lb, ci.ub=or.ub, data=dat, transf=log) head(dat, 10) ## End(Not run)
Results from 12 trials examining the effectiveness of a reduced versus standard rehydration solution for the prevention of unscheduled intravenous infusion in children with diarrhoea.
dat.hahn2001
dat.hahn2001
The data frame contains the following columns:
study | character |
trial name and year |
ai | numeric |
number of children requiring unscheduled intravenous infusion in the reduced rehydration solution group |
n1i | numeric |
number of children in the reduced rehydration solution group |
ci | numeric |
number of children requiring unscheduled intravenous infusion in the standard rehydration solution group |
n2i | numeric |
number of children in the standard rehydration solution group |
The dataset includes the results from 12 randomized clinical trials that examined the effectiveness of a reduced osmolarity oral rehydration solution (total osmolarity <250 mmol/l with reduced sodium) with a standard WHO oral rehydration solution (sodium 90 mmol/l, glucose 111mmol/l, total osmolarity 311 mmol/l) for the prevention of unscheduled intravenous infusion in children with diarrhoea.
medicine, odds ratios, Mantel-Haenszel method
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Hahn, S., Kim, Y., & Garner, P. (2001). Reduced osmolarity oral rehydration solution for treating dehydration due to diarrhoea in children: Systematic review. British Medical Journal, 323(7304), 81–85. https://doi.org/10.1136/bmj.323.7304.81
### copy data into 'dat' and examine data dat <- dat.hahn2001 dat ## Not run: ### load metafor package library(metafor) ### meta-analysis of (log) odds rations using the Mantel-Haenszel method res <- rma.mh(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, digits=2, slab=study) res ### forest plot (also show studies that were excluded from the analysis) options(na.action="na.pass") forest(res, atransf=exp, xlim=c(-11,9), at=log(c(0.01, 0.1, 1, 10, 100)), header=TRUE, top=2) options(na.action="na.omit") ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.hahn2001 dat ## Not run: ### load metafor package library(metafor) ### meta-analysis of (log) odds rations using the Mantel-Haenszel method res <- rma.mh(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, digits=2, slab=study) res ### forest plot (also show studies that were excluded from the analysis) options(na.action="na.pass") forest(res, atransf=exp, xlim=c(-11,9), at=log(c(0.01, 0.1, 1, 10, 100)), header=TRUE, top=2) options(na.action="na.omit") ## End(Not run)
Results from 35 studies measuring olfactory loss in COVID-19 patients using either objective or subjective measures.
dat.hannum2020
dat.hannum2020
The data frame contains the following columns:
authorName | character |
(first) author of study |
DOI | character |
article DOI number |
ni | numeric |
number of Covid-19 positive patients in the study |
xi | numeric |
number of Covid-19 positive patients in the study with olfactory loss |
percentOlfactoryLoss | numeric |
percent of the sample with olfactory loss |
objectivity | character |
objective or subjective measure used |
measured | character |
outcome measure |
testType | character |
type of test used |
country | character |
country where patients were treated |
patientType | character |
type of patient information and location where being treated |
One of the symptoms of COVID-19 infection is olfactory loss (loss of smell) either recently acquired anosmia (complete loss of smell) or hyposmia (partial loss of smell). One challenge to reaching this symptom is the wide range of reported prevalence for this symptom ranging from 5 percent to 98 percent. In this dataset studies were grouped into one of two groups based on the type of method used to measure smell loss (either subjective measures, such as self-reported smell loss, or objective measures using rated stimuli).
medicine, covid-19, proportions
W. Kyle Hamilton [email protected] https://kylehamilton.com
Ramirez VA , Hannum ME, Lipson SJ, Herriman RD, Toskala AK, Lin C, Joseph PV, Reed DR. 2020. COVID-19 Smell Loss Prevalence Tracker. Available from: https://vicente-ramirez.shinyapps.io/COVID19_Olfactory_Dashboard/
and https://github.com/vramirez4/OlfactoryLoss
(accessed August 11, 2021)
Hannum, M. E., Ramirez, V. A., Lipson, S. J., Herriman, R. D., Toskala, A. K., Lin, C., Joseph, P. V., & Reed, D. R. (2020). Objective sensory testing methods reveal a higher prevalence of olfactory loss in COVID-19 positive patients compared to subjective methods: A systematic review and meta-analysis. Chemical Senses, 45(9), 865–874. https://doi.org/10.1093/chemse/bjaa064
# copy data into 'dat' and examine data dat <- dat.hannum2020 dat ## Not run: # load metafor package library(metafor) # compute effect size dat <- escalc(measure="PR", xi=xi, ni=ni, data=dat) # split data into objective and subjective datasets dat_split <- split(dat, dat$objectivity) dat_objective <- dat_split[["Objective"]] dat_subjective <- dat_split[["Subjective"]] # random-effects model all studies res_all <- rma(yi, vi, data=dat) print(res_all, digits=2) # random-effects model objective res_objective <- rma(yi, vi, data=dat_objective) print(res_objective, digits=2) # random-effects model subjective res_subjective <- rma(yi, vi, data=dat_subjective) print(res_subjective, digits=2) ## End(Not run)
# copy data into 'dat' and examine data dat <- dat.hannum2020 dat ## Not run: # load metafor package library(metafor) # compute effect size dat <- escalc(measure="PR", xi=xi, ni=ni, data=dat) # split data into objective and subjective datasets dat_split <- split(dat, dat$objectivity) dat_objective <- dat_split[["Objective"]] dat_subjective <- dat_split[["Subjective"]] # random-effects model all studies res_all <- rma(yi, vi, data=dat) print(res_all, digits=2) # random-effects model objective res_objective <- rma(yi, vi, data=dat_objective) print(res_objective, digits=2) # random-effects model subjective res_subjective <- rma(yi, vi, data=dat_subjective) print(res_subjective, digits=2) ## End(Not run)
Results from 6 clinical trials examining the effectiveness of adjusted-dose warfarin for preventing strokes in patients with atrial fibrillation.
dat.hart1999
dat.hart1999
The data frame contains the following columns:
trial | numeric |
trial number |
study | character |
study name (abbreviated) |
year | numeric |
publication year |
x1i | numeric |
number of strokes in the warfarin group |
n1i | numeric |
number of patients in the warfarin group |
t1i | numeric |
total person-time (in years) in the warfarin group |
x2i | numeric |
number of strokes in the placebo/control group |
n2i | numeric |
number of patients in the placebo/control group |
t2i | numeric |
total person-time (in years) in the placebo/control group |
compgrp | character |
type of comparison group (placebo or control) |
prevtype | character |
type of prevention (primary or secondary) |
trinr | character |
target range for the international normalized ratio (INR) |
The 6 studies provide data with respect to the number of strokes in the warfarin and the comparison (placebo or control) group. In addition, the number of patients and the total person-time (in years) is provided for the two groups. The goal of the meta-analysis was to examine the effectiveness of adjusted-dose warfarin for preventing strokes in patients with atrial fibrillation.
medicine, cardiology, incidence rates
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Hart, R. G., Benavente, O., McBride, R., & Pearce, L. A. (1999). Antithrombotic therapy to prevent stroke in patients with atrial fibrillation: A meta-analysis. Annals of Internal Medicine, 131(7), 492–501. https://doi.org/10.7326/0003-4819-131-7-199910050-00003
### copy data into 'dat' and examine data dat <- dat.hart1999 dat ## Not run: ### load metafor package library(metafor) ### calculate log incidence rate ratios and corresponding sampling variances dat <- escalc(measure="IRR", x1i=x1i, x2i=x2i, t1i=t1i, t2i=t2i, data=dat) dat ### meta-analysis of log incidence rate ratios using a random-effects model res <- rma(yi, vi, data=dat) res ### average incidence rate ratio with 95% CI predict(res, transf=exp) ### forest plot with extra annotations par(mar=c(5,4,1,2)) forest(res, xlim=c(-11, 5), at=log(c(0.05, 0.25, 1, 4)), atransf=exp, slab=paste0(study, " (", year, ")"), ilab=cbind(paste(x1i, "/", t1i, sep=" "), paste(x2i, "/", t2i, sep=" ")), ilab.xpos=c(-6.5,-4), cex=0.85, header="Study (Year)") op <- par(cex=0.85, font=2) text(c(-6.5,-4), 8.5, c("Warfarin", "Control")) text(c(-6.5,-4), 7.5, c("Strokes / PT", "Strokes / PT")) segments(x0=-8, y0=8, x1=-2.75, y1=8) par(op) ### meta-analysis of incidence rate differences using a random-effects model res <- rma(measure="IRD", x1i=x1i, x2i=x2i, t1i=t1i, t2i=t2i, data=dat) res ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.hart1999 dat ## Not run: ### load metafor package library(metafor) ### calculate log incidence rate ratios and corresponding sampling variances dat <- escalc(measure="IRR", x1i=x1i, x2i=x2i, t1i=t1i, t2i=t2i, data=dat) dat ### meta-analysis of log incidence rate ratios using a random-effects model res <- rma(yi, vi, data=dat) res ### average incidence rate ratio with 95% CI predict(res, transf=exp) ### forest plot with extra annotations par(mar=c(5,4,1,2)) forest(res, xlim=c(-11, 5), at=log(c(0.05, 0.25, 1, 4)), atransf=exp, slab=paste0(study, " (", year, ")"), ilab=cbind(paste(x1i, "/", t1i, sep=" "), paste(x2i, "/", t2i, sep=" ")), ilab.xpos=c(-6.5,-4), cex=0.85, header="Study (Year)") op <- par(cex=0.85, font=2) text(c(-6.5,-4), 8.5, c("Warfarin", "Control")) text(c(-6.5,-4), 7.5, c("Strokes / PT", "Strokes / PT")) segments(x0=-8, y0=8, x1=-2.75, y1=8) par(op) ### meta-analysis of incidence rate differences using a random-effects model res <- rma(measure="IRD", x1i=x1i, x2i=x2i, t1i=t1i, t2i=t2i, data=dat) res ## End(Not run)
Results from 133 studies examining the effectiveness of nicotine replacement therapy (NRT) for smoking cessation at 6+ months of follow-up.
dat.hartmannboyce2018
dat.hartmannboyce2018
The data frame contains the following columns:
study | numeric |
study identifier |
x.nrt | numeric |
number of participants in the NRT group who were abstinent at the follow-up |
n.nrt | numeric |
number of participants in the NRT group |
x.ctrl | numeric |
number of participants in the control group who were abstinent at the follow-up |
n.ctrl | numeric |
number of participants in the control group |
treatment | character |
type of NRT provided in the treatment group |
The dataset includes the results from 133 studies examining the effectiveness of nicotine replacement therapy (NRT) for smoking cessation. The results given in this dataset pertain to abstinence at 6+ months of follow-up. NRT was provided to participants in the treatment groups in various forms as indicated by the treatment
variable (e.g., gum, patch, inhalator). Note that the dataset includes 136 rows, since a few studies included multiple treatments.
medicine, smoking, risk ratios, Mantel-Haenszel method
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Hartmann‐Boyce, J., Chepkin, S. C., Ye, W., Bullen, C. & Lancaster, T. (2018). Nicotine replacement therapy versus control for smoking cessation. Cochrane Database of Systematic Reviews, 5, CD000146. https://doi.org//10.1002/14651858.CD000146.pub5
### copy data into 'dat' and examine data dat <- dat.hartmannboyce2018 head(dat, 10) ## Not run: ### load metafor package library(metafor) ### turn treatment into a factor with the desired ordering dat$treatment <- factor(dat$treatment, levels=unique(dat$treatment)) ### meta-analysis per treatment using the M-H method lapply(split(dat, dat$treatment), function(x) rma.mh(measure="RR", ai=x.nrt, n1i=n.nrt, ci=x.ctrl, n2i=n.ctrl, data=x, digits=2)) ### all combined rma.mh(measure="RR", ai=x.nrt, n1i=n.nrt, ci=x.ctrl, n2i=n.ctrl, data=dat, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.hartmannboyce2018 head(dat, 10) ## Not run: ### load metafor package library(metafor) ### turn treatment into a factor with the desired ordering dat$treatment <- factor(dat$treatment, levels=unique(dat$treatment)) ### meta-analysis per treatment using the M-H method lapply(split(dat, dat$treatment), function(x) rma.mh(measure="RR", ai=x.nrt, n1i=n.nrt, ci=x.ctrl, n2i=n.ctrl, data=x, digits=2)) ### all combined rma.mh(measure="RR", ai=x.nrt, n1i=n.nrt, ci=x.ctrl, n2i=n.ctrl, data=dat, digits=2) ## End(Not run)
Results from 24 studies on the effectiveness of various counseling types for smoking cessation.
dat.hasselblad1998
dat.hasselblad1998
The data frame contains the following columns:
id | numeric |
id number for each treatment arm |
study | numeric |
study id number |
authors | character |
study author(s) |
year | numeric |
publication year |
trt | character |
intervention group |
xi | numeric |
number of individuals abstinent |
ni | numeric |
number of individuals in group |
The dataset includes the results from 24 studies on the effectiveness of various counseling types for smoking cessation (i.e., self-help, individual counseling, group counseling, and no contact). The dataset indicates the total number of individuals within each study arm and the number that were abstinent from 6 to 12 months. The majority of the studies compared two interventions types against each other, while 2 studies compared three types against each other simultaneously.
The data can be used for a ‘network meta-analysis’ (also called a ‘mixed treatment comparison’). The code below shows how such an analysis can be conducted using an arm-based and a contrast-based model (see Salanti et al., 2008, for more details).
medicine, psychology, smoking, odds ratios, network meta-analysis
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Hasselblad, V. (1998). Meta-analysis of multitreatment studies. Medical Decision Making, 18(1), 37–43. https://doi.org/10.1177/0272989X9801800110
Gleser, L. J., & Olkin, I. (2009). Stochastically dependent effect sizes. In H. Cooper, L. V. Hedges, & J. C. Valentine (Eds.), The handbook of research synthesis and meta-analysis (2nd ed., pp. 357–376). New York: Russell Sage Foundation.
Law, M., Jackson, D., Turner, R., Rhodes, K., & Viechtbauer, W. (2016). Two new methods to fit models for network meta-analysis with random inconsistency effects. BMC Medical Research Methodology, 16, 87. https://doi.org/10.1186/s12874-016-0184-5
Salanti, G., Higgins, J. P. T., Ades, A. E., & Ioannidis, J. P. A. (2008). Evaluation of networks of randomized trials. Statistical Methods in Medical Research, 17(3), 279–301. https://doi.org/10.1177/0962280207080643
### copy data into 'dat' and examine data dat <- dat.hasselblad1998 dat ## Not run: ### load metafor package library(metafor) ### create network graph ('igraph' package must be installed) library(igraph, warn.conflicts=FALSE) pairs <- data.frame(do.call(rbind, sapply(split(dat$trt, dat$study), function(x) t(combn(x,2)))), stringsAsFactors=FALSE) lvls <- c("no_contact", "self_help", "ind_counseling", "grp_counseling") pairs$X1 <- factor(pairs$X1, levels=lvls) pairs$X2 <- factor(pairs$X2, levels=lvls) tab <- table(pairs[,1], pairs[,2]) tab # adjacency matrix g <- graph_from_adjacency_matrix(tab, mode = "plus", weighted=TRUE, diag=FALSE) vertex_attr(g, "name") <- c("No Contact", "Self-Help", "Individual\nCounseling", "Group\nCounseling") plot(g, edge.curved=FALSE, edge.width=E(g)$weight, layout=layout_on_grid, vertex.size=45, vertex.color="lightgray", vertex.label.color="black", vertex.label.font=2) ### calculate log odds for each study arm dat <- escalc(measure="PLO", xi=xi, ni=ni, add=1/2, to="all", data=dat) dat ### convert trt variable to factor with desired ordering of levels dat$trt <- factor(dat$trt, levels=c("no_contact", "self_help", "ind_counseling", "grp_counseling")) ### add a space before each level (this makes the output a bit more legible) levels(dat$trt) <- paste0(" ", levels(dat$trt)) ### network meta-analysis using an arm-based model with fixed study effects ### by setting rho=1/2, tau^2 reflects the amount of heterogeneity for all treatment comparisons res <- rma.mv(yi, vi, mods = ~ 0 + factor(study) + trt, random = ~ trt | study, rho=1/2, data=dat, btt="trt") res ### all pairwise odds ratios of interventions versus no contact predict(res, newmods=cbind(matrix(0, nrow=3, ncol=24), diag(3)), intercept=FALSE, transf=exp, digits=2) ### all pairwise odds ratios comparing interventions (ic vs sh, gc vs sh, and gc vs ic) predict(res, newmods=cbind(matrix(0, nrow=3, ncol=24), rbind(c(-1,1,0), c(-1,0,1), c(0,-1,1))), intercept=FALSE, transf=exp, digits=2) ### forest plot of ORs of interventions versus no contact forest(c(0,res$beta[25:27]), sei=c(0,res$se[25:27]), psize=1, xlim=c(-3,4), digits=c(2,1), efac=2, slab=c("No Contact", "Self-Help", "Individual Counseling", "Group Counseling"), atransf=exp, at=log(c(.5, 1, 2, 4, 8)), xlab="Odds Ratio for Intervention vs. No Contact", header=c("Intervention", "Odds Ratio [95% CI]"), top=2) ############################################################################ ### restructure dataset to a contrast-based format dat <- to.wide(dat.hasselblad1998, study="study", grp="trt", ref="no_contact", grpvars=6:7) ### calculate log odds ratios for each treatment comparison dat <- escalc(measure="OR", ai=xi.1, n1i=ni.1, ci=xi.2, n2i=ni.2, add=1/2, to="all", data=dat) dat ### calculate the variance-covariance matrix of the log odds ratios for multitreatment studies ### see Gleser & Olkin (2009), equation (19.11), for the covariance equation calc.v <- function(x) { v <- matrix(1/(x$xi.2[1] + 1/2) + 1/(x$ni.2[1] - x$xi.2[1] + 1/2), nrow=nrow(x), ncol=nrow(x)) diag(v) <- x$vi v } V <- bldiag(lapply(split(dat, dat$study), calc.v)) ### add contrast matrix to dataset dat <- contrmat(dat, grp1="trt.1", grp2="trt.2") dat ### network meta-analysis using a contrast-based random-effects model ### by setting rho=1/2, tau^2 reflects the amount of heterogeneity for all treatment comparisons res <- rma.mv(yi, V, mods = ~ 0 + self_help + ind_counseling + grp_counseling, random = ~ comp | study, rho=1/2, data=dat) res ### predicted odds ratios of interventions versus no contact predict(res, newmods=diag(3), transf=exp, digits=2) ### fit random inconsistency effects model (see Law et al., 2016) res <- rma.mv(yi, V, mods = ~ 0 + self_help + ind_counseling + grp_counseling, random = list(~ comp | study, ~ comp | design), rho=1/2, phi=1/2, data=dat) res ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.hasselblad1998 dat ## Not run: ### load metafor package library(metafor) ### create network graph ('igraph' package must be installed) library(igraph, warn.conflicts=FALSE) pairs <- data.frame(do.call(rbind, sapply(split(dat$trt, dat$study), function(x) t(combn(x,2)))), stringsAsFactors=FALSE) lvls <- c("no_contact", "self_help", "ind_counseling", "grp_counseling") pairs$X1 <- factor(pairs$X1, levels=lvls) pairs$X2 <- factor(pairs$X2, levels=lvls) tab <- table(pairs[,1], pairs[,2]) tab # adjacency matrix g <- graph_from_adjacency_matrix(tab, mode = "plus", weighted=TRUE, diag=FALSE) vertex_attr(g, "name") <- c("No Contact", "Self-Help", "Individual\nCounseling", "Group\nCounseling") plot(g, edge.curved=FALSE, edge.width=E(g)$weight, layout=layout_on_grid, vertex.size=45, vertex.color="lightgray", vertex.label.color="black", vertex.label.font=2) ### calculate log odds for each study arm dat <- escalc(measure="PLO", xi=xi, ni=ni, add=1/2, to="all", data=dat) dat ### convert trt variable to factor with desired ordering of levels dat$trt <- factor(dat$trt, levels=c("no_contact", "self_help", "ind_counseling", "grp_counseling")) ### add a space before each level (this makes the output a bit more legible) levels(dat$trt) <- paste0(" ", levels(dat$trt)) ### network meta-analysis using an arm-based model with fixed study effects ### by setting rho=1/2, tau^2 reflects the amount of heterogeneity for all treatment comparisons res <- rma.mv(yi, vi, mods = ~ 0 + factor(study) + trt, random = ~ trt | study, rho=1/2, data=dat, btt="trt") res ### all pairwise odds ratios of interventions versus no contact predict(res, newmods=cbind(matrix(0, nrow=3, ncol=24), diag(3)), intercept=FALSE, transf=exp, digits=2) ### all pairwise odds ratios comparing interventions (ic vs sh, gc vs sh, and gc vs ic) predict(res, newmods=cbind(matrix(0, nrow=3, ncol=24), rbind(c(-1,1,0), c(-1,0,1), c(0,-1,1))), intercept=FALSE, transf=exp, digits=2) ### forest plot of ORs of interventions versus no contact forest(c(0,res$beta[25:27]), sei=c(0,res$se[25:27]), psize=1, xlim=c(-3,4), digits=c(2,1), efac=2, slab=c("No Contact", "Self-Help", "Individual Counseling", "Group Counseling"), atransf=exp, at=log(c(.5, 1, 2, 4, 8)), xlab="Odds Ratio for Intervention vs. No Contact", header=c("Intervention", "Odds Ratio [95% CI]"), top=2) ############################################################################ ### restructure dataset to a contrast-based format dat <- to.wide(dat.hasselblad1998, study="study", grp="trt", ref="no_contact", grpvars=6:7) ### calculate log odds ratios for each treatment comparison dat <- escalc(measure="OR", ai=xi.1, n1i=ni.1, ci=xi.2, n2i=ni.2, add=1/2, to="all", data=dat) dat ### calculate the variance-covariance matrix of the log odds ratios for multitreatment studies ### see Gleser & Olkin (2009), equation (19.11), for the covariance equation calc.v <- function(x) { v <- matrix(1/(x$xi.2[1] + 1/2) + 1/(x$ni.2[1] - x$xi.2[1] + 1/2), nrow=nrow(x), ncol=nrow(x)) diag(v) <- x$vi v } V <- bldiag(lapply(split(dat, dat$study), calc.v)) ### add contrast matrix to dataset dat <- contrmat(dat, grp1="trt.1", grp2="trt.2") dat ### network meta-analysis using a contrast-based random-effects model ### by setting rho=1/2, tau^2 reflects the amount of heterogeneity for all treatment comparisons res <- rma.mv(yi, V, mods = ~ 0 + self_help + ind_counseling + grp_counseling, random = ~ comp | study, rho=1/2, data=dat) res ### predicted odds ratios of interventions versus no contact predict(res, newmods=diag(3), transf=exp, digits=2) ### fit random inconsistency effects model (see Law et al., 2016) res <- rma.mv(yi, V, mods = ~ 0 + self_help + ind_counseling + grp_counseling, random = list(~ comp | study, ~ comp | design), rho=1/2, phi=1/2, data=dat) res ## End(Not run)
Results from 6 studies evaluating mortality from prophylactic use of lidocaine in acute myocardial infarction.
dat.hine1989
dat.hine1989
The data frame contains the following columns:
study | numeric |
study number |
source | character |
source of data |
n1i | numeric |
number of patients in lidocaine group |
n2i | numeric |
number of patients in control group |
ai | numeric |
number of deaths in lidocaine group |
ci | numeric |
number of deaths in control group |
Hine et al. (1989) conducted a meta-analysis of death rates in randomized controlled trials in which prophylactic lidocaine was administered to patients with confirmed or suspected acute myocardial infarction. The dataset describes the mortality at the end of the assigned treatment period for control and intravenous lidocaine treatment groups for six studies. The question of interest is whether there is a detrimental effect of lidocaine. Because the studies were conducted to compare rates of arrhythmias following a heart attack, the studies, taken individually, are too small to detect important differences in mortality rates.
The data in this dataset were obtained from Table I in Normand (1999, p. 322).
medicine, cardiology, risk differences
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Normand, S. T. (1999). Meta-analysis: Formulating, evaluating, combining, and reporting. Statistics in Medicine, 18(3), 321–359. https://doi.org/10.1002/(sici)1097-0258(19990215)18:3<321::aid-sim28>3.0.co;2-p
Hine, L. K., Laird, N., Hewitt, P., & Chalmers, T. C. (1989). Meta-analytic evidence against prophylactic use of lidocaine in acute myocardial infarction. Archives of Internal Medicine, 149(12), 2694–2698. https://doi.org/10.1001/archinte.1989.00390120056011
### copy data into 'dat' and examine data dat <- dat.hine1989 dat ## Not run: ### load metafor package library(metafor) ### calculate risk differences and corresponding sampling variances dat <- escalc(measure="RD", n1i=n1i, n2i=n2i, ai=ai, ci=ci, data=dat) dat ### meta-analysis of risk differences using a random-effects model res <- rma(yi, vi, data=dat) res ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.hine1989 dat ## Not run: ### load metafor package library(metafor) ### calculate risk differences and corresponding sampling variances dat <- escalc(measure="RD", n1i=n1i, n2i=n2i, ai=ai, ci=ci, data=dat) dat ### meta-analysis of risk differences using a random-effects model res <- rma(yi, vi, data=dat) res ## End(Not run)
Results from 46 studies examining the effects of deep-brain stimulation on motor skills of patients with Parkinson's disease.
dat.ishak2007
dat.ishak2007
The data frame contains the following columns:
study | character |
(first) author and year |
y1i | numeric |
observed mean difference at 3 months |
v1i | numeric |
sampling variance of the mean difference at 3 months |
y2i | numeric |
observed mean difference at 6 months |
v2i | numeric |
sampling variance of the mean difference at 6 months |
y3i | numeric |
observed mean difference at 12 months |
v3i | numeric |
sampling variance of the mean difference at 12 months |
y4i | numeric |
observed mean difference at the long-term follow-up |
v4i | numeric |
sampling variance of the mean difference at the long-term follow-up |
mdur | numeric |
mean disease duration (in years) |
mbase | numeric |
mean baseline UPDRS score |
Deep-brain stimulation (DBS), which is delivered through thin surgically implanted wires in specific areas of the brain and controlled by the patient, is meant to provide relief of the debilitating symptoms of Parkinson's disease. The dataset includes the results from 46 studies examining the effects of DBS of the subthalamic nucleus on motor functioning, measured with the Unified Parkinson's Disease Rating Scale (UPDRS). The effect size measure for this meta-analysis was the mean difference of the scores while the stimulator is active and the baseline scores (before implantation of the stimulator). Since lower scores on the UPDRS indicate better functioning, negative numbers indicate improvements in motor skills. Effects were generally measured at 3, 6, and 12 months after implantation of the stimulator, with some studies also including a further long-term follow-up. However, the number of measurements differed between studies - hence the missing data on some of the measurement occasions.
Since the same patients were followed over time within a study, effect size estimates from multiple measurement occasions are likely to be correlated. A multivariate model accounting for the correlation in the effects can be used to meta-analyze these data. A difficulty with this approach is the lack of information about the correlation of the measurements over time in the individual studies. The approach taken by Ishak et al. (2007) was to assume an autoregressive (AR1) structure for the estimates within the individual studies. In addition, the correlation in the true effects was modeled, again using an autoregressive structure.
medicine, raw mean differences, longitudinal models
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Ishak, K. J., Platt, R. W., Joseph, L., Hanley, J. A., & Caro, J. J. (2007). Meta-analysis of longitudinal studies. Clinical Trials, 4(5), 525–539. https://doi.org/10.1177/1740774507083567
### copy data into 'dat' and examine data dat <- dat.ishak2007 head(dat, 5) ## Not run: ### load metafor package library(metafor) ### create long format dataset dat <- reshape(dat, direction="long", idvar="study", v.names=c("yi","vi"), varying=list(c(2,4,6,8), c(3,5,7,9))) dat <- dat[order(study, time),] ### remove missing measurement occasions from dat.long dat <- dat[!is.na(yi),] rownames(dat) <- NULL head(dat, 8) ### construct the full (block diagonal) V matrix with an AR(1) structure ### assuming an autocorrelation of 0.97 as estimated by Ishak et al. (2007) V <- vcalc(vi, cluster=study, time1=time, phi=0.97, data=dat) ### plot data with(dat, interaction.plot(time, study, yi, type="b", pch=19, lty="solid", xaxt="n", legend=FALSE, xlab="Time Point", ylab="Mean Difference", bty="l")) axis(side=1, at=1:4, lab=c("1 (3 months)", "2 (6 months)", "3 (12 months)", "4 (12+ months)")) ### multivariate model with heteroscedastic AR(1) structure for the true effects res <- rma.mv(yi, V, mods = ~ 0 + factor(time), random = ~ time | study, struct = "HAR", data = dat) print(res, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.ishak2007 head(dat, 5) ## Not run: ### load metafor package library(metafor) ### create long format dataset dat <- reshape(dat, direction="long", idvar="study", v.names=c("yi","vi"), varying=list(c(2,4,6,8), c(3,5,7,9))) dat <- dat[order(study, time),] ### remove missing measurement occasions from dat.long dat <- dat[!is.na(yi),] rownames(dat) <- NULL head(dat, 8) ### construct the full (block diagonal) V matrix with an AR(1) structure ### assuming an autocorrelation of 0.97 as estimated by Ishak et al. (2007) V <- vcalc(vi, cluster=study, time1=time, phi=0.97, data=dat) ### plot data with(dat, interaction.plot(time, study, yi, type="b", pch=19, lty="solid", xaxt="n", legend=FALSE, xlab="Time Point", ylab="Mean Difference", bty="l")) axis(side=1, at=1:4, lab=c("1 (3 months)", "2 (6 months)", "3 (12 months)", "4 (12+ months)")) ### multivariate model with heteroscedastic AR(1) structure for the true effects res <- rma.mv(yi, V, mods = ~ 0 + factor(time), random = ~ time | study, struct = "HAR", data = dat) print(res, digits=2) ## End(Not run)
Results from studies examining the effectiveness of coaching on the performance on the Scholastic Aptitude Test (SAT).
dat.kalaian1996
dat.kalaian1996
The data frame contains the following columns:
id | numeric |
row (effect) id |
study | character |
study identifier |
year | numeric |
publication year |
n1i | numeric |
number of participants in the coached group |
n2i | numeric |
number of participants in the uncoached group |
outcome | character |
subtest (verbal or math) |
yi | numeric |
standardized mean difference |
vi | numeric |
corresponding sampling variance |
hrs | numeric |
hours of coaching |
ets | numeric |
study conducted by the Educational Testing Service (ETS) (0 = no, 1 = yes) |
homework | numeric |
assignment of homework outside of the coaching course (0 = no, 1 = yes) |
type | numeric |
study type (1 = randomized study, 2 = matched study, 3 = nonequivalent comparison study) |
The effectiveness of coaching for the Scholastic Aptitude Test (SAT) has been examined in numerous studies. This dataset contains standardized mean differences comparing the performance of a coached versus uncoached group on the verbal and/or math subtest of the SAT. Studies may report a standardized mean difference for the verbal subtest, the math subtest, or both. In the latter case, the two standardized mean differences are not independent (since they were measured in the same group of subjects). The number of hours of coaching (variable hrs
), whether the study was conducted by the Educational Testing Service (variable ets
), whether homework was assigned outside of the coaching course (variable homework
), and the study type (variable type
) may be potential moderators of the treatment effect.
education, standardized mean differences, multivariate models, meta-regression
The dataset was obtained from Table 1 in Kalaian and Raudenbush (1996). However, there appear to be some inconsistencies between the data in the table and those that were actually used for the analyses (see ‘Examples’).
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Kalaian, H. A., & Raudenbush, S. W. (1996). A multivariate mixed linear model for meta-analysis. Psychological Methods, 1(3), 227–235. https://doi.org/10.1037/1082-989X.1.3.227
### copy data into 'dat' and examine data dat <- dat.kalaian1996 head(dat, 12) ## Not run: ### load metafor package library(metafor) ### check ranges range(dat$yi[dat$outcome == "verbal"]) # -0.35 to 0.74 according to page 230 range(dat$yi[dat$outcome == "math"]) # -0.53 to 0.60 according to page 231 ### comparing this with Figure 1 in the paper reveals some discrepancies par(mfrow=c(1,2), mar=c(5,5,1,3.4)) plot(log(dat$hrs[dat$outcome == "verbal"]), dat$yi[dat$outcome == "verbal"], pch=19, col=rgb(0,0,0,.4), xlab="Log(Coaching Hours)", ylab="Effect Size (verbal)", xlim=c(1,6), ylim=c(-0.5,1), xaxs="i", yaxs="i") abline(h=c(-0.5,0,0.5), lty="dotted") abline(v=log(c(5,18)), lty="dotted") plot(log(dat$hrs[dat$outcome == "math"]), dat$yi[dat$outcome == "math"], pch=19, col=rgb(0,0,0,.4), xlab="Log(Coaching Hours)", ylab="Effect Size (math)", xlim=c(1,6), ylim=c(-1.0,1), xaxs="i", yaxs="i") abline(h=c(-0.5,0,0.5), lty="dotted") abline(v=log(c(5,18)), lty="dotted") ### construct variance-covariance matrix assuming rho = 0.66 for effect sizes ### corresponding to the 'verbal' and 'math' outcome types V <- vcalc(vi, cluster=study, type=outcome, data=dat, rho=0.66) ### fit multivariate random-effects model res <- rma.mv(yi, V, mods = ~ 0 + outcome, random = ~ outcome | study, struct="UN", data=dat, digits=3) res ### test whether the effect differs for the math and verbal subtest anova(res, X=c(1,-1)) ### log-transform and mean center the hours of coaching variable dat$loghrs <- log(dat$hrs) - mean(log(dat$hrs), na.rm=TRUE) ### fit multivariate model with log(hrs) as moderator res <- rma.mv(yi, V, mods = ~ 0 + outcome + outcome:loghrs, random = ~ outcome | study, struct="UN", data=dat, digits=3) res ### fit model with tau2 = 0 for outcome verbal (which also constrains rho = 0) res <- rma.mv(yi, V, mods = ~ 0 + outcome + outcome:loghrs, random = ~ outcome | study, struct="UN", tau2=c(NA,0), data=dat, digits=3) res ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.kalaian1996 head(dat, 12) ## Not run: ### load metafor package library(metafor) ### check ranges range(dat$yi[dat$outcome == "verbal"]) # -0.35 to 0.74 according to page 230 range(dat$yi[dat$outcome == "math"]) # -0.53 to 0.60 according to page 231 ### comparing this with Figure 1 in the paper reveals some discrepancies par(mfrow=c(1,2), mar=c(5,5,1,3.4)) plot(log(dat$hrs[dat$outcome == "verbal"]), dat$yi[dat$outcome == "verbal"], pch=19, col=rgb(0,0,0,.4), xlab="Log(Coaching Hours)", ylab="Effect Size (verbal)", xlim=c(1,6), ylim=c(-0.5,1), xaxs="i", yaxs="i") abline(h=c(-0.5,0,0.5), lty="dotted") abline(v=log(c(5,18)), lty="dotted") plot(log(dat$hrs[dat$outcome == "math"]), dat$yi[dat$outcome == "math"], pch=19, col=rgb(0,0,0,.4), xlab="Log(Coaching Hours)", ylab="Effect Size (math)", xlim=c(1,6), ylim=c(-1.0,1), xaxs="i", yaxs="i") abline(h=c(-0.5,0,0.5), lty="dotted") abline(v=log(c(5,18)), lty="dotted") ### construct variance-covariance matrix assuming rho = 0.66 for effect sizes ### corresponding to the 'verbal' and 'math' outcome types V <- vcalc(vi, cluster=study, type=outcome, data=dat, rho=0.66) ### fit multivariate random-effects model res <- rma.mv(yi, V, mods = ~ 0 + outcome, random = ~ outcome | study, struct="UN", data=dat, digits=3) res ### test whether the effect differs for the math and verbal subtest anova(res, X=c(1,-1)) ### log-transform and mean center the hours of coaching variable dat$loghrs <- log(dat$hrs) - mean(log(dat$hrs), na.rm=TRUE) ### fit multivariate model with log(hrs) as moderator res <- rma.mv(yi, V, mods = ~ 0 + outcome + outcome:loghrs, random = ~ outcome | study, struct="UN", data=dat, digits=3) res ### fit model with tau2 = 0 for outcome verbal (which also constrains rho = 0) res <- rma.mv(yi, V, mods = ~ 0 + outcome + outcome:loghrs, random = ~ outcome | study, struct="UN", tau2=c(NA,0), data=dat, digits=3) res ## End(Not run)
Results from diagnostic accuracy studies examining the accuracy of venous ultrasonography for the diagnosis of deep venous thrombosis.
dat.kearon1998
dat.kearon1998
The data frame contains the following columns:
id | numeric |
study id |
author | character |
study author(s) |
year | numeric |
publication year |
patients | character |
patient group (either symptomatic or asymptomatic patients) |
tp | numeric |
number of true positives |
np | numeric |
number of positive patients (cases) |
tn | numeric |
number of true negatives |
nn | numeric |
number of negative patients (non-cases) |
The studies included in the dataset examined the accuracy of venous ultrasonography for the diagnossis of a first deep venous thrombosis in symptomatic and asymptomatic patients. Cases and non-cases were determined based on contrast venography. Venous ultrasonography was then used to make a diagnosis, leading to a given number of true positives and negatives.
A subset of this dataset (using only the studies with asymptomatic patients) was used by Deeks et al. (2005) to illustrate methods for detecting publication bias (or small-study effects) in meta-analyses of diagnostic accuracy studies.
medicine, odds ratios, diagnostic accuracy studies, multivariate models, publication bias
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Kearon, C., Julian, J. A., Math, M., Newman, T. E., & Ginsberg, J. S. (1998). Noninvasive diagnosis of deep venous thrombosis. Annals of Internal Medicine, 128(8), 663–677. https://doi.org/10.7326/0003-4819-128-8-199804150-00011
Deeks, J. J., Macaskill, P., & Irwig, L. (2005). The performance of tests of publication bias and other sample size effects in systematic reviews of diagnostic test accuracy was assessed. Journal of Clinical Epidemiology, 58(9), 882–893. https://doi.org/10.1016/j.jclinepi.2005.01.016
### copy data into 'dat' and examine data dat <- dat.kearon1998 head(dat) ## Not run: ### load metafor package library(metafor) ### calculate diagnostic log odds ratios and corresponding sampling variances dat <- escalc(measure="OR", ai=tp, n1i=np, ci=nn-tn, n2i=nn, data=dat, add=1/2, to="all") head(dat) ### fit random-effects model for the symptomatic patients res <- rma(yi, vi, data=dat, subset=patients=="symptomatic") res ### fit random-effects model for the asymptomatic patients res <- rma(yi, vi, data=dat, subset=patients=="asymptomatic") res ### estimated average diagnostic odds ratio (with 95% CI) predict(res, transf=exp, digits=2) ### regression test for funnel plot asymmetry using SE as predictor reg <- regtest(res, model="lm") reg ### corresponding funnel plot funnel(res, atransf=exp, xlim=c(0,7), at=log(c(1,10,100,1000)), ylim=c(0,1.5), steps=4) ys <- seq(0, 2, length=100) lines(coef(reg$fit)[1] + coef(reg$fit)[2]*ys, ys, lwd=2, lty=3) ### regression test for funnel plot asymmetry using total sample size as predictor reg <- regtest(res, model="lm", predictor="ni") reg ### corresponding funnel plot funnel(res, yaxis="ni", atransf=exp, xlim=c(0,7), at=log(c(1,10,100,1000)), ylim=c(0,300), steps=4) ys <- seq(0, 300, length=100) lines(coef(reg$fit)[1] + coef(reg$fit)[2]*ys, ys, lwd=2, lty=3) ### regression test for funnel plot asymmetry using 1/sqrt(ESS) as predictor (Deeks et al., 2005) dat$invessi <- 1/(4*dat$np) + 1/(4*dat$nn) tmp <- rma(yi, invessi, data=dat, subset=patients=="asymptomatic") reg <- regtest(tmp, model="lm") reg ### corresponding funnel plot funnel(tmp, atransf=exp, xlim=c(0,7), at=log(c(1,10,100,1000)), ylim=c(0,.15), steps=4, refline=coef(res), level=0, ylab="1/root(ess)") ys <- seq(0, .20, length=100) lines(coef(reg$fit)[1] + coef(reg$fit)[2]*ys, ys, lwd=2, lty=3) ### convert data to long format dat <- to.long(measure="OR", ai=tp, n1i=np, ci=tn, n2i=nn, data=dat.kearon1998, subset=patients=="asymptomatic") dat <- dat[9:12] dat$group <- factor(dat$group, levels=c(1,2), labels=c("sensitivity", "specificity")) dat ### calculate logit-transformed sensitivities dat <- escalc(measure="PLO", xi=out1, mi=out2, data=dat, add=1/2, to="all", include=group=="sensitivity") dat ### calculate logit-transformed specificities dat <- escalc(measure="PLO", xi=out1, mi=out2, data=dat, add=1/2, to="all", include=group=="specificity") dat ### bivariate random-effects model for logit sensitivity and specificity res <- rma.mv(yi, vi, mods = ~ 0 + group, random = ~ group | study, struct="UN", data=dat) res ### estimated average sensitivity and specificity based on the model predict(res, newmods = rbind(c(1,0),c(0,1)), transf=transf.ilogit, tau2.levels=c(1,2), digits=2) ### estimated average diagnostic odds ratio based on the model predict(res, newmods = c(1,1), transf=exp, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.kearon1998 head(dat) ## Not run: ### load metafor package library(metafor) ### calculate diagnostic log odds ratios and corresponding sampling variances dat <- escalc(measure="OR", ai=tp, n1i=np, ci=nn-tn, n2i=nn, data=dat, add=1/2, to="all") head(dat) ### fit random-effects model for the symptomatic patients res <- rma(yi, vi, data=dat, subset=patients=="symptomatic") res ### fit random-effects model for the asymptomatic patients res <- rma(yi, vi, data=dat, subset=patients=="asymptomatic") res ### estimated average diagnostic odds ratio (with 95% CI) predict(res, transf=exp, digits=2) ### regression test for funnel plot asymmetry using SE as predictor reg <- regtest(res, model="lm") reg ### corresponding funnel plot funnel(res, atransf=exp, xlim=c(0,7), at=log(c(1,10,100,1000)), ylim=c(0,1.5), steps=4) ys <- seq(0, 2, length=100) lines(coef(reg$fit)[1] + coef(reg$fit)[2]*ys, ys, lwd=2, lty=3) ### regression test for funnel plot asymmetry using total sample size as predictor reg <- regtest(res, model="lm", predictor="ni") reg ### corresponding funnel plot funnel(res, yaxis="ni", atransf=exp, xlim=c(0,7), at=log(c(1,10,100,1000)), ylim=c(0,300), steps=4) ys <- seq(0, 300, length=100) lines(coef(reg$fit)[1] + coef(reg$fit)[2]*ys, ys, lwd=2, lty=3) ### regression test for funnel plot asymmetry using 1/sqrt(ESS) as predictor (Deeks et al., 2005) dat$invessi <- 1/(4*dat$np) + 1/(4*dat$nn) tmp <- rma(yi, invessi, data=dat, subset=patients=="asymptomatic") reg <- regtest(tmp, model="lm") reg ### corresponding funnel plot funnel(tmp, atransf=exp, xlim=c(0,7), at=log(c(1,10,100,1000)), ylim=c(0,.15), steps=4, refline=coef(res), level=0, ylab="1/root(ess)") ys <- seq(0, .20, length=100) lines(coef(reg$fit)[1] + coef(reg$fit)[2]*ys, ys, lwd=2, lty=3) ### convert data to long format dat <- to.long(measure="OR", ai=tp, n1i=np, ci=tn, n2i=nn, data=dat.kearon1998, subset=patients=="asymptomatic") dat <- dat[9:12] dat$group <- factor(dat$group, levels=c(1,2), labels=c("sensitivity", "specificity")) dat ### calculate logit-transformed sensitivities dat <- escalc(measure="PLO", xi=out1, mi=out2, data=dat, add=1/2, to="all", include=group=="sensitivity") dat ### calculate logit-transformed specificities dat <- escalc(measure="PLO", xi=out1, mi=out2, data=dat, add=1/2, to="all", include=group=="specificity") dat ### bivariate random-effects model for logit sensitivity and specificity res <- rma.mv(yi, vi, mods = ~ 0 + group, random = ~ group | study, struct="UN", data=dat) res ### estimated average sensitivity and specificity based on the model predict(res, newmods = rbind(c(1,0),c(0,1)), transf=transf.ilogit, tau2.levels=c(1,2), digits=2) ### estimated average diagnostic odds ratio based on the model predict(res, newmods = c(1,1), transf=exp, digits=2) ## End(Not run)
Results from 31 studies examining differences in planning performance in schizophrenia patients versus healthy controls.
dat.knapp2017
dat.knapp2017
The data frame contains the following columns:
author | character |
study author(s) |
year | numeric |
publication year |
study | numeric |
study id number |
task | character |
type of task |
difficulty | numeric |
task difficulty |
group1 | character |
identifier for patient group within studies |
group2 | character |
identifier for control group within studies |
comp | numeric |
identifier for comparisons within studies |
yi | numeric |
standardized mean difference for planning performance |
vi | numeric |
corresponding sampling variance |
n_sz | numeric |
number of schizophrenic patients |
n_hc | numeric |
number of healthy controls |
yi | numeric |
standardized mean difference for IQ |
vi | numeric |
corresponding sampling variance |
The studies included in this dataset examined differences between schizophrenia patients and healthy controls with respect to their performance on the tower of London test (https://en.wikipedia.org/wiki/Tower_of_London_test) or a similar cognitive tasks measuring planning ability. The outcome measure for this meta-analysis was the standardized mean difference (with positive values indicating better performance in the healthy controls compared to the schizophrenia patients).
The dataset has a more complex structure for several reasons:
Studies 2, 3, 9, and 20 included more than one schizophrenia patient group and the standardized mean differences were computed by comparing these groups against a single healthy control group.
Studies 6, 12, 14, 15, 18, 19, 22, and 26 had the patients and controls complete different tasks of varying complexity (essentially the average number of moves required to complete a task). Study 6 also included two different task types.
Study 24 provides two standardized mean differences, one for men and the other for women.
Study 29 provides three standardized mean differences, corresponding to the three different COMT Val158Met genotypes (val/val, val/met, and met/met).
All 4 issues described above lead to a multilevel structure in the dataset, with multiple standardized mean differences nested within some of the studies. Issues 1. and 2. also lead to correlated sampling errors.
psychology, standardized mean differences, multilevel models, multivariate models, cluster-robust inference, meta-regression
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Knapp, F., Viechtbauer, W., Leonhart, R., Nitschke, K., & Kaller, C. P. (2017). Planning performance in schizophrenia patients: A meta-analysis of the influence of task difficulty and clinical and sociodemographic variables. Psychological Medicine, 47(11), 2002–2016. https://doi.org/10.1017/S0033291717000459
### copy data into 'dat' and examine data dat <- dat.knapp2017 dat[-c(1:2)] ## Not run: ### load metafor package library(metafor) ### fit a standard random-effects model ignoring the issues described above res <- rma(yi, vi, data=dat) res ### fit a multilevel model with random effects for studies and comparisons within studies ### (but this ignored the correlation in the sampling errors) res <- rma.mv(yi, vi, random = ~ 1 | study/comp, data=dat) res ### create variable that indicates the task and difficulty combination as increasing integers dat$task.diff <- unlist(lapply(split(dat, dat$study), function(x) { task.int <- as.integer(factor(x$task)) diff.int <- as.integer(factor(x$difficulty)) diff.int[is.na(diff.int)] <- 1 paste0(task.int, ".", diff.int)})) ### construct correlation matrix for two tasks with four different difficulties where the ### correlation is 0.4 for different difficulties of the same task, 0.7 for the same ### difficulty of different tasks, and 0.28 for different difficulties of different tasks R <- matrix(0.4, nrow=8, ncol=8) R[5:8,1:4] <- R[1:4,5:8] <- 0.28 diag(R[1:4,5:8]) <- 0.7 diag(R[5:8,1:4]) <- 0.7 diag(R) <- 1 rownames(R) <- colnames(R) <- paste0(rep(1:2, each=4), ".", 1:4) R ### construct an approximate V matrix accounting for the use of shared groups and ### for correlations among tasks/difficulties as specified in the R matrix above V <- vcalc(vi, cluster=study, grp1=group1, grp2=group2, w1=n_sz, w2=n_hc, obs=task.diff, rho=R, data=dat) ### correlation matrix for study 3 with four patient groups and a single control group round(cov2cor(V[dat$study == 3, dat$study == 3]), 2) ### correlation matrix for study 6 with two tasks with four difficulties cov2cor(V[dat$study == 6, dat$study == 6]) ### correlation matrix for study 24 with two independent groups cov2cor(V[dat$study == 24, dat$study == 24]) ### correlation matrix for study 29 with three independent groups cov2cor(V[dat$study == 29, dat$study == 29]) ### fit multilevel model as above, but now use this V matrix in the model res <- rma.mv(yi, V, random = ~ 1 | study/comp, data=dat) res predict(res, digits=2) ### use cluster-robust inference methods based on this model robust(res, cluster=study) ### use methods from the clubSandwich package robust(res, cluster=study, clubSandwich=TRUE) ### examine if task difficulty is a potential moderator of the effect res <- rma.mv(yi, V, mods = ~ difficulty, random = ~ 1 | study/comp, data=dat) res sav <- robust(res, cluster=study) sav sav <- robust(res, cluster=study, clubSandwich=TRUE) sav ### draw bubble plot regplot(sav, xlab="Task Difficulty", ylab="Standardized Mean Difference", las=1, digits=1, bty="l") ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.knapp2017 dat[-c(1:2)] ## Not run: ### load metafor package library(metafor) ### fit a standard random-effects model ignoring the issues described above res <- rma(yi, vi, data=dat) res ### fit a multilevel model with random effects for studies and comparisons within studies ### (but this ignored the correlation in the sampling errors) res <- rma.mv(yi, vi, random = ~ 1 | study/comp, data=dat) res ### create variable that indicates the task and difficulty combination as increasing integers dat$task.diff <- unlist(lapply(split(dat, dat$study), function(x) { task.int <- as.integer(factor(x$task)) diff.int <- as.integer(factor(x$difficulty)) diff.int[is.na(diff.int)] <- 1 paste0(task.int, ".", diff.int)})) ### construct correlation matrix for two tasks with four different difficulties where the ### correlation is 0.4 for different difficulties of the same task, 0.7 for the same ### difficulty of different tasks, and 0.28 for different difficulties of different tasks R <- matrix(0.4, nrow=8, ncol=8) R[5:8,1:4] <- R[1:4,5:8] <- 0.28 diag(R[1:4,5:8]) <- 0.7 diag(R[5:8,1:4]) <- 0.7 diag(R) <- 1 rownames(R) <- colnames(R) <- paste0(rep(1:2, each=4), ".", 1:4) R ### construct an approximate V matrix accounting for the use of shared groups and ### for correlations among tasks/difficulties as specified in the R matrix above V <- vcalc(vi, cluster=study, grp1=group1, grp2=group2, w1=n_sz, w2=n_hc, obs=task.diff, rho=R, data=dat) ### correlation matrix for study 3 with four patient groups and a single control group round(cov2cor(V[dat$study == 3, dat$study == 3]), 2) ### correlation matrix for study 6 with two tasks with four difficulties cov2cor(V[dat$study == 6, dat$study == 6]) ### correlation matrix for study 24 with two independent groups cov2cor(V[dat$study == 24, dat$study == 24]) ### correlation matrix for study 29 with three independent groups cov2cor(V[dat$study == 29, dat$study == 29]) ### fit multilevel model as above, but now use this V matrix in the model res <- rma.mv(yi, V, random = ~ 1 | study/comp, data=dat) res predict(res, digits=2) ### use cluster-robust inference methods based on this model robust(res, cluster=study) ### use methods from the clubSandwich package robust(res, cluster=study, clubSandwich=TRUE) ### examine if task difficulty is a potential moderator of the effect res <- rma.mv(yi, V, mods = ~ difficulty, random = ~ 1 | study/comp, data=dat) res sav <- robust(res, cluster=study) sav sav <- robust(res, cluster=study, clubSandwich=TRUE) sav ### draw bubble plot regplot(sav, xlab="Task Difficulty", ylab="Standardized Mean Difference", las=1, digits=1, bty="l") ## End(Not run)
Results from 56 studies on the effects of modified school calendars on student achievement.
dat.konstantopoulos2011
dat.konstantopoulos2011
The data frame contains the following columns:
district | numeric |
district id number |
school | numeric |
school id number (within district) |
study | numeric |
study id number |
yi | numeric |
standardized mean difference |
vi | numeric |
corresponding sampling variance |
year | numeric |
year of the study |
Instead of following the more traditional school calendar with a long summer break (in addition to a short winter and spring break), some schools have switched to a modified school calendar comprising more frequent but shorter intermittent breaks (e.g., 9 weeks of school followed by 3 weeks off), while keeping the total number of days at school approximately the same. The effects of using such a modified calendar on student achievement have been examined in a number of studies and were meta-analyzed by Cooper et al. (2003).
The dataset (taken from Konstantopoulos, 2011) contains the results from 56 studies, each comparing the level of academic achievement in a group of students following a modified school calendar with that of a group of students following a more traditional school calendar. The difference between the two groups was quantified in terms of a standardized mean difference (with positive values indicating a higher mean level of achievement in the group following the modified school calendar).
The studies were conducted at various schools that were clustered within districts. The data therefore have a multilevel structure, with schools nested within districts. A multilevel meta-analysis of these data can be used to estimate and account for the amount of heterogeneity between districts and between schools within districts.
education, standardized mean differences, multilevel models
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Konstantopoulos, S. (2011). Fixed effects and variance components estimation in three-level meta-analysis. Research Synthesis Methods, 2(1), 61–76. https://doi.org/10.1002/jrsm.35
Cooper, H., Valentine, J. C., Charlton, K., & Melson, A. (2003). The effects of modified school calendars on student achievement and on school and community attitudes. Review of Educational Research, 73(1), 1–52. https://doi.org/10.3102/00346543073001001
### copy data into 'dat' and examine data dat <- dat.konstantopoulos2011 dat ## Not run: ### load metafor package library(metafor) ### fit random-effects model res <- rma(yi, vi, data=dat) print(res, digits=3) ### fit random-effects model using rma.mv() res <- rma.mv(yi, vi, random = ~ 1 | study, data=dat) print(res, digits=3) ### fit multilevel random-effects model res.ml <- rma.mv(yi, vi, random = ~ 1 | district/school, data=dat) print(res.ml, digits=3) ### profile variance components profile(res.ml, progbar=FALSE) ### fit multivariate parameterization of the model res.mv <- rma.mv(yi, vi, random = ~ school | district, data=dat) print(res.mv, digits=3) ### tau^2 = sum of the two variance components from the multilevel model round(sum(res.ml$sigma2), digits=3) ### rho = intraclass correlation coefficient based on the multilevel model round(res.ml$sigma2[1] / sum(res.ml$sigma2), digits=3) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.konstantopoulos2011 dat ## Not run: ### load metafor package library(metafor) ### fit random-effects model res <- rma(yi, vi, data=dat) print(res, digits=3) ### fit random-effects model using rma.mv() res <- rma.mv(yi, vi, random = ~ 1 | study, data=dat) print(res, digits=3) ### fit multilevel random-effects model res.ml <- rma.mv(yi, vi, random = ~ 1 | district/school, data=dat) print(res.ml, digits=3) ### profile variance components profile(res.ml, progbar=FALSE) ### fit multivariate parameterization of the model res.mv <- rma.mv(yi, vi, random = ~ school | district, data=dat) print(res.mv, digits=3) ### tau^2 = sum of the two variance components from the multilevel model round(sum(res.ml$sigma2), digits=3) ### rho = intraclass correlation coefficient based on the multilevel model round(res.ml$sigma2[1] / sum(res.ml$sigma2), digits=3) ## End(Not run)
Results from 58 studies on the effectiveness of cognitive-behavioral therapy (CBT) for reducing recidivism in juvenile and adult offenders.
dat.landenberger2005
dat.landenberger2005
The data frame contains the following columns:
study | character |
(first) author and year |
pubtype | character |
publication type (book chapter, journal article, report, or thesis) |
country | character |
country where study was carried out (Canada, New Zealand, UK, or USA) |
design | character |
study design (matched groups, nonequivalent groups, or randomized trial) |
program | character |
purpose of setting up the CBT program (for demonstration, practice, or research purposes) |
setting | character |
treatment setting (community or prison) |
designprob | character |
indication of study design problems (no, favors the control group, or favors the treatment group) |
n.ctrl.rec | numeric |
number of recidivists in the control group |
n.ctrl.non | numeric |
number of non-recidivists in the control group |
n.cbt.rec | numeric |
number of recidivists in the CBT group |
n.cbt.non | numeric |
number of non-recidivists in the CBT group |
interval | numeric |
recidivism interval (in months) |
group | numeric |
study group (adults or juveniles) |
age | numeric |
mean age of the study group |
male | numeric |
percentage of males in the study group |
minority | numeric |
percentage of minorities in the study group |
length | numeric |
treatment length (in weeks) |
sessions | numeric |
number of CBT sessions per week |
hrs_week | numeric |
treatment hours per week |
hrs_total | numeric |
total hours of treatment |
cbt.cogskills | character |
CBT component: cognitive skills (yes, no) |
cbt.cogrestruct | character |
CBT component: cognitive restructuring (yes, no) |
cbt.intpprbsolv | character |
CBT component: interpersonal problem solving (yes, no) |
cbt.socskills | character |
CBT component: social skills (yes, no) |
cbt.angerctrl | character |
CBT component: anger control (yes, no) |
cbt.victimimpact | character |
CBT component: victim impact (yes, no) |
cbt.subabuse | character |
CBT component: substance abuse (yes, no) |
cbt.behavmod | character |
CBT component: behavior modification (yes, no) |
cbt.relapseprev | character |
CBT component: relapse prevention (yes, no) |
cbt.moralrsng | character |
CBT component: moral reasoning (yes, no) |
cbt.roletaking | character |
CBT component: role taking (yes, no) |
cbt.other | character |
CBT component: other (yes, no) |
Landenberger and Lipsey (2005) conducted a meta-analysis of 58 experimental and quasi-experimental studies of the effects of cognitive-behavioral therapy (CBT) on the recidivism rates of adult and juvenile offenders (see also Lipsey et al., 2007). The present dataset includes the results of these studies and a range of potential moderator variables to identify factors associated with variation in treatment effects.
psychology, criminology, odds ratios, meta-regression
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Personal communication.
Landenberger, N. A., & Lipsey, M. W. (2005). The positive effects of cognitive-behavioral programs for offenders: A meta-analysis of factors associated with effective treatment. Journal of Experimental Criminology, 1, 451–476. https://doi.org/10.1007/s11292-005-3541-7
Lipsey, M. W., Landenberger, N. A., & Wilson, S. J. (2007). Effects of cognitive-behavioral programs for criminal offenders. Campbell Systematic Reviews, 3(1), 1–27. https://doi.org/10.4073/csr.2007.6
### copy data into 'dat' and examine data dat <- dat.landenberger2005 head(dat) ## Not run: ### load metafor package library(metafor) ### calculate log odds ratios (for non-recidivism in CBT vs. control groups) and sampling variances dat <- escalc(measure="OR", ai=n.cbt.non, bi=n.cbt.rec, ci=n.ctrl.non, di=n.ctrl.rec, data=dat) ### fit random-effects model res <- rma(yi, vi, data=dat) res ### estimated average OR and corresponding 95% CI/PI predict(res, transf=exp, digits=2) ### examine if number of treatment sessions per week is a potential moderator res <- rma(yi, vi, mods = ~ sessions, data=dat) res ### predicted ORs for 1, 2, 5, or 10 sessions per week predict(res, newmods=c(1,2,5,10), transf=exp, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.landenberger2005 head(dat) ## Not run: ### load metafor package library(metafor) ### calculate log odds ratios (for non-recidivism in CBT vs. control groups) and sampling variances dat <- escalc(measure="OR", ai=n.cbt.non, bi=n.cbt.rec, ci=n.ctrl.non, di=n.ctrl.rec, data=dat) ### fit random-effects model res <- rma(yi, vi, data=dat) res ### estimated average OR and corresponding 95% CI/PI predict(res, transf=exp, digits=2) ### examine if number of treatment sessions per week is a potential moderator res <- rma(yi, vi, mods = ~ sessions, data=dat) res ### predicted ORs for 1, 2, 5, or 10 sessions per week predict(res, newmods=c(1,2,5,10), transf=exp, digits=2) ## End(Not run)
Results from 15 studies on the effectiveness of azithromycin versus amoxycillin or amoxycillin/clavulanic acid (amoxyclav) in the treatment of acute lower respiratory tract infections.
dat.laopaiboon2015
dat.laopaiboon2015
The data frame contains the following columns:
author | character |
author(s) |
year | numeric |
publication year |
ai | numeric |
number of clinical failures in the group treated with azithromycin |
n1i | numeric |
number of patients in the group treated with azithromycin |
ci | numeric |
number of clinical failures in the group treated with amoxycillin or amoxyclav |
n2i | numeric |
number of patients in the group treated with amoxycillin or amoxyclav |
age | character |
whether the trial included adults or children |
diag.ab | numeric |
trial included patients with a diagnosis of acute bacterial bronchitis |
diag.cb | numeric |
trial included patients with a diagnosis of chronic bronchitis with acute exacerbation |
diag.pn | numeric |
trial included patients with a diagnosis of pneumonia |
ctrl | character |
antibiotic in control group (amoxycillin or amoxyclav) |
Azithromycin is an antibiotic useful for the treatment of a number of bacterial infections. Laopaiboon et al. (2015) conducted a meta-analysis of trials comparing the effectiveness of azithromycin versus amoxycillin or amoxycillin/clavulanic acid (amoxyclav) in the treatment of acute lower respiratory tract infections, including acute bacterial bronchitis, acute exacerbations of chronic bronchitis, and pneumonia. The results from 15 trials are included in this dataset.
medicine, risk ratios
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Laopaiboon, M., Panpanich, R., & Swa Mya, K. (2015). Azithromycin for acute lower respiratory tract infections. Cochrane Database of Systematic Reviews, 3, CD001954. https://doi.org/10.1002/14651858.CD001954.pub4
### copy data into 'dat' and examine data dat <- dat.laopaiboon2015 dat ## Not run: ### load metafor package library(metafor) ### analysis using the Mantel-Haenszel method rma.mh(measure="RR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, digits=3) ### calculate log risk ratios and corresponding sampling variances dat <- escalc(measure="RR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat) ### random-effects model res <- rma(yi, vi, data=dat) res ### average risk ratio with 95% CI predict(res, transf=exp) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.laopaiboon2015 dat ## Not run: ### load metafor package library(metafor) ### analysis using the Mantel-Haenszel method rma.mh(measure="RR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, digits=3) ### calculate log risk ratios and corresponding sampling variances dat <- escalc(measure="RR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat) ### random-effects model res <- rma(yi, vi, data=dat) res ### average risk ratio with 95% CI predict(res, transf=exp) ## End(Not run)
Results from 33 trials comparing intravenous streptokinase versus placebo or no therapy in patients who had been hospitalized for acute myocardial infarction.
dat.lau1992
dat.lau1992
The data frame contains the following columns:
trial | character |
trial name |
year | numeric |
publication year |
ai | numeric |
number of deaths in the streptokinase group |
n1i | numeric |
number of patients in the streptokinase group |
ci | numeric |
number of deaths in the control group |
n2i | numeric |
number of patients in the control group |
In the paper by Lau et al. (1992), the data are used to illustrate the idea of a cumulative meta-analysis, where the results are updated as each trial is added to the dataset. See ‘Examples’ for code that replicates the results and shows corresponding forest plots.
medicine, cardiology, odds ratios, cumulative meta-analysis
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Lau, J., Antman, E. M., Jimenez-Silva, J., Kupelnick, B., Mosteller, F., & Chalmers, T. C. (1992). Cumulative meta-analysis of therapeutic trials for myocardial infarction. New England Journal of Medicine, 327(4), 248–254. https://doi.org/10.1056/NEJM199207233270406
### copy data into 'dat' and examine data dat <- dat.lau1992 dat ## Not run: ### load metafor package library(metafor) ### meta-analysis of log odds ratios using the MH method res <- rma.mh(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, slab=trial) print(res, digits=2) ### forest plot forest(res, xlim=c(-11,9), atransf=exp, at=log(c(0.01, 0.1, 1, 10, 100)), header=TRUE, top=2, ilab=dat$year, ilab.xpos=-7) text(-7, 35, "Year", font=2) ### cumulative meta-analysis sav <- cumul(res) ### forest plot of the cumulative results forest(sav, xlim=c(-5,4), atransf=exp, at=log(c(0.1, 0.5, 1, 2, 10)), header=TRUE, top=2, ilab=dat$year, ilab.xpos=-3) text(-3, 35, "Year", font=2) id <- c(4, 8, 15, 33) # rows for which the z/p-values should be shown (as in Lau et al., 1992) text(1.1, (res$k:1)[id], paste0("z = ", fmtx(sav$zval[id], digits=2), fmtp(sav$pval[id], pname=", p", equal=TRUE, sep=TRUE, add0=TRUE))) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.lau1992 dat ## Not run: ### load metafor package library(metafor) ### meta-analysis of log odds ratios using the MH method res <- rma.mh(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, slab=trial) print(res, digits=2) ### forest plot forest(res, xlim=c(-11,9), atransf=exp, at=log(c(0.01, 0.1, 1, 10, 100)), header=TRUE, top=2, ilab=dat$year, ilab.xpos=-7) text(-7, 35, "Year", font=2) ### cumulative meta-analysis sav <- cumul(res) ### forest plot of the cumulative results forest(sav, xlim=c(-5,4), atransf=exp, at=log(c(0.1, 0.5, 1, 2, 10)), header=TRUE, top=2, ilab=dat$year, ilab.xpos=-3) text(-3, 35, "Year", font=2) id <- c(4, 8, 15, 33) # rows for which the z/p-values should be shown (as in Lau et al., 1992) text(1.1, (res$k:1)[id], paste0("z = ", fmtx(sav$zval[id], digits=2), fmtp(sav$pval[id], pname=", p", equal=TRUE, sep=TRUE, add0=TRUE))) ## End(Not run)
Results from studies examining the effectiveness of wrist acupuncture point P6 stimulation for preventing postoperative nausea.
dat.lee2004
dat.lee2004
The data frame contains the following columns:
id | numeric |
trial id number |
study | character |
first author |
year | numeric |
study year |
ai | numeric |
number of patients experiencing nausea in the treatment group |
n1i | numeric |
total number of patients in treatment group |
ci | numeric |
number of patients experiencing nausea in the sham group |
n2i | numeric |
total number of patients in the sham group |
Postoperative nausea and vomiting are common complications following surgery and anaesthesia. As an alternative to drug therapy, acupuncture has been studied as a potential treatment in several trials. The dataset contains the results from 16 clinical trials examining the effectiveness of wrist acupuncture point P6 stimulation for preventing postoperative nausea.
medicine, alternative medicine, risk ratios
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Lee, A., & Done, M. L. (2004). Stimulation of the wrist acupuncture point P6 for preventing postoperative nausea and vomiting. Cochrane Database of Systematic Reviews, 3, CD003281. https://doi.org/10.1002/14651858.CD003281.pub2
### copy data into 'dat' and examine data dat <- dat.lee2004 dat ## Not run: ### load metafor package library(metafor) ### meta-analysis based on log risk ratios res <- rma(measure="RR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat) res predict(res, transf=exp, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.lee2004 dat ## Not run: ### load metafor package library(metafor) ### meta-analysis based on log risk ratios res <- rma(measure="RR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat) res predict(res, transf=exp, digits=2) ## End(Not run)
Results from studies in which participants rated the attractiveness of photos that featured red or a control color. See OSF project at https://osf.io/xy47p/
.
dat.lehmann2018
dat.lehmann2018
The data frame contains the following columns:
Short_Title | character |
Shortened citation formatted as: Author name(s), year of publication - Experiment number. All cells in the column are unique for use as labels in the meta-analysis. |
Full_Citation | character |
Full citation in APA format. |
Short_Citation | character |
Shortened citation of different format, exactly as it would appear in an in-text citation. |
Year | numeric |
Year study published (whether in journal or published online). |
Study | character |
Experiment number. If only one experiment presented in a paper, then ‘Exp 1’, otherwise numbered according to numbering within paper. |
Peer_Reviewed | character |
Whether the experiment was published in a peer-reviewed journal or not. ‘Yes’ = peer-reviewed journal, ‘No’ can mean in press, online publication, or other. |
Source_Type | character |
Location where experiment is available, including journal articles, conference proceedings, online-only, and other options. More specific than whether peer-reviewed or not. |
Preregistered | character |
Whether experiment was pre-registered or not. |
Moderator_Group | character |
In some studies, a moderator was intentionally investigated that was meant to reduce the red-romance effect. Data for studies where the red-romance effect is expected to be moderated are marked ‘Yes’ in this column. All others are blank. |
Gender | character |
Gender of rater (male or female). In all cases, gender of stimuli will be opposite. |
Color_Contrast | character |
The color used as the contrast against red. In some cases, not every contrast color was listed. We chose to examine only contrasts that were present in the original studies, when possible. This column contains only the contrasts we examined in this meta-analysis. |
Color_Form | character |
Location of color in photo. Background = background or border color manipulated; Face = facial redness manipulated; Shirt, Dress, Item = color of specified object manipulated; Dot = a dot of color on shirt manipulated. |
Photo_Type | character |
Amount of body visible in photo. Head Shot = head only; Bust = head, shoulders, sometimes torso; Full Body = entire body visible. |
DV_Type | character |
Scale used for DV. ‘Perceived attractiveness’ = the perceived attractiveness scale used in the original studies; alternate scales are differentiated. |
DV_Items | numeric |
Number of items in DV scale. |
DV_Scale | character |
Full length of DV scale, if clear. |
DV_ScaleBottom | numeric |
Lower anchor of DV scale. |
DV_ScaleTop | numeric |
Upper anchor of DV scale. |
Location | character |
Country where study took place, if clear. ‘Worldwide’ in some cases of online participation without IP filtering of participants. |
Continent | character |
Continent where study took place, for the sake of creating larger categories for analysis. |
Participants | character |
Basic notes about participants. Students = high school, undergraduate, or graduate students; Online = participants were gathered online; Adult = no other common identifying factor given. |
Participant_Notes | character |
A finer grained description of participant characteristics. |
Design | character |
Whether study was a between- or within-subjects design. |
Eth_Majority | character |
Basic notes about participant ethnicity for ease of analysis. This represents the ethnic majority within the sample. |
Eth_Majority_Detail | character |
A finer grained description of participant characteristics, including in some cases participant counts when the ethnic majority was close to another category. |
Eth_Stim | character |
Ethnicity of the people pictured in the stimulus materials. |
Eth_Match | character |
Whether the ethnic majority of the participant pool matched the ethnicity of stimulus photos. |
Red_Age | numeric |
Mean age of participants in red group. If not given for specific group, then mean age overall. |
Control_Age | numeric |
Mean age of participants in control group. If not given for specific group, then mean age overall. |
Color_Red | character |
Specific values of red color, if given. |
Color_Control | character |
Specific values of control color, if given. |
Red_Original | character |
Whether the red color used in the study is within 5 units of the LCh values for red used in the original study. |
Color_Match | character |
Whether the control color used in the study is within 5 units of the red color on the L and C parameters. In cases where the control color used was white, it was not possible for the L and C parameters to match. |
Presentation_Control | character |
Whether the color of the stimulus viewed by each participant was consistent, as in participants viewing everything on paper or the same computer, versus uncontrolled presentation of the stimulus, as in viewing stimulus on different computers. |
Stimuli_Presentation | character |
Method for presenting stimuli. ‘Paper’ = stimuli printed on paper, shown in-person; ‘Screen’ = stimuli shown on-screen, not carefully controlled; ‘Screen Control’ = stimuli shown on-screen, but screen carefully color-matched. |
Red_N | numeric |
Number of participants in red group. |
Red_M | numeric |
Mean rating of DV in red group. |
Red_SD | numeric |
Standard deviation of DV in red group. |
Control_N | numeric |
Number of participants in control group. |
Control_M | numeric |
Mean rating of DV in control group. |
Control_SD | numeric |
Standard deviation of DV in control group. |
SD_diff | numeric |
Calculated for within-subjects studies, standard deviation of difference scores. |
RM_r | numeric |
Calculated for within-subjects studies, correlation between participant ratings of red and control attractiveness. |
Control_Attractiveness | numeric |
Attractiveness of stimuli in control condition, calculated as (Control_M - DV_ScaleBottom) / DV_ScaleTop , in order to compare attractiveness ratings across different scales. |
Notes | character |
Any additional notes on the study. |
Total.SampleSize | numeric |
Total unique participants in the study. |
pooled | numeric |
Pooled standard deviation for within-subjects studies. |
yi | numeric |
Standardized mean difference. |
vi | numeric |
Corresponding sampling variance. |
This is data from a meta-analysis of studies that test the red-romance hypothesis, which is that the color red enhances heterosexual attraction in romantic contexts. Analyzing male participants only, the meta-analysis should show a small, statistically significant effect (d = 0.26 [0.12, 0.40], p = .0004, N = 2,961). Analyzing female participants only should show a very small effect (d = 0.13 [0.01, 0.25], p = .03, N = 2,739). The analyses in the published meta-analysis found clear evidence of upward bias in the estimate for female participants and equivocal evidence for male participants. Moderator analyses suggest effect sizes may have declined over time (both genders), may be largest when an original shade of red is used (men only), and may be smaller in pre-registered studies (women only).
psychology, attraction, standardized mean differences
Robert Calin-Jageman, [email protected], https://calin-jageman.net
Lehmann, G. K., Elliot, A. J., & Calin-Jageman, R. J. (2018). Meta-analysis of the effect of red on perceived attractiveness. Evolutionary Psychology, 16(4). https://doi.org/10.1177/1474704918802412
https://osf.io/xy47p/
### copy data into 'dat' and examine data dat <- dat.lehmann2018 head(dat) ## Not run: ### load metafor package library(metafor) ### meta-analyses for male and female participants red_romance_malep <- dat[dat$Gender == "Males", ] red_romance_femalep <- dat[dat$Gender == "Females", ] res_malep <- rma(yi, vi, data=red_romance_malep, test="knha") res_malep res_femalep <- rma(yi, vi, data=red_romance_femalep, test="knha") res_femalep ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.lehmann2018 head(dat) ## Not run: ### load metafor package library(metafor) ### meta-analyses for male and female participants red_romance_malep <- dat[dat$Gender == "Males", ] red_romance_femalep <- dat[dat$Gender == "Females", ] res_malep <- rma(yi, vi, data=red_romance_malep, test="knha") res_malep res_femalep <- rma(yi, vi, data=red_romance_femalep, test="knha") res_femalep ## End(Not run)
Results from 22 trials examining the effectiveness of intravenous magnesium in the prevention of death following acute myocardial infarction.
dat.li2007
dat.li2007
The data frame contains the following columns:
id | numeric |
trial id number |
study | character |
first author or trial name |
year | numeric |
publication year |
ai | numeric |
number of deaths in the magnesium group |
n1i | numeric |
number of patients in the magnesium group |
ci | numeric |
number of deaths in the control group |
n2i | numeric |
number of patients in the control group |
The dataset includes the results from 22 randomized clinical trials that examined the effectiveness of intravenous magnesium in the prevention of death following acute myocardial infarction. It is similar to the dataset dat.egger2001
, with some slight differences in the included trials and data used.
medicine, cardiology, odds ratios, publication bias
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Li, J., Zhang, Q., Zhang, M., & Egger, M. (2007). Intravenous magnesium for acute myocardial infarction. Cochrane Database of Systematic Reviews, 2, CD002755. https://doi.org/10.1002/14651858.CD002755.pub2
### copy data into 'dat' and examine data dat <- dat.li2007 dat ## Not run: ### load metafor package library(metafor) ### meta-analysis of all trials except ISIS-4 res <- rma(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, method="EE", subset=-14) print(res, digits=2) predict(res, transf=exp, digits=2) ### meta-analysis of all trials including ISIS-4 res <- rma(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, method="EE") print(res, digits=2) predict(res, transf=exp, digits=2) ### contour-enhanced funnel plot centered at 0 funnel(res, refline=0, level=c(90, 95, 99), shade=c("white", "gray", "darkgray")) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.li2007 dat ## Not run: ### load metafor package library(metafor) ### meta-analysis of all trials except ISIS-4 res <- rma(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, method="EE", subset=-14) print(res, digits=2) predict(res, transf=exp, digits=2) ### meta-analysis of all trials including ISIS-4 res <- rma(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, method="EE") print(res, digits=2) predict(res, transf=exp, digits=2) ### contour-enhanced funnel plot centered at 0 funnel(res, refline=0, level=c(90, 95, 99), shade=c("white", "gray", "darkgray")) ## End(Not run)
Results from studies examining the association between maternal size, offspring size, and number of offsprings.
dat.lim2014
dat.lim2014
The object is a list containing data frames m_o_size
, m_o_fecundity
, o_o_unadj
, and o_o_adj
that contain the following columns and the corresponding phylogenetic trees called m_o_size_tree
, m_o_fecundity_tree
, o_o_unadj_tree
, and o_o_adj_tree
:
article | numeric |
article id |
author | character |
study author(s) |
year | numeric |
publication year |
species | character |
species |
amniotes | character |
whether the species was amniotic |
environment | character |
whether the species were wild or captive |
reprounit | character |
whether the data were based on lifetime reproductive output or a single reproductive event (only in m_o_size and m_o_fecundity ) |
ri | numeric |
correlation coefficient |
ni | numeric |
sample size |
The object dat.lim2014
includes 4 datasets:
m_o_size |
on the correlation between maternal size and offspring size |
m_o_fecundity |
on the correlation between maternal size and number of offsprings |
o_o_unadj |
on the correlation between offspring size and number of offsprings |
o_o_adj |
on the correlation between offspring size and number of offsprings adjusted for maternal size |
Objects m_o_size_tree
, m_o_fecundity_tree
, o_o_unadj_tree
, and o_o_adj_tree
are the corresponding phylogenetic trees for the species included in each of these datasets.
ecology, evolution, correlation coefficients, multilevel models, phylogeny
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Lim, J. N., Senior, A. M., & Nakagawa, S. (2014). Heterogeneity in individual quality and reproductive trade-offs within species. Evolution, 68(8), 2306–2318. https://doi.org/10.1111/evo.12446
Cinar, O., Nakagawa, S., & Viechtbauer, W. (in press). Phylogenetic multilevel meta-analysis: A simulation study on the importance of modelling the phylogeny. Methods in Ecology and Evolution. https://doi.org/10.1111/2041-210X.13760
Hadfield, J. D., & Nakagawa, S. (2010). General quantitative genetic methods for comparative biology: Phylogenies, taxonomies and multi-trait models for continuous and categorical characters. Journal of Evolutionary Biology, 23(3), 494–508. https://doi.org/10.1111/j.1420-9101.2009.01915.x
Nakagawa, S., & Santos, E. S. A. (2012). Methodological issues and advances in biological meta-analysis. Evolutionary Ecology, 26(5), 1253–1274. https://doi.org/10.1007/s10682-012-9555-5
### copy data into 'dat' and examine data dat <- dat.lim2014$o_o_unadj dat[1:14, -c(2:3)] ## Not run: ### load metafor package library(metafor) ### load ape package library(ape, warn.conflicts=FALSE) ### calculate r-to-z transformed correlations and corresponding sampling variances dat <- escalc(measure="ZCOR", ri=ri, ni=ni, data=dat) ### copy tree to 'tree' tree <- dat.lim2014$o_o_unadj_tree ### compute branch lengths tree <- compute.brlen(tree) ### compute phylogenetic correlation matrix A <- vcv(tree, corr=TRUE) ### make copy of the species variable dat$species.phy <- dat$species ### create effect size id variable dat$esid <- 1:nrow(dat) ### fit multilevel phylogenetic meta-analytic model res <- rma.mv(yi, vi, random = list(~ 1 | article, ~ 1 | esid, ~ 1 | species, ~ 1 | species.phy), R=list(species.phy=A), data=dat) res ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.lim2014$o_o_unadj dat[1:14, -c(2:3)] ## Not run: ### load metafor package library(metafor) ### load ape package library(ape, warn.conflicts=FALSE) ### calculate r-to-z transformed correlations and corresponding sampling variances dat <- escalc(measure="ZCOR", ri=ri, ni=ni, data=dat) ### copy tree to 'tree' tree <- dat.lim2014$o_o_unadj_tree ### compute branch lengths tree <- compute.brlen(tree) ### compute phylogenetic correlation matrix A <- vcv(tree, corr=TRUE) ### make copy of the species variable dat$species.phy <- dat$species ### create effect size id variable dat$esid <- 1:nrow(dat) ### fit multilevel phylogenetic meta-analytic model res <- rma.mv(yi, vi, random = list(~ 1 | article, ~ 1 | esid, ~ 1 | species, ~ 1 | species.phy), R=list(species.phy=A), data=dat) res ## End(Not run)
Results from 26 studies on the effectiveness of Hypericum perforatum extracts (St. John's wort) for treating depression.
dat.linde2005
dat.linde2005
The data frame contains the following columns:
id | numeric |
study number |
study | character |
study author(s) |
year | numeric |
publication year |
country | character |
study location |
ni | numeric |
total sample size |
major | numeric |
sample restricted to patients who met criteria for major depression |
baseline | numeric |
HRSD baseline score |
version | numeric |
HRSD version (17 or 21 items) |
duration | numeric |
study duration (in weeks) |
prep | character |
Hypericum extract preparation |
dosage | numeric |
dosage (in mg) |
response | numeric |
definition of response (see ‘Details’) |
ai | numeric |
number of responses in treatment group |
n1i | numeric |
number of patients in treatment group |
ci | numeric |
number of responses in placebo group |
n2i | numeric |
number of patients in placebo group |
group | numeric |
stratification variable used by the authors (see ‘Details’) |
The dataset includes the results from 26 double-blind placebo-controlled trials on the effectiveness of Hypericum perforatum extracts (St. John's wort) for treating depression (note that 2 studies did not provide sufficient response information).
Data were extracted from Table 1 and Figure 3 from Linde et al. (2005). For study duration, the assessment week (instead of the total study duration) was coded for Philipp et al. (1999) and Montgomery et al. (2000). For dosage, the midpoint was coded when a range of values was given.
The definition of what constitutes a response
differed across studies and is coded as follows:
HRSD score reduction of at least 50% or HRSD score after therapy <10,
HRSD reduction of at least 50%,
based on HRSD scale but exact definition not reported,
global patient assessment of efficacy,
at least ‘much improved’ on the Clinical Global Impression sub-scale for global improvement.
The group
variable corresponds to the variable used by Linde et al. (2005) to stratify their analyses and is coded as follows:
smaller trials restricted to major depression,
larger trials restricted to major depression,
smaller trials not restricted to major depression,
larger trials not restricted to major depression.
medicine, psychiatry, risk ratios
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Linde, K., Berner, M., Egger, M., & Mulrow, C. (2005). St John's wort for depression: Meta-analysis of randomised controlled trials. British Journal of Psychiatry, 186(2), 99–107. https://doi.org/10.1192/bjp.186.2.99
Viechtbauer, W. (2007). Accounting for heterogeneity via random-effects models and moderator analyses in meta-analysis. Zeitschrift für Psychologie / Journal of Psychology, 215(2), 104–121. https://doi.org/10.1027/0044-3409.215.2.104
### copy data into 'dat' and examine data dat <- dat.linde2005 head(dat) ## Not run: ### load metafor package library(metafor) ### remove studies with no response information and study with no responses in either group dat <- dat[-c(5,6,26),] ### calculate log risk ratios and corresponding sampling variances dat <- escalc(measure="RR", ai=ai, ci=ci, n1i=n1i, n2i=n2i, data=dat) head(dat) ### meta-analysis of the log risk ratios using a random-effects model res <- rma(yi, vi, data=dat, method="DL") res ### mixed-effects meta-regression model with stratification variable res <- rma(yi, vi, mods = ~ 0 + factor(group), data=dat, method="DL") res ### predicted average risk ratio for each level of the stratification variable predict(res, newmods=diag(4), transf=exp, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.linde2005 head(dat) ## Not run: ### load metafor package library(metafor) ### remove studies with no response information and study with no responses in either group dat <- dat[-c(5,6,26),] ### calculate log risk ratios and corresponding sampling variances dat <- escalc(measure="RR", ai=ai, ci=ci, n1i=n1i, n2i=n2i, data=dat) head(dat) ### meta-analysis of the log risk ratios using a random-effects model res <- rma(yi, vi, data=dat, method="DL") res ### mixed-effects meta-regression model with stratification variable res <- rma(yi, vi, mods = ~ 0 + factor(group), data=dat, method="DL") res ### predicted average risk ratio for each level of the stratification variable predict(res, newmods=diag(4), transf=exp, digits=2) ## End(Not run)
Results from 66 trials examining eight classes of antidepressants and placebo for the primary care setting.
dat.linde2015
dat.linde2015
The data frame contains the following columns:
id | integer |
study ID |
author | character |
first author |
year | integer |
year of publication |
treatment1 | character |
treatment 1 |
treatment2 | character |
treatment 2 |
treatment3 | character |
treatment 3 |
n1 | integer |
number of patients (arm 1) |
resp1 | integer |
number of early responder (arm 1) |
remi1 | integer |
number of early remissions (arm 1) |
loss1 | integer |
number of patients loss to follow-up (arm 1) |
loss.ae1 | integer |
number of patients loss to follow-up due to adverse events (arm 1) |
ae1 | integer |
number of patients with adverse events (arm 1) |
n2 | integer |
number of patients (arm 2) |
resp2 | integer |
number of early responder (arm 2) |
remi2 | integer |
number of early remissions (arm 2) |
loss2 | integer |
number of patients loss to follow-up (arm 2) |
loss.ae2 | integer |
number of patients loss to follow-up due to adverse events (arm 2) |
ae2 | integer |
number of patients with adverse events (arm 2) |
n3 | integer |
number of patients (arm 3) |
resp3 | integer |
number of early responder (arm 3) |
remi3 | integer |
number of early remissions (arm 3) |
loss3 | integer |
number of patients loss to follow-up (arm 3) |
loss.ae3 | integer |
number of patients loss to follow-up due to adverse events (arm 3) |
ae3 | integer |
number of patients with adverse events (arm 3) |
This dataset comes from a systematic review of 8 pharmacological treatments of depression and placebo in primary care with 66 studies (8 of which were 3-arm studies) including 14,785 patients.
The primary outcome is early response, defined as at least a 50% score reduction on a depression scale after completion of treatment. Secondary outcomes (also measured as dichotomous) were early remission (defined as having a symptom score below a fixed threshold after completion of treatment), lost to follow-up, lost to follow-up due to adverse events, and any adverse event. The odds ratio was used as effect measure.
This dataset was used as an example in Rücker and Schwarzer (2017) who introduced methods to resolve conflicting rankings of outcomes in network meta-analysis.
medicine, psychiatry, odds ratios, network meta-analysis
Guido Schwarzer, [email protected], https://github.com/guido-s/
Linde, K., Kriston, L., Rücker, G., Jamil, S., Schumann, I., Meissner, K., Sigterman, K., & Schneider, A. (2015). Efficacy and acceptability of pharmacological treatments for depressive disorders in primary care: Systematic review and network meta-analysis. Annals of Family Medicine, 13(1), 69–79. https://doi.org/10.1370/afm.1687
Rücker, G., & Schwarzer, G. (2017). Resolve conflicting rankings of outcomes in network meta-analysis: Partial ordering of treatments. Research Synthesis Methods, 8(4), 526–536. https://doi.org/10.1002/jrsm.1270
pairwise
, metabin
, netmeta
, netrank
### Show results from first three studies (including three-arm study ### Lecrubier 1997) head(dat.linde2015, 3) ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print odds ratios and confidence limits with two digits oldset <- settings.meta(digits = 2) ### Change appearance of confidence intervals cilayout("(", "-") ### Define order of treatments in printouts trts <- c("TCA", "SSRI", "SNRI", "NRI", "Low-dose SARI", "NaSSa", "rMAO-A", "Hypericum", "Placebo") ### Transform data from wide arm-based format to contrast-based format ### (outcome: early response). Argument 'sm' has to be used for odds ### ratio as summary measure; by default the risk ratio is used in the ### metabin function called internally. pw1 <- pairwise(list(treatment1, treatment2, treatment3), event = list(resp1, resp2, resp3), n = list(n1, n2, n3), studlab = id, data = dat.linde2015, sm = "OR") ### Conduct random effects network meta-analysis for primary outcome ### (early response); small number of early responses is bad (argument ### small.values) net1 <- netmeta(pw1, fixed = FALSE, reference = "Placebo", seq = trts, small.values = "bad") net1 ### Random effects NMA for early remission pw2 <- pairwise(treat = list(treatment1, treatment2, treatment3), event = list(remi1, remi2, remi3), n = list(n1, n2, n3), studlab = id, data = dat.linde2015, sm = "OR") net2 <- netmeta(pw2, fixed = FALSE, seq = trts, ref = "Placebo", small.values = "bad") net2 ### Ranking of treatments nr1 <- netrank(net1) nr2 <- netrank(net2) nr1 nr2 ### Partial order of treatment rankings (two outcomes) outcomes <- c("Early response", "Early remission") po12 <- netposet(nr1, nr2, outcomes = outcomes) plot(po12) ### Use previous settings settings.meta(oldset) ## End(Not run)
### Show results from first three studies (including three-arm study ### Lecrubier 1997) head(dat.linde2015, 3) ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print odds ratios and confidence limits with two digits oldset <- settings.meta(digits = 2) ### Change appearance of confidence intervals cilayout("(", "-") ### Define order of treatments in printouts trts <- c("TCA", "SSRI", "SNRI", "NRI", "Low-dose SARI", "NaSSa", "rMAO-A", "Hypericum", "Placebo") ### Transform data from wide arm-based format to contrast-based format ### (outcome: early response). Argument 'sm' has to be used for odds ### ratio as summary measure; by default the risk ratio is used in the ### metabin function called internally. pw1 <- pairwise(list(treatment1, treatment2, treatment3), event = list(resp1, resp2, resp3), n = list(n1, n2, n3), studlab = id, data = dat.linde2015, sm = "OR") ### Conduct random effects network meta-analysis for primary outcome ### (early response); small number of early responses is bad (argument ### small.values) net1 <- netmeta(pw1, fixed = FALSE, reference = "Placebo", seq = trts, small.values = "bad") net1 ### Random effects NMA for early remission pw2 <- pairwise(treat = list(treatment1, treatment2, treatment3), event = list(remi1, remi2, remi3), n = list(n1, n2, n3), studlab = id, data = dat.linde2015, sm = "OR") net2 <- netmeta(pw2, fixed = FALSE, seq = trts, ref = "Placebo", small.values = "bad") net2 ### Ranking of treatments nr1 <- netrank(net1) nr2 <- netrank(net2) nr1 nr2 ### Partial order of treatment rankings (two outcomes) outcomes <- c("Early response", "Early remission") po12 <- netposet(nr1, nr2, outcomes = outcomes) plot(po12) ### Use previous settings settings.meta(oldset) ## End(Not run)
Results from 93 trials examining 22 interventions (including placebo and usual care) for the primary care of depression.
dat.linde2016
dat.linde2016
The data frame contains the following columns:
id | integer |
study ID |
lnOR | numeric |
response after treatment (log odds ratio) |
selnOR | numeric |
standard error of log odds ratio |
treat1 | character |
first treatment |
treat2 | character |
second treatment |
This dataset comes from a network meta-analysis of 22 treatments of depression in primary care (Linde et al., 2016), based on 93 trials (79 two-arm trials, 13 three-arm trials, and one four-arm trial). The primary outcome was response after treatment (yes/no), defined as a reduction from baseline by at least 50% on a depression scale. The dataset contains log odds ratios with standard errors for all pairwise comparisons.
The interventions comprised both medical and psychological treatments, also in combination, including placebo and usual care (UC) (Linde et al., 2016). Pharmacological interventions were tricyclic antidepressants (TCA), selective serotonin reuptake inhibitors (SSRI), serotonin-noradrenaline reuptake inhibitors (SNRI), noradrenaline reuptake inhibitors (NRI), low- dose serotonin (5-HT2) antagonists and reuptake inhibitors (low-dose SARI), noradrenergic and specific serotonergic agents (NaSSa), reversible inhibitors of monoaminoxidase A (rMAO-A), hypericum extracts, and an individualized drug. Psychological interventions were cognitive behavioral therapy (CBT; four forms: face-to-face CBT, remote therapist-led CBT, guided self-help CBT, and no or minimal contact CBT), face-to-face problem-solving therapy (PST), face-to-face interpersonal psychotherapy, face-to-face psychodynamic therapy, and “other face-to-face therapy”. Combination therapies were face-to-face CBT + SSRI, face-to-face PST + SSRI, and face-to-face interpersonal psychotherapy + SSRI.
The dataset was used as an example in Rücker et al. (2020) to illustrate component network meta-analysis using frequentist methods.
medicine, psychiatry, odds ratios, network meta-analysis, component network meta-analysis
Guido Schwarzer, [email protected], https://github.com/guido-s/
Linde, K., Rücker, G., Schneider, A., & Kriston, L. (2016). Questionable assumptions hampered interpretation of a network meta-analysis of primary care depression treatments. Journal of Clinical Epidemiology, 71, 86–96. https://doi.org/10.1016/j.jclinepi.2015.10.010
Rücker, G., Petropoulou, M., & Schwarzer, G. (2020). Network meta-analysis of multicomponent interventions. Biometrical Journal, 62(3), 808–821. https://doi.org/10.1002/bimj.201800167
### Show results of first three studies (first study has three treatment ### arms) head(dat.linde2016, 5) ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print odds ratios and confidence limits with two digits oldset <- settings.meta(digits = 2) ### Define order of treatments in printouts and forest plots trts <- c("SSRI", "Face-to-face CBT", "Face-to-face interpsy", "Face-to-face PST", "Face-to-face CBT + SSRI", "Face-to-face interpsy + SSRI", "Face-to-face PST + SSRI", "Face-to-face psychodyn", "Other face-to-face", "TCA", "SNRI", "NRI", "Low-dose SARI", "NaSSa", "rMAO-A", "Ind drug", "Hypericum", "Remote CBT", "Self-help CBT", "No contact CBT", "UC", "Placebo") ### Conduct random effects network meta-analysis net <- netmeta(lnOR, selnOR, treat1, treat2, id, data = dat.linde2016, reference.group = "placebo", seq = trts, sm = "OR", fixed = FALSE) ### Network graph netgraph(net, seq = "o", number = TRUE) ### Show results net forest(net, xlim = c(0.2, 50)) ### Additive component network meta-analysis with placebo as inactive ### treatment nc <- netcomb(net, inactive = "placebo") nc forest(nc, xlim = c(0.2, 50)) ### Use previous settings settings.meta(oldset) ## End(Not run)
### Show results of first three studies (first study has three treatment ### arms) head(dat.linde2016, 5) ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print odds ratios and confidence limits with two digits oldset <- settings.meta(digits = 2) ### Define order of treatments in printouts and forest plots trts <- c("SSRI", "Face-to-face CBT", "Face-to-face interpsy", "Face-to-face PST", "Face-to-face CBT + SSRI", "Face-to-face interpsy + SSRI", "Face-to-face PST + SSRI", "Face-to-face psychodyn", "Other face-to-face", "TCA", "SNRI", "NRI", "Low-dose SARI", "NaSSa", "rMAO-A", "Ind drug", "Hypericum", "Remote CBT", "Self-help CBT", "No contact CBT", "UC", "Placebo") ### Conduct random effects network meta-analysis net <- netmeta(lnOR, selnOR, treat1, treat2, id, data = dat.linde2016, reference.group = "placebo", seq = trts, sm = "OR", fixed = FALSE) ### Network graph netgraph(net, seq = "o", number = TRUE) ### Show results net forest(net, xlim = c(0.2, 50)) ### Additive component network meta-analysis with placebo as inactive ### treatment nc <- netcomb(net, inactive = "placebo") nc forest(nc, xlim = c(0.2, 50)) ### Use previous settings settings.meta(oldset) ## End(Not run)
Results from 76 studies examining the effectiveness of cognitive behavioral therapy (CBT) for depression in adults.
dat.lopez2019
dat.lopez2019
The data frame contains the following columns:
study | character |
(first) author and year of study |
treatment | character |
treatment provided (see ‘Details’) |
scale | character |
scale used to measure depression symptoms |
n | numeric |
group size |
diff | numeric |
standardized mean change |
se | numeric |
corresponding standard error |
group | numeric |
type of therapy (0 = individual, 1 = group therapy) |
tailored | numeric |
whether the intervention was tailored to each patient (0 = no, 1 = yes) |
sessions | numeric |
number of sessions |
length | numeric |
average session length (in minutes) |
intensity | numeric |
product of sessions and length |
multi | numeric |
intervention included multimedia elements (0 = no, 1 = yes) |
cog | numeric |
intervention included cognitive techniques (0 = no, 1 = yes) |
ba | numeric |
intervention included behavioral activation (0 = no, 1 = yes) |
psed | numeric |
intervention included psychoeducation (0 = no, 1 = yes) |
home | numeric |
intervention included homework (0 = no, 1 = yes) |
prob | numeric |
intervention included problem solving (0 = no, 1 = yes) |
soc | numeric |
intervention included social skills training (0 = no, 1 = yes) |
relax | numeric |
intervention included relaxation (0 = no, 1 = yes) |
goal | numeric |
intervention included goal setting (0 = no, 1 = yes) |
final | numeric |
intervention included a final session (0 = no, 1 = yes) |
mind | numeric |
intervention included mindfulness (0 = no, 1 = yes) |
act | numeric |
intervention included acceptance and commitment therapy (0 = no, 1 = yes) |
The dataset includes the results from 76 studies examining the effectiveness of cognitive behavioral therapy (CBT) for treating depression in adults. Studies included two or more of the following treatments/conditions:
treatment as usual (TAU),
no treatment,
wait list,
psychological or attention placebo,
face-to-face CBT,
multimedia CBT,
hybrid CBT (i.e., multimedia CBT with one or more face-to-face sessions).
Multimedia CBT was defined as CBT delivered via self-help books, audio/video recordings, telephone, computer programs, apps, e-mail, or text messages.
Variable diff
is the standardized mean change within each group, with negative values indicating a decrease in depression symptoms.
psychiatry, standardized mean changes, network meta-analysis
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Personal communication.
López-López, J. A., Davies, S. R., Caldwell, D. M., Churchill, R., Peters, T. J., Tallon, D., Dawson, S., Wu, Q., Li, J., Taylor, A., Lewis, G., Kessler, D. S., Wiles, N., & Welton, N. J. (2019). The process and delivery of CBT for depression in adults: A systematic review and network meta-analysis. Psychological Medicine, 49(12), 1937–1947. https://doi.org/10.1017/S003329171900120X
### copy data into 'dat' and examine data dat <- dat.lopez2019 dat[1:10,1:6] ## Not run: ### load metafor package library(metafor) ### create network graph ('igraph' package must be installed) library(igraph, warn.conflicts=FALSE) pairs <- data.frame(do.call(rbind, sapply(split(dat$treatment, dat$study), function(x) t(combn(x,2)))), stringsAsFactors=FALSE) pairs$X1 <- factor(pairs$X1, levels=sort(unique(dat$treatment))) pairs$X2 <- factor(pairs$X2, levels=sort(unique(dat$treatment))) tab <- table(pairs[,1], pairs[,2]) tab # adjacency matrix g <- graph_from_adjacency_matrix(tab, mode = "plus", weighted=TRUE, diag=FALSE) plot(g, edge.curved=FALSE, edge.width=E(g)$weight/2, layout=layout_in_circle(g, order=c("Wait list", "No treatment", "TAU", "Multimedia CBT", "Hybrid CBT", "F2F CBT", "Placebo")), vertex.size=45, vertex.color="lightgray", vertex.label.color="black", vertex.label.font=2) ### restructure data into wide format dat <- to.wide(dat, study="study", grp="treatment", ref="TAU", grpvars=c("diff","se","n"), postfix=c("1","2")) ### compute contrasts between treatment pairs and corresponding sampling variances dat$yi <- with(dat, diff1 - diff2) dat$vi <- with(dat, se1^2 + se2^2) ### calculate the variance-covariance matrix for multitreatment studies calc.v <- function(x) { v <- matrix(x$se2[1]^2, nrow=nrow(x), ncol=nrow(x)) diag(v) <- x$vi v } V <- bldiag(lapply(split(dat, dat$study), calc.v)) ### add contrast matrix to the dataset dat <- contrmat(dat, grp1="treatment1", grp2="treatment2") ### network meta-analysis using a contrast-based random-effects model ### by setting rho=1/2, tau^2 reflects the amount of heterogeneity for all treatment comparisons ### the treatment left out (TAU) becomes the reference level for the treatment comparisons res <- rma.mv(yi, V, data=dat, mods = ~ 0 + No.treatment + Wait.list + Placebo + F2F.CBT + Hybrid.CBT + Multimedia.CBT, random = ~ comp | study, rho=1/2) res ### forest plot of the contrast estimates (treatments versus TAU) forest(coef(res), diag(vcov(res)), slab=sub(".", " ", names(coef(res)), fixed=TRUE), xlim=c(-5,5), alim=c(-3,3), psize=1, header="Treatment", top=2, xlab="Difference in Standardized Mean Change (compared to TAU)") ### fit random inconsistency effects model (might have to switch optimizer to get convergence) res <- rma.mv(yi, V, data=dat, mods = ~ 0 + No.treatment + Wait.list + Placebo + F2F.CBT + Hybrid.CBT + Multimedia.CBT, random = list(~ comp | study, ~ comp | design), rho=1/2, phi=1/2, control=list(optimizer="BFGS")) res ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.lopez2019 dat[1:10,1:6] ## Not run: ### load metafor package library(metafor) ### create network graph ('igraph' package must be installed) library(igraph, warn.conflicts=FALSE) pairs <- data.frame(do.call(rbind, sapply(split(dat$treatment, dat$study), function(x) t(combn(x,2)))), stringsAsFactors=FALSE) pairs$X1 <- factor(pairs$X1, levels=sort(unique(dat$treatment))) pairs$X2 <- factor(pairs$X2, levels=sort(unique(dat$treatment))) tab <- table(pairs[,1], pairs[,2]) tab # adjacency matrix g <- graph_from_adjacency_matrix(tab, mode = "plus", weighted=TRUE, diag=FALSE) plot(g, edge.curved=FALSE, edge.width=E(g)$weight/2, layout=layout_in_circle(g, order=c("Wait list", "No treatment", "TAU", "Multimedia CBT", "Hybrid CBT", "F2F CBT", "Placebo")), vertex.size=45, vertex.color="lightgray", vertex.label.color="black", vertex.label.font=2) ### restructure data into wide format dat <- to.wide(dat, study="study", grp="treatment", ref="TAU", grpvars=c("diff","se","n"), postfix=c("1","2")) ### compute contrasts between treatment pairs and corresponding sampling variances dat$yi <- with(dat, diff1 - diff2) dat$vi <- with(dat, se1^2 + se2^2) ### calculate the variance-covariance matrix for multitreatment studies calc.v <- function(x) { v <- matrix(x$se2[1]^2, nrow=nrow(x), ncol=nrow(x)) diag(v) <- x$vi v } V <- bldiag(lapply(split(dat, dat$study), calc.v)) ### add contrast matrix to the dataset dat <- contrmat(dat, grp1="treatment1", grp2="treatment2") ### network meta-analysis using a contrast-based random-effects model ### by setting rho=1/2, tau^2 reflects the amount of heterogeneity for all treatment comparisons ### the treatment left out (TAU) becomes the reference level for the treatment comparisons res <- rma.mv(yi, V, data=dat, mods = ~ 0 + No.treatment + Wait.list + Placebo + F2F.CBT + Hybrid.CBT + Multimedia.CBT, random = ~ comp | study, rho=1/2) res ### forest plot of the contrast estimates (treatments versus TAU) forest(coef(res), diag(vcov(res)), slab=sub(".", " ", names(coef(res)), fixed=TRUE), xlim=c(-5,5), alim=c(-3,3), psize=1, header="Treatment", top=2, xlab="Difference in Standardized Mean Change (compared to TAU)") ### fit random inconsistency effects model (might have to switch optimizer to get convergence) res <- rma.mv(yi, V, data=dat, mods = ~ 0 + No.treatment + Wait.list + Placebo + F2F.CBT + Hybrid.CBT + Multimedia.CBT, random = list(~ comp | study, ~ comp | design), rho=1/2, phi=1/2, control=list(optimizer="BFGS")) res ## End(Not run)
Results from studies examining changes in the abundance of fish species in French rivers.
dat.maire2019
dat.maire2019
The object is a list containing a data frame called dat
that contains the following columns and distance matrix called dmat
:
site | character |
study site |
station | character |
sampling station at site |
site_station | character |
site and station combined |
s1 | numeric |
Mann-Kendal trend statistic for relative abundance of non-local species |
vars1 | numeric |
corresponding sampling variance (corrected for temporal autocorrelation) |
s2 | numeric |
Mann-Kendal trend statistic for relative abundance of northern species |
vars2 | numeric |
corresponding sampling variance (corrected for temporal autocorrelation) |
s3 | numeric |
Mann-Kendal trend statistic for relative abundance of non-native species |
vars3 | numeric |
corresponding sampling variance (corrected for temporal autocorrelation) |
const | numeric |
constant value of 1 |
The dataset includes the results from 35 sampling stations (at 11 sites along various French rivers) examining the abundance of various fish species over time (i.e., over 19-37 years, all until 2015). The temporal trend in these abundance data was quantified in terms of Mann-Kendal trend statistics, with positive values indicating monotonically increasing trends. The corresponding sampling variances were corrected for the temporal autocorrelation in the data (Hamed & Rao, 1998).
The distance matrix dmat
indicates the distance of the sampling stations (1-423 river-km). For stations not connected through the river network, a high distance value of 10,000 river-km was set (effectively forcing the spatial correlation to be 0 for such stations).
The dataset can be used to illustrate a meta-analysis allowing for spatial correlation in the outcomes.
ecology, climate change, spatial correlation
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Maire, A., Thierry, E., Viechtbauer, W., & Daufresne, M. (2019). Poleward shift in large-river fish communities detected with a novel meta-analysis framework. Freshwater Biology, 64(6), 1143–1156. https://doi.org/10.1111/fwb.13291
Hamed, K. H., & Rao, A. R. (1998). A modified Mann-Kendall trend test for autocorrelated data. Journal of Hydrology, 204(1-4), 182–196. https://doi.org/10.1016/S0022-1694(97)00125-X
### copy data into 'dat' and examine data dat <- dat.maire2019$dat dat[-10] ### copy distance matrix into 'dmat' and examine first 5 rows/columns dmat <- dat.maire2019$dmat dmat[1:5,1:5] ## Not run: ### load metafor package library(metafor) ### fit a standard random-effects model ignoring spatial correlation res1 <- rma.mv(s1, vars1, random = ~ 1 | site_station, data=dat) res1 ### fit model allowing for spatial correlation res2 <- rma.mv(s1, vars1, random = ~ site_station | const, struct="SPGAU", data=dat, dist=list(dmat), control=list(rho.init=10)) res2 ### add random effects for sites and stations within sites res3 <- rma.mv(s1, vars1, random = list(~ 1 | site/station, ~ site_station | const), struct="SPGAU", data=dat, dist=list(dmat), control=list(rho.init=10)) res3 ### likelihood ratio tests comparing the models anova(res1, res2) anova(res2, res3) ### profile likelihood plots for model res2 profile(res2, cline=TRUE) ### effective range (river-km for which the spatial correlation is >= 0.05) sqrt(3) * res2$rho ### note: it was necessary to adjust the starting value for rho in models ### res2 and res3 so that the optimizer does not get stuck in a local maximum profile(res2, rho=1, xlim=c(0,200), steps=100) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.maire2019$dat dat[-10] ### copy distance matrix into 'dmat' and examine first 5 rows/columns dmat <- dat.maire2019$dmat dmat[1:5,1:5] ## Not run: ### load metafor package library(metafor) ### fit a standard random-effects model ignoring spatial correlation res1 <- rma.mv(s1, vars1, random = ~ 1 | site_station, data=dat) res1 ### fit model allowing for spatial correlation res2 <- rma.mv(s1, vars1, random = ~ site_station | const, struct="SPGAU", data=dat, dist=list(dmat), control=list(rho.init=10)) res2 ### add random effects for sites and stations within sites res3 <- rma.mv(s1, vars1, random = list(~ 1 | site/station, ~ site_station | const), struct="SPGAU", data=dat, dist=list(dmat), control=list(rho.init=10)) res3 ### likelihood ratio tests comparing the models anova(res1, res2) anova(res2, res3) ### profile likelihood plots for model res2 profile(res2, cline=TRUE) ### effective range (river-km for which the spatial correlation is >= 0.05) sqrt(3) * res2$rho ### note: it was necessary to adjust the starting value for rho in models ### res2 and res3 so that the optimizer does not get stuck in a local maximum profile(res2, rho=1, xlim=c(0,200), steps=100) ## End(Not run)
Results from 126 articles that examined the so-called ‘generation effect’.
dat.mccurdy2020
dat.mccurdy2020
The data frame contains the following columns:
article | numeric |
article identifier |
experiment | character |
experiment (within article) identifier |
sample | numeric |
sample (within experiment) identifier |
id | numeric |
row identifier |
pairing | numeric |
identifier to indicate paired conditions within experiments |
yi | numeric |
mean recall rate for the condition |
vi | numeric |
corresponding sampling variance |
ni | numeric |
number of participants for the condition |
stimuli | numeric |
number of stimuli for the condition |
condition | factor |
condition (‘read’ or ‘generate’) |
gen_difficulty | factor |
generation difficulty (‘low’ or ‘high’) |
manip_type | factor |
manipulation type of the generate versus read condition (using a ‘within’ or ‘between’ subjects design) |
present_style | factor |
presentation style (‘mixed’ or ‘pure’ list presentation) |
word_status | factor |
word status (‘words’, ‘non-words’, or ‘numbers’) |
memory_test | factor |
memory test (‘recognition’, ‘cued recall’, or ‘free recall’) |
memory_type | factor |
memory type (‘item’, ‘source’, ‘font color’, ‘font type’, ‘order’, ‘cue word’, ‘background color’, or ‘location’) |
gen_constraint | factor |
generation constraint (‘low’, ‘medium’, or ‘high’) |
learning_type | factor |
learning type (‘incidental’ or ‘intentional’) |
stimuli_relation | factor |
stimuli relation (‘semantic’, ‘category’, ‘antonym’, ‘synonym’, ‘rhyme’, ‘compound words’, ‘definitions’, or ‘unrelated’) |
gen_mode | factor |
generation mode (‘verbal/speaking’, ‘covert/thinking’, or ‘writing/typing’) |
gen_task | factor |
generation task (‘anagram’, ‘letter transposition’, ‘word fragment’, ‘sentence completion’, ‘word stem’, ‘calculation’, or ‘cue only’) |
attention | factor |
attention (‘divided’ or ‘full’) |
pacing | factor |
pacing (‘self-paced’ or ‘timed’) |
filler_task | factor |
filler task (‘yes’ or ‘no’) |
age_grp | factor |
age group (‘younger’ or ‘older’ adults) |
retention_delay | factor |
retention delay (‘immediate’, ‘short’, or ‘long’) |
The generation effect is the memory benefit for self-generated compared with read or experimenter-provided information (Jacoby, 1978; Slamecka & Graf, 1978). In a typical study, participants are presented with a list of stimuli (usually words or word pairs). For half of the stimuli, participants self-generate a target word (e.g., open–cl____), while for the other half, participants simply read an intact target word (e.g., above–below). On a later memory test for the target words, the common finding is that self-generated words are better remembered than read words (i.e., the generation effect).
Although several theories have been proposed to explain the generation effect, there is still some debate on the underlying memory mechanism(s) contributing to this phenomenon. The meta-analysis by McCurdy et al. (2020) translated various theories on the generation effect into hypotheses that could then be tested in moderator analyses based on a dataset containing 126 articles, 310 experiments, and 1653 mean recall estimates collected under various conditions.
Detailed explanations of the various variables coded (and how these can be used to test various hypotheses regarding the generation effect) can be found in the article. The most important variable is condition
, which denotes whether a particular row of the dataset corresponds to the results of a ‘read’ or a ‘generate’ condition.
The data structure is quite complex. Articles may have reported the findings from multiple experiments involving one or multiple samples that were examined under various conditions. The pairing
variable indicates which rows of the dataset represent a pairing of a read condition with one or multiple corresponding generate conditions within an experiment. A pairing may involve the same sample of subjects (when using a within-subjects design for comparing the conditions) or different samples (when using a between-subjects design).
psychology, memory, proportions, raw means, multilevel models, cluster-robust inference
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
McCurdy, M. P., Viechtbauer, W., Sklenar, A. M., Frankenstein, A. N., & Leshikar, E. D. (2020). Theories of the generation effect and the impact of generation constraint: A meta-analytic review. Psychonomic Bulletin & Review, 27(6), 1139–1165. https://doi.org/10.3758/s13423-020-01762-3
Slamecka, N. J., & Graf, P. (1978). The generation effect: Delineation of a phenomenon. Journal of Experimental Psychology: Human Learning and Memory, 4(6), 592–604. https://doi.org/10.1037/0278-7393.4.6.592
Jacoby, L. L. (1978). On interpreting the effects of repetition: Solving a problem versus remembering a solution. Journal of Verbal Learning and Verbal Behavior, 17(6), 649–668. https://doi.org/10.1016/S0022-5371(78)90393-6
### copy data into 'dat' and examine data dat <- dat.mccurdy2020 head(dat) ## Not run: ### load metafor package library(metafor) ### fit multilevel mixed-effects meta-regression model res <- rma.mv(yi, vi, mods = ~ condition, random = list(~ 1 | article/experiment/sample/id, ~ 1 | pairing), data=dat, sparse=TRUE, digits=3) res ### proportion of total amount of heterogeneity due to each component data.frame(source=res$s.names, sigma2=round(res$sigma2, 3), prop=round(res$sigma2 / sum(res$sigma2), 2)) ### apply cluster-robust inference methods sav <- robust(res, cluster=article, clubSandwich=TRUE) sav ### estimated average recall rate in read and generate conditions predict(sav, newmods = c(0,1), digits=3) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.mccurdy2020 head(dat) ## Not run: ### load metafor package library(metafor) ### fit multilevel mixed-effects meta-regression model res <- rma.mv(yi, vi, mods = ~ condition, random = list(~ 1 | article/experiment/sample/id, ~ 1 | pairing), data=dat, sparse=TRUE, digits=3) res ### proportion of total amount of heterogeneity due to each component data.frame(source=res$s.names, sigma2=round(res$sigma2, 3), prop=round(res$sigma2 / sum(res$sigma2), 2)) ### apply cluster-robust inference methods sav <- robust(res, cluster=article, clubSandwich=TRUE) sav ### estimated average recall rate in read and generate conditions predict(sav, newmods = c(0,1), digits=3) ## End(Not run)
Results from 160 studies on the correlation between employment interview assessments and job performance.
dat.mcdaniel1994
dat.mcdaniel1994
The data frame contains the following columns:
study | numeric |
study number |
ni | numeric |
sample size of the study |
ri | numeric |
observed correlation |
type | character |
interview type (j = job-related, s = situational, p = psychological) |
struct | character |
interview structure (u = unstructured, s = structured) |
The 160 studies provide data in terms of the correlation between employment interview performance and actual job performance. In addition, the interview type and the interview structure are indicated.
McDaniel et al. (1994) describe the interview type and structure variables as follows. "Questions in situational interviews [...] focus on the individual's ability to project what his or her behavior would be in a given situation. [...] Job-related interviews are those in which the interviewer is a personnel officer or hiring authority and the questions attempt to assess past behaviors and job-related information, but most questions are not considered situational. Psychological interviews are conducted by a psychologist, and the questions are intended to assess personal traits, such as dependability." In structured interviews, "the questions and acceptable responses were specified in advance and the responses were rated for appropriateness of content. [...] Unstructured interviews gather applicant information in a less systematic manner than do structured interviews. Although the questions may be specified in advance, they usually are not, and there is seldom a formalized scoring guide. Also, all persons being interviewed are not typically asked the same questions."
The goal of the meta-analysis was to examine the overall criterion-related validity of employment interviews and to examine whether the validity depends on the type and structure of the interview.
The data in this dataset were obtained from Table A.2 in Rothstein, Sutton, and Borenstein (2005, p. 325-329). Note that the type
and struct
variables contain some NA
s.
psychology, correlation coefficients, meta-regression
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Rothstein, H. R., Sutton, A. J., & Borenstein, M. (Eds.). (2005). Publication bias in meta-analysis: Prevention, assessment, and adjustments. Chichester, England: Wiley.
McDaniel, M. A., Whetzel, D. L., Schmidt, F. L., & Maurer, S. D. (1994). The validity of employment interviews: A comprehensive review and meta-analysis. Journal of Applied Psychology, 79(4), 599–616. https://doi.org/10.1037/0021-9010.79.4.599
### copy data into 'dat' and examine data dat <- dat.mcdaniel1994 head(dat) ## Not run: ### load metafor package library(metafor) ### calculate r-to-z transformed correlations and corresponding sampling variances dat <- escalc(measure="ZCOR", ri=ri, ni=ni, data=dat) head(dat) ### meta-analysis of the transformed correlations using a random-effects model res <- rma(yi, vi, data=dat) res ### average correlation with 95% CI predict(res, transf=transf.ztor, digits=2) ### mixed-effects model with interview type as factor ### note: job-related interviews is the reference level res <- rma(yi, vi, mods = ~ factor(type), data=dat) res ### estimated average correlation for each level of interview type res <- rma(yi, vi, mods = ~ 0 + factor(type), data=dat) predict(res, newmods=diag(3), transf=transf.ztor, digits=2) ### mixed-effects model with interview structure as factor ### note: structured interviews is the reference level res <- rma(yi, vi, mods = ~ factor(struct), data=dat) res ### estimated average correlation for each level of interview structure res <- rma(yi, vi, mods = ~ 0 + factor(struct), data=dat) predict(res, newmods=diag(2), transf=transf.ztor, digits=2) ### note: the interpretation of the results is difficult since all ### situational interviews were structured, almost all psychological ### interviews were unstructured, and actually for the majority of ### the psychological interviews it was unknown whether the interview ### was structured or unstructured table(dat$type, dat$struct, useNA="always") ### meta-analysis of raw correlations using a random-effects model res <- rma(measure="COR", ri=ri, ni=ni, data=dat.mcdaniel1994) res ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.mcdaniel1994 head(dat) ## Not run: ### load metafor package library(metafor) ### calculate r-to-z transformed correlations and corresponding sampling variances dat <- escalc(measure="ZCOR", ri=ri, ni=ni, data=dat) head(dat) ### meta-analysis of the transformed correlations using a random-effects model res <- rma(yi, vi, data=dat) res ### average correlation with 95% CI predict(res, transf=transf.ztor, digits=2) ### mixed-effects model with interview type as factor ### note: job-related interviews is the reference level res <- rma(yi, vi, mods = ~ factor(type), data=dat) res ### estimated average correlation for each level of interview type res <- rma(yi, vi, mods = ~ 0 + factor(type), data=dat) predict(res, newmods=diag(3), transf=transf.ztor, digits=2) ### mixed-effects model with interview structure as factor ### note: structured interviews is the reference level res <- rma(yi, vi, mods = ~ factor(struct), data=dat) res ### estimated average correlation for each level of interview structure res <- rma(yi, vi, mods = ~ 0 + factor(struct), data=dat) predict(res, newmods=diag(2), transf=transf.ztor, digits=2) ### note: the interpretation of the results is difficult since all ### situational interviews were structured, almost all psychological ### interviews were unstructured, and actually for the majority of ### the psychological interviews it was unknown whether the interview ### was structured or unstructured table(dat$type, dat$struct, useNA="always") ### meta-analysis of raw correlations using a random-effects model res <- rma(measure="COR", ri=ri, ni=ni, data=dat.mcdaniel1994) res ## End(Not run)
Results from studies exploring how a superfluous fMRI brain image influences the persuasiveness of a scientific claim.
dat.michael2013
dat.michael2013
The data frame contains the following columns:
Study | character |
name of the study: Citation - Experiment - Subgroup |
No_brain_n | numeric |
sample size for no-brain-image condition |
No_brain_m | numeric |
mean agreement rating for no-brain-image condition |
No_brain_s | numeric |
standard deviation for no-brain-image condition |
Brain_n | numeric |
sample size for brain-image condition |
Brain_m | numeric |
mean agreement rating for brain-image condition |
Brain_s | numeric |
standard deviation for brain-image condition |
Included_Critique | character |
‘Critique’ if article included critical commentary on conclusions, otherwise ‘No_critique’ |
Medium | character |
‘Paper’ if conducted in person; ‘Online’ if conducted online |
Compensation | character |
notes on compensation provided to participants |
Participant_Pool | character |
notes on where participants were recruited |
yi | numeric |
raw mean difference, calculated as Brain_m - No_brain_m |
vi | numeric |
corresponding sampling variance |
The dataset contains the data from the meta-analysis by Michael et al. (2013) of experiments on the persuasive power of a brain image. The meta-analysis analyzed an original study by McCabe and Castel (2008) as well as 10 replication attempts conducted by the authors of the meta-analysis.
In each study, participants read an article about using brain imaging as a lie detector. The article either included a superfluous fMRI image of a brain (brain) or not (no_brain). After reading the article, all participants responded to the statement “Do you agree or disagree with the conclusion that brain imaging can be used as a lie detector?” on a scale from 1 (strongly disagree) to 4 (strongly agree).
The original study by McCabe and Castel (2008) reported a relatively large increase in agreement due to the presence of brain images. Meta-analysis of the original study with the 10 replications suggests, however, a small, possibly null effect: an estimated average raw mean difference of 0.07 points, 95% CI [-0.00, 0.14], under a random-effects model.
In some studies, the article included a passage critiquing the primary claims made in the article; this is coded in the Included_Critique
column for analysis as a possible moderator. Note that Experiment 3 by McCabe and Castel (2008) was a 2x2 between subjects design: brain image presence was manipulated as well as the inclusion of a critique. The two different critique conditions are recorded as separate rows in this dataset. Analysis of this dataset with metafor yields the same results (given rounding) reported in the manuscript.
psychology, persuasion, raw mean differences
Robert Calin-Jageman, [email protected], https://calin-jageman.net
Michael, R. B., Newman, E. J., Vuorre, M., Cumming, G., & Garry, M. (2013). On the (non)persuasive power of a brain image. Psychonomic Bulletin & Review, 20(4), 720–-725. https://doi.org/10.3758/s13423-013-0391-6
McCabe, D. P., & Castel, A. D. (2008). Seeing is believing: The effect of brain images on judgments of scientific reasoning. Cognition, 107(1), 343–352. https://doi.org/10.1016/j.cognition.2007.07.017
### copy data into 'dat' and examine data dat <- dat.michael2013 dat ## Not run: ### load metafor package library(metafor) ### Data prep # yi and vi are already provided, but here's how you would use escalc() to obtain # a raw-mean difference and its variance. # Note the measure parameter is "MD" for 'raw mean difference' dat <- metafor::escalc( measure = "MD", m1i = Brain_m, m2i = No_brain_m, sd1i = Brain_s, sd2i = No_brain_s, n1i = Brain_n, n2i = No_brain_n, data = dat ) ### meta-analysis using a random-effects model of the raw mean differences res <- rma(yi, vi, data=dat) print(res, digits=2) ### examine if Included_Critique is a potential moderator res <- rma(yi, vi, mods = ~ Included_Critique, data=dat) print(res, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.michael2013 dat ## Not run: ### load metafor package library(metafor) ### Data prep # yi and vi are already provided, but here's how you would use escalc() to obtain # a raw-mean difference and its variance. # Note the measure parameter is "MD" for 'raw mean difference' dat <- metafor::escalc( measure = "MD", m1i = Brain_m, m2i = No_brain_m, sd1i = Brain_s, sd2i = No_brain_s, n1i = Brain_n, n2i = No_brain_n, data = dat ) ### meta-analysis using a random-effects model of the raw mean differences res <- rma(yi, vi, data=dat) print(res, digits=2) ### examine if Included_Critique is a potential moderator res <- rma(yi, vi, mods = ~ Included_Critique, data=dat) print(res, digits=2) ## End(Not run)
Results from 16 studies on the correlation between conscientiousness and medication adherence.
dat.molloy2014
dat.molloy2014
The data frame contains the following columns:
authors | character |
study authors |
year | numeric |
publication year |
ni | numeric |
sample size of the study |
ri | numeric |
observed correlation |
controls | character |
number of variables controlled for |
design | character |
whether a cross-sectional or prospective design was used |
a_measure | character |
type of adherence measure (self-report or other) |
c_measure | character |
type of conscientiousness measure (NEO or other) |
meanage | numeric |
mean age of the sample |
quality | numeric |
methodological quality |
Conscientiousness, one of the big-5 personality traits, can be defined as “socially prescribed impulse control that facilitates task- and goal-directed behaviour, such as thinking before acting, delaying gratification, following norms and rules and planning, organising and prioritising tasks” (John & Srivastava, 1999). Conscientiousness has been shown to be related to a number of health-related behaviors (e.g., tobacco/alcohol/drug use, diet and activity patterns, risky behaviors). A recent meta-analysis by Molloy et al. (2014) examined to what extent conscientiousness is related to medication adherence, that is, the extent to which (typically chronically ill) patients follow a prescribed medication regimen (e.g., taking a daily dose of a cholesterol lowering drug in patients with high LDL serum cholesterol levels). The results from the 16 studies included in this meta-analysis are provided in this dataset.
Variable a_measure
indicates whether adherence was measured based on self-reports or a more ‘objective’ measure (e.g., electronic monitoring of pill bottle openings, pill counts). Variable c_measure
indicates whether conscientiousness was measured with some version of the NEO personality inventory or some other scale. Methodological quality was scored by the authors on a 1 to 4 scale with higher scores indicating higher quality (see article for details on how this score was derived).
psychology, medicine, correlation coefficients
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Molloy, G. J., O'Carroll, R. E., & Ferguson, E. (2014). Conscientiousness and medication adherence: A meta-analysis. Annals of Behavioral Medicine, 47(1), 92–101. https://doi.org/10.1007/s12160-013-9524-4
John, O. P., & Srivastava, S. (1999). The Big Five Trait taxonomy: History, measurement, and theoretical perspectives. In L. A. Pervin & O. P. John (Eds.), Handbook of personality: Theory and research (2nd ed., pp. 102-138). New York: Guilford Press.
### copy data into 'dat' and examine data dat <- dat.molloy2014 dat[-c(5:6)] ## Not run: ### load metafor package library(metafor) ### calculate r-to-z transformed correlations and corresponding sampling variances dat <- escalc(measure="ZCOR", ri=ri, ni=ni, data=dat, slab=paste(authors, year, sep=", ")) dat[-c(5:6)] ### meta-analysis of the transformed correlations using a random-effects model res <- rma(yi, vi, data=dat) res ### average correlation with 95% CI predict(res, digits=3, transf=transf.ztor) ### forest plot forest(res, addpred=TRUE, xlim=c(-1.6,1.6), atransf=transf.ztor, at=transf.rtoz(seq(-0.4, 0.6, by=0.2)), digits=c(2,1), cex=0.9, header="Author(s), Year", top=2) ### funnel plot funnel(res) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.molloy2014 dat[-c(5:6)] ## Not run: ### load metafor package library(metafor) ### calculate r-to-z transformed correlations and corresponding sampling variances dat <- escalc(measure="ZCOR", ri=ri, ni=ni, data=dat, slab=paste(authors, year, sep=", ")) dat[-c(5:6)] ### meta-analysis of the transformed correlations using a random-effects model res <- rma(yi, vi, data=dat) res ### average correlation with 95% CI predict(res, digits=3, transf=transf.ztor) ### forest plot forest(res, addpred=TRUE, xlim=c(-1.6,1.6), atransf=transf.ztor, at=transf.rtoz(seq(-0.4, 0.6, by=0.2)), digits=c(2,1), cex=0.9, header="Author(s), Year", top=2) ### funnel plot funnel(res) ## End(Not run)
Results from 457 studies on assortative mating in various species.
dat.moura2021
dat.moura2021
The object is a list containing a data frame called dat
that contains the following columns and a phylogenetic tree called tree
:
study.id | character |
study id |
effect.size.id | numeric |
effect size id |
species | character |
species |
species.id | character |
species id (as in the Open Tree of Life reference taxonomy) |
subphylum | character |
the subphyla of the species |
phylum | character |
the phyla of the species |
assortment.trait | character |
the measure of body size |
trait.dimensions | character |
dimensionality of the measure |
field.collection | character |
whether data were collected in the field |
publication.year | numeric |
publication year of the study |
pooled.data | character |
whether data were pooled either spatially and/or temporally |
spatially.pooled | character |
whether data were pooled spatially |
temporally.pooled | character |
whether data were pooled temporally |
ri | numeric |
correlation coefficient |
ni | numeric |
sample size |
The 457 studies included in this dataset provide 1828 correlation coefficients describing the similarity in some measure of body size in mating couples in 341 different species.
ecology, evolution, correlation coefficients, multivariate models, phylogeny, meta-regression
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Rios Moura, R., Oliveira Gonzaga, M., Silva Pinto, N., Vasconcellos-Neto, J., & Requena, G. S. (2021). Assortative mating in space and time: Patterns and biases. Ecology Letters, 24(5), 1089–1102. https://doi.org/10.1111/ele.13690
Cinar, O., Nakagawa, S., & Viechtbauer, W. (in press). Phylogenetic multilevel meta-analysis: A simulation study on the importance of modelling the phylogeny. Methods in Ecology and Evolution. https://doi.org/10.1111/2041-210X.13760
Hadfield, J. D., & Nakagawa, S. (2010). General quantitative genetic methods for comparative biology: Phylogenies, taxonomies and multi-trait models for continuous and categorical characters. Journal of Evolutionary Biology, 23(3), 494–508. https://doi.org/10.1111/j.1420-9101.2009.01915.x
Nakagawa, S., & Santos, E. S. A. (2012). Methodological issues and advances in biological meta-analysis. Evolutionary Ecology, 26(5), 1253–1274. https://doi.org/10.1007/s10682-012-9555-5
### copy data into 'dat' and examine data dat <- dat.moura2021$dat head(dat) ## Not run: ### load metafor package library(metafor) ### load ape package library(ape, warn.conflicts=FALSE) ### calculate r-to-z transformed correlations and corresponding sampling variances dat <- escalc(measure="ZCOR", ri=ri, ni=ni, data=dat) ### copy tree to 'tree' tree <- dat.moura2021$tree ### turn tree into an ultrametric one tree <- compute.brlen(tree) ### compute phylogenetic correlation matrix A <- vcv(tree, corr=TRUE) ### make copy of the species.id variable dat$species.id.phy <- dat$species.id ### fit multilevel phylogenetic meta-analytic model res <- rma.mv(yi, vi, random = list(~ 1 | study.id, ~ 1 | effect.size.id, ~ 1 | species.id, ~ 1 | species.id.phy), R=list(species.id.phy=A), data=dat) res ### examine if spatial and/or temporal pooling of data tends to yield larger correlations res <- rma.mv(yi, vi, mods = ~ spatially.pooled * temporally.pooled, random = list(~ 1 | study.id, ~ 1 | effect.size.id, ~ 1 | species.id, ~ 1 | species.id.phy), R=list(species.id.phy=A), data=dat) res ### estimated average correlation without pooling, when pooling spatially, ### when pooling temporally, and when pooling spatially and temporally predict(res, newmods = rbind(c(0,0,0),c(1,0,0),c(0,1,0),c(1,1,1)), transf=transf.ztor, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.moura2021$dat head(dat) ## Not run: ### load metafor package library(metafor) ### load ape package library(ape, warn.conflicts=FALSE) ### calculate r-to-z transformed correlations and corresponding sampling variances dat <- escalc(measure="ZCOR", ri=ri, ni=ni, data=dat) ### copy tree to 'tree' tree <- dat.moura2021$tree ### turn tree into an ultrametric one tree <- compute.brlen(tree) ### compute phylogenetic correlation matrix A <- vcv(tree, corr=TRUE) ### make copy of the species.id variable dat$species.id.phy <- dat$species.id ### fit multilevel phylogenetic meta-analytic model res <- rma.mv(yi, vi, random = list(~ 1 | study.id, ~ 1 | effect.size.id, ~ 1 | species.id, ~ 1 | species.id.phy), R=list(species.id.phy=A), data=dat) res ### examine if spatial and/or temporal pooling of data tends to yield larger correlations res <- rma.mv(yi, vi, mods = ~ spatially.pooled * temporally.pooled, random = list(~ 1 | study.id, ~ 1 | effect.size.id, ~ 1 | species.id, ~ 1 | species.id.phy), R=list(species.id.phy=A), data=dat) res ### estimated average correlation without pooling, when pooling spatially, ### when pooling temporally, and when pooling spatially and temporally predict(res, newmods = rbind(c(0,0,0),c(1,0,0),c(0,1,0),c(1,1,1)), transf=transf.ztor, digits=2) ## End(Not run)
A meta-analysis on the association between the size of a male's bib and their social status in house sparrows (Passer domesticus).
dat.nakagawa2007
dat.nakagawa2007
The data frame contains the following columns:
StudyID | character |
identity of primary study |
Place | character |
location of study population |
Correlation | numeric |
correlation coefficient |
SampleSize | integer |
sample size of population |
Each study measures the association between a sparrows bib size and its social status. Effects are quantified as correlation coefficients.
ecology, correlation coefficients
Daniel Noble, [email protected]
Nakagawa, S., Ockendon, N., Gillespie, D. O. S, Hatchwell, B. J., & Burke, T. (2007). Assessing the function of house sparrows' bib size using a flexible meta-analysis method. Behavioral Ecology, 18(5), 831–840. https://doi.org/10.1093/beheco/arm050
### copy data into 'dat' and examine data dat <- dat.nakagawa2007 dat ## Not run: ### load metafor package library(metafor) ### calculate Zr dat <- escalc(measure="ZCOR", ri=Correlation, ni=SampleSize, data=dat) ### fit meta-analytic model res <- rma.mv(yi, vi, random = ~ 1 | StudyID, data=dat) res ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.nakagawa2007 dat ## Not run: ### load metafor package library(metafor) ### calculate Zr dat <- escalc(measure="ZCOR", ri=Correlation, ni=SampleSize, data=dat) ### fit meta-analytic model res <- rma.mv(yi, vi, random = ~ 1 | StudyID, data=dat) res ## End(Not run)
Results from 18 studies comparing the risk of catheter-related bloodstream infection when using anti-infective-treated versus standard catheters in the acute care setting.
dat.nielweise2007
dat.nielweise2007
The data frame contains the following columns:
study | numeric |
study number |
author | character |
(first) author |
year | numeric |
publication year |
ai | numeric |
number of CRBSIs in patients receiving an anti-infective catheter |
n1i | numeric |
number of patients receiving an anti-infective catheter |
ci | numeric |
number of CRBSIs in patients receiving a standard catheter |
n2i | numeric |
number of patients receiving a standard catheter |
The use of a central venous catheter may lead to a catheter-related bloodstream infection (CRBSI), which in turn increases the risk of morbidity and mortality. Anti-infective-treated catheters have been developed that are meant to reduce the risk of CRBSIs. Niel-Weise et al. (2007) conducted a meta-analysis of studies comparing infection risk when using anti-infective-treated versus standard catheters in the acute care setting. The results from 18 such studies are included in this dataset.
The dataset was used in the article by Stijnen et al. (2010) to illustrate various generalized linear mixed-effects models for the meta-analysis of proportions and odds ratios (see ‘References’).
medicine, odds ratios, generalized linear models
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Niel-Weise, B. S., Stijnen, T., & van den Broek, P. J. (2007). Anti-infective-treated central venous catheters: A systematic review of randomized controlled trials. Intensive Care Medicine, 33(12), 2058–2068. https://doi.org/10.1007/s00134-007-0897-3
Stijnen, T., Hamza, T. H., & Ozdemir, P. (2010). Random effects meta-analysis of event outcome in the framework of the generalized linear mixed model with applications in sparse data. Statistics in Medicine, 29(29), 3046–3067. https://doi.org/10.1002/sim.4040
### copy data into 'dat' and examine data dat <- dat.nielweise2007 dat ## Not run: ### load metafor package library(metafor) ### standard (inverse-variance) random-effects model res <- rma(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, drop00=TRUE) print(res, digits=3) predict(res, transf=exp, digits=2) ### random-effects conditional logistic model res <- rma.glmm(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, model="CM.EL") print(res, digits=3) predict(res, transf=exp, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.nielweise2007 dat ## Not run: ### load metafor package library(metafor) ### standard (inverse-variance) random-effects model res <- rma(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, drop00=TRUE) print(res, digits=3) predict(res, transf=exp, digits=2) ### random-effects conditional logistic model res <- rma.glmm(measure="OR", ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, model="CM.EL") print(res, digits=3) predict(res, transf=exp, digits=2) ## End(Not run)
Results from 18 studies comparing the risk of catheter-related bloodstream infection when using anti-infective-treated versus standard catheters for total parenteral nutrition or chemotherapy.
dat.nielweise2008
dat.nielweise2008
The data frame contains the following columns:
study | numeric |
study number |
authors | character |
study authors |
year | numeric |
publication year |
x1i | numeric |
number of CRBSIs in patients receiving an anti-infective catheter |
t1i | numeric |
total number of catheter days for patients receiving an anti-infective catheter |
x2i | numeric |
number of CRBSIs in patients receiving a standard catheter |
t2i | numeric |
total number of catheter days for patients receiving a standard catheter |
The use of a central venous catheter may lead to a catheter-related bloodstream infection (CRBSI), which in turn increases the risk of morbidity and mortality. Anti-infective-treated catheters have been developed that are meant to reduce the risk of CRBSIs. Niel-Weise et al. (2008) conducted a meta-analysis of studies comparing infection risk when using anti-infective-treated versus standard catheters for total parenteral nutrition or chemotherapy. The results from 9 such studies are included in this dataset.
The dataset was used in the article by Stijnen et al. (2010) to illustrate various generalized linear mixed-effects models for the meta-analysis of incidence rates and incidence rate ratios (see ‘References’).
medicine, incidence rates, generalized linear models
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Niel-Weise, B. S., Stijnen, T., & van den Broek, P. J. (2008). Anti-infective-treated central venous catheters for total parenteral nutrition or chemotherapy: A systematic review. Journal of Hospital Infection, 69(2), 114–123. https://doi.org/10.1016/j.jhin.2008.02.020
Stijnen, T., Hamza, T. H., & Ozdemir, P. (2010). Random effects meta-analysis of event outcome in the framework of the generalized linear mixed model with applications in sparse data. Statistics in Medicine, 29(29), 3046–3067. https://doi.org/10.1002/sim.4040
### copy data into 'dat' and examine data dat <- dat.nielweise2008 dat ## Not run: ### load metafor package library(metafor) ### standard (inverse-variance) random-effects model res <- rma(measure="IRR", x1i=x1i, t1i=t1i, x2i=x2i, t2i=t2i, data=dat) print(res, digits=3) predict(res, transf=exp, digits=2) ### random-effects conditional Poisson model res <- rma.glmm(measure="IRR", x1i=x1i, t1i=t1i, x2i=x2i, t2i=t2i, data=dat, model="CM.EL") print(res, digits=3) predict(res, transf=exp, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.nielweise2008 dat ## Not run: ### load metafor package library(metafor) ### standard (inverse-variance) random-effects model res <- rma(measure="IRR", x1i=x1i, t1i=t1i, x2i=x2i, t2i=t2i, data=dat) print(res, digits=3) predict(res, transf=exp, digits=2) ### random-effects conditional Poisson model res <- rma.glmm(measure="IRR", x1i=x1i, t1i=t1i, x2i=x2i, t2i=t2i, data=dat, model="CM.EL") print(res, digits=3) predict(res, transf=exp, digits=2) ## End(Not run)
Results from 9 studies on the length of the hospital stay of stroke patients under specialized care and under conventional/routine (non-specialist) care.
dat.normand1999
dat.normand1999
The data frame contains the following columns:
study | numeric |
study number |
source | character |
source of data |
n1i | numeric |
number of patients under specialized care |
m1i | numeric |
mean length of stay (in days) under specialized care |
sd1i | numeric |
standard deviation of the length of stay under specialized care |
n2i | numeric |
number of patients under routine care |
m2i | numeric |
mean length of stay (in days) under routine care |
sd2i | numeric |
standard deviation of the length of stay under routine care |
The 9 studies provide data in terms of the mean length of the hospital stay (in days) of stroke patients under specialized care and under conventional/routine (non-specialist) care. The goal of the meta-analysis was to examine the hypothesis whether specialist stroke unit care will result in a shorter length of hospitalization compared to routine management.
medicine, raw mean differences, standardized mean differences
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Normand, S. T. (1999). Meta-analysis: Formulating, evaluating, combining, and reporting. Statistics in Medicine, 18(3), 321–359. https://doi.org/10.1002/(sici)1097-0258(19990215)18:3<321::aid-sim28>3.0.co;2-p
### copy data into 'dat' and examine data dat <- dat.normand1999 dat ## Not run: ### load metafor package library(metafor) ### calculate mean differences and corresponding sampling variances dat <- escalc(measure="MD", m1i=m1i, sd1i=sd1i, n1i=n1i, m2i=m2i, sd2i=sd2i, n2i=n2i, data=dat) dat ### meta-analysis of mean differences using a random-effects model res <- rma(yi, vi, data=dat) res ### meta-analysis of standardized mean differences using a random-effects model res <- rma(measure="SMD", m1i=m1i, sd1i=sd1i, n1i=n1i, m2i=m2i, sd2i=sd2i, n2i=n2i, data=dat, slab=source) res ### draw forest plot forest(res, xlim=c(-7,5), alim=c(-3,1), header="Study/Source", top=2) ### calculate (log transformed) ratios of means and corresponding sampling variances dat <- escalc(measure="ROM", m1i=m1i, sd1i=sd1i, n1i=n1i, m2i=m2i, sd2i=sd2i, n2i=n2i, data=dat) dat ### meta-analysis of the (log transformed) ratios of means using a random-effects model res <- rma(yi, vi, data=dat) res predict(res, transf=exp, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.normand1999 dat ## Not run: ### load metafor package library(metafor) ### calculate mean differences and corresponding sampling variances dat <- escalc(measure="MD", m1i=m1i, sd1i=sd1i, n1i=n1i, m2i=m2i, sd2i=sd2i, n2i=n2i, data=dat) dat ### meta-analysis of mean differences using a random-effects model res <- rma(yi, vi, data=dat) res ### meta-analysis of standardized mean differences using a random-effects model res <- rma(measure="SMD", m1i=m1i, sd1i=sd1i, n1i=n1i, m2i=m2i, sd2i=sd2i, n2i=n2i, data=dat, slab=source) res ### draw forest plot forest(res, xlim=c(-7,5), alim=c(-3,1), header="Study/Source", top=2) ### calculate (log transformed) ratios of means and corresponding sampling variances dat <- escalc(measure="ROM", m1i=m1i, sd1i=sd1i, n1i=n1i, m2i=m2i, sd2i=sd2i, n2i=n2i, data=dat) dat ### meta-analysis of the (log transformed) ratios of means using a random-effects model res <- rma(yi, vi, data=dat) res predict(res, transf=exp, digits=2) ## End(Not run)
Results from 13 studies on the relationship between maternal body mass index (BMI) and the risk of preeclampsia.
dat.obrien2003
dat.obrien2003
The data frame contains the following columns:
study | numeric |
study id |
author | character |
(first) author of the study |
year | numeric |
publication year |
ref | numeric |
reference number |
ch | character |
exclusion due to chronic hypertension (yes/no) |
dm | character |
exclusion due to diabetes mellitus (yes/no) |
mg | character |
exclusion due to multiple gestation (yes/no) |
bmi.lb | numeric |
lower bound of the BMI interval |
bmi.ub | numeric |
upper bound of the BMI interval |
bmi | numeric |
midpoint of the BMI interval |
cases | numeric |
number of preeclampsia cases in the BMI group |
total | numeric |
number of individuals in the BMI group |
The dataset includes the results from 13 studies examining the relationship between maternal body mass index (BMI) and the risk of preeclampsia. For each study, results are given in terms of the number of preeclampsia cases within two or more groups defined by the lower and upper BMI bounds as shown in the dataset (NA
means that the interval is either open to the left or right). The bmi
variable is the interval midpoint as defined by O'Brien et al. (2003).
medicine, obstetrics, risk ratios, proportions, multilevel models, dose-response models
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
O'Brien, T. E., Ray, J. G., & Chan, W.-S. (2003). Maternal body mass index and the risk of preeclampsia: A systematic overview. Epidemiology, 14(3), 368–374. https://doi.org/10.1097/00001648-200305000-00020
### copy data into 'dat' and examine data dat <- dat.obrien2003 dat ## Not run: ### load metafor package library(metafor) ### restructure the data into a wide format dat2 <- to.wide(dat, study="study", grp="grp", ref=1, grpvars=c("bmi","cases","total"), addid=FALSE, adddesign=FALSE, postfix=c(1,2)) dat2[1:10, -c(2:3)] ### calculate log risk ratios and corresponding sampling variances dat2 <- escalc(measure="RR", ai=cases1, n1i=total1, ci=cases2, n2i=total2, data=dat2) dat2[1:10, -c(2:7)] ### forest plot of the risk ratios dd <- c(0,diff(dat2$study)) dd[dd > 0] <- 1 rows <- (1:nrow(dat2)) + cumsum(dd) rows <- 1 + max(rows) - rows slabs <- mapply(function(x,y,z) as.expression(bquote(.(x)^.(y)~.(z))), dat2$author, dat2$ref, dat2$year) with(dat2, forest(yi, vi, header=TRUE, slab=slabs, xlim=c(-7,5.5), fonts="mono", cex=0.8, psize=1, pch=19, efac=0, rows=rows, ylim=c(0,max(rows)+3), yaxs="i", atransf=exp, at=log(c(0.05,0.1,0.2,0.5,1,2,5,10,20)), ilab=comp, ilab.xpos=-4, ilab.pos=4)) text(-4.4, max(rows)+2, "Comparison", font=2, cex=0.8, pos=4) ### within-study mean center the BMI variable dat$bmicent <- with(dat, bmi - ave(bmi, study)) ### compute the proportion of preeclampsia cases and corresponding sampling variances dat <- escalc(measure="PR", xi=cases, ni=total, data=dat) ### convert the proportions to percentages (and convert the variances accordingly) dat$yi <- dat$yi*100 dat$vi <- dat$vi*100^2 dat[1:10, -c(2:3)] ### fit multilevel meta-regression model to examine the relationship between the ### (centered) BMI variable and the risk of preeclampsia res <- rma.mv(yi, vi, mods = ~ bmicent, random = ~ 1 | study/grp, data=dat) res ### draw scatterplot with regression line res$slab <- dat$ref regplot(res, xlab=expression("Within-Study Mean Centered BMI"~(kg/m^2)), ylab="Preeclampsia Prevalence (%)", las=1, bty="l", at=seq(0,18,by=2), olim=c(0,100), psize=2, bg="gray90", label=TRUE, offset=0, labsize=0.6) ### fit model using a random slope for bmicent res <- rma.mv(yi, vi, mods = ~ bmicent, random = ~ bmicent | study, struct="GEN", data=dat) res ### load rms package library(rms) ### fit restricted cubic spline model res <- rma.mv(yi, vi, mods = ~ rcs(bmicent, 4), random = ~ 1 | study/grp, data=dat) res ### get knot positions knots <- attr(rcs(model.matrix(res)[,2], 4), "parms") ### computed predicted values based on the model xs <- seq(-10, 10, length=1000) sav <- predict(res, newmods=rcspline.eval(xs, knots, inclx=TRUE)) ### draw scatterplot with regression line based on the model tmp <- regplot(res, mod=2, pred=sav, xvals=xs, xlab=expression("Within-Study Mean Centered BMI"~(kg/m^2)), ylab="Preeclampsia Prevalence (%)", las=1, bty="l", at=seq(0,18,by=2), olim=c(0,100), psize=2, bg="gray90", label=TRUE, offset=0, labsize=0.6) abline(v=knots, lty="dotted") points(tmp) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.obrien2003 dat ## Not run: ### load metafor package library(metafor) ### restructure the data into a wide format dat2 <- to.wide(dat, study="study", grp="grp", ref=1, grpvars=c("bmi","cases","total"), addid=FALSE, adddesign=FALSE, postfix=c(1,2)) dat2[1:10, -c(2:3)] ### calculate log risk ratios and corresponding sampling variances dat2 <- escalc(measure="RR", ai=cases1, n1i=total1, ci=cases2, n2i=total2, data=dat2) dat2[1:10, -c(2:7)] ### forest plot of the risk ratios dd <- c(0,diff(dat2$study)) dd[dd > 0] <- 1 rows <- (1:nrow(dat2)) + cumsum(dd) rows <- 1 + max(rows) - rows slabs <- mapply(function(x,y,z) as.expression(bquote(.(x)^.(y)~.(z))), dat2$author, dat2$ref, dat2$year) with(dat2, forest(yi, vi, header=TRUE, slab=slabs, xlim=c(-7,5.5), fonts="mono", cex=0.8, psize=1, pch=19, efac=0, rows=rows, ylim=c(0,max(rows)+3), yaxs="i", atransf=exp, at=log(c(0.05,0.1,0.2,0.5,1,2,5,10,20)), ilab=comp, ilab.xpos=-4, ilab.pos=4)) text(-4.4, max(rows)+2, "Comparison", font=2, cex=0.8, pos=4) ### within-study mean center the BMI variable dat$bmicent <- with(dat, bmi - ave(bmi, study)) ### compute the proportion of preeclampsia cases and corresponding sampling variances dat <- escalc(measure="PR", xi=cases, ni=total, data=dat) ### convert the proportions to percentages (and convert the variances accordingly) dat$yi <- dat$yi*100 dat$vi <- dat$vi*100^2 dat[1:10, -c(2:3)] ### fit multilevel meta-regression model to examine the relationship between the ### (centered) BMI variable and the risk of preeclampsia res <- rma.mv(yi, vi, mods = ~ bmicent, random = ~ 1 | study/grp, data=dat) res ### draw scatterplot with regression line res$slab <- dat$ref regplot(res, xlab=expression("Within-Study Mean Centered BMI"~(kg/m^2)), ylab="Preeclampsia Prevalence (%)", las=1, bty="l", at=seq(0,18,by=2), olim=c(0,100), psize=2, bg="gray90", label=TRUE, offset=0, labsize=0.6) ### fit model using a random slope for bmicent res <- rma.mv(yi, vi, mods = ~ bmicent, random = ~ bmicent | study, struct="GEN", data=dat) res ### load rms package library(rms) ### fit restricted cubic spline model res <- rma.mv(yi, vi, mods = ~ rcs(bmicent, 4), random = ~ 1 | study/grp, data=dat) res ### get knot positions knots <- attr(rcs(model.matrix(res)[,2], 4), "parms") ### computed predicted values based on the model xs <- seq(-10, 10, length=1000) sav <- predict(res, newmods=rcspline.eval(xs, knots, inclx=TRUE)) ### draw scatterplot with regression line based on the model tmp <- regplot(res, mod=2, pred=sav, xvals=xs, xlab=expression("Within-Study Mean Centered BMI"~(kg/m^2)), ylab="Preeclampsia Prevalence (%)", las=1, bty="l", at=seq(0,18,by=2), olim=c(0,100), psize=2, bg="gray90", label=TRUE, offset=0, labsize=0.6) abline(v=knots, lty="dotted") points(tmp) ## End(Not run)
Results from 26 trials examining the effectiveness of beta-blockers and sclerotherapy for the prevention of first bleeding in patients with cirrhosis
dat.pagliaro1992
dat.pagliaro1992
The data frame contains the following columns:
study | numeric |
study id |
trt | character |
either beta-blockers, sclerotherapy, or control |
xi | numeric |
number of patients with first bleeding |
ni | numeric |
number of patients treated |
The dataset includes the results from 26 randomized controlled trials examining the effectiveness of nonsurgical treatments for the prevention of first bleeding in patients with cirrhosis. Patients were either treated with beta-blockers, endoscopic sclerotherapy, or with a nonactive treatment (control). Two trials included all three treatment conditions, 7 trials compared beta-blockers against control, and 17 trials compared sclerotherapy against control. The dataset has been used in various papers to illustrate methods for conducting a network meta-analysis / mixed treatment comparison.
medicine, odds ratios, Mantel-Haenszel method, network meta-analysis
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Pagliaro, L., D'Amico, G., Sörensen, T. I. A., Lebrec, D., Burroughs, A. K., Morabito, A., Tiné, F., Politi, F., & Traina, M. (1992). Prevention of first bleeding in cirrhosis: A meta-analysis of randomized trials of nonsurgical treatment. Annals of Internal Medicine, 117(1), 59–70. https://doi.org/10.7326/0003-4819-117-1-59
### copy data into 'dat' and examine data dat <- dat.pagliaro1992 dat ## Not run: ### load metafor package library(metafor) ### restructure dataset to a contrast-based format dat.c <- to.wide(dat, study="study", grp="trt", grpvars=3:4) dat.c ### Mantel-Haenszel results for beta-blockers and sclerotherapy versus control, respectively rma.mh(measure="OR", ai=xi.1, n1i=ni.1, ci=xi.2, n2i=ni.2, data=dat.c, subset=(trt.1=="beta-blockers"), digits=2) rma.mh(measure="OR", ai=xi.1, n1i=ni.1, ci=xi.2, n2i=ni.2, data=dat.c, subset=(trt.1=="sclerotherapy"), digits=2) ### calculate log odds for each study arm dat <- escalc(measure="PLO", xi=xi, ni=ni, data=dat) dat ### turn treatment variable into factor and set reference level dat$trt <- relevel(factor(dat$trt), ref="control") ### add a space before each level (this makes the output a bit more legible) levels(dat$trt) <- paste0(" ", levels(dat$trt)) ### network meta-analysis using an arm-based random-effects model with fixed study effects ### (by setting rho=1/2, tau^2 reflects the amount of heterogeneity for all treatment comparisons) res <- rma.mv(yi, vi, mods = ~ 0 + factor(study) + trt, random = ~ trt | study, rho=1/2, data=dat) res ### average odds ratio comparing beta-blockers and sclerotherapy versus control, respectively predict(res, newmods=c(rep(0,26), 1, 0), transf=exp, digits=2) predict(res, newmods=c(rep(0,26), 0, 1), transf=exp, digits=2) ### average odds ratio comparing beta-blockers versus sclerotherapy predict(res, newmods=c(rep(0,26), 1, -1), transf=exp, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.pagliaro1992 dat ## Not run: ### load metafor package library(metafor) ### restructure dataset to a contrast-based format dat.c <- to.wide(dat, study="study", grp="trt", grpvars=3:4) dat.c ### Mantel-Haenszel results for beta-blockers and sclerotherapy versus control, respectively rma.mh(measure="OR", ai=xi.1, n1i=ni.1, ci=xi.2, n2i=ni.2, data=dat.c, subset=(trt.1=="beta-blockers"), digits=2) rma.mh(measure="OR", ai=xi.1, n1i=ni.1, ci=xi.2, n2i=ni.2, data=dat.c, subset=(trt.1=="sclerotherapy"), digits=2) ### calculate log odds for each study arm dat <- escalc(measure="PLO", xi=xi, ni=ni, data=dat) dat ### turn treatment variable into factor and set reference level dat$trt <- relevel(factor(dat$trt), ref="control") ### add a space before each level (this makes the output a bit more legible) levels(dat$trt) <- paste0(" ", levels(dat$trt)) ### network meta-analysis using an arm-based random-effects model with fixed study effects ### (by setting rho=1/2, tau^2 reflects the amount of heterogeneity for all treatment comparisons) res <- rma.mv(yi, vi, mods = ~ 0 + factor(study) + trt, random = ~ trt | study, rho=1/2, data=dat) res ### average odds ratio comparing beta-blockers and sclerotherapy versus control, respectively predict(res, newmods=c(rep(0,26), 1, 0), transf=exp, digits=2) predict(res, newmods=c(rep(0,26), 0, 1), transf=exp, digits=2) ### average odds ratio comparing beta-blockers versus sclerotherapy predict(res, newmods=c(rep(0,26), 1, -1), transf=exp, digits=2) ## End(Not run)
Results from studies examining mortality risk in patients with nonmetastatic head and neck squamous-cell carcinoma receiving either locoregional treatment plus chemotherapy versus locoregional treatment alone.
dat.pignon2000
dat.pignon2000
The data frame contains the following columns:
id | numeric |
study id number |
trial | character |
trial abbreviation |
OmE | numeric |
observed minus expected number of deaths in the locoregional treatment plus chemotherapy group |
V | numeric |
corresponding variance |
grp | numeric |
timing of chemotherapy: 1 = adjuvant, 2 = neoadjuvant, 3 = concomitant |
The purpose of this meta-analysis was to examine the mortality risk in patients with nonmetastatic head and neck squamous-cell carcinoma receiving either locoregional treatment plus chemotherapy versus locoregional treatment alone. For 65 trials, the dataset provides the observed minus expected number of deaths and corresponding variances in the locoregional treatment plus chemotherapy group. Based on these values, we can estimate the log hazard ratios with OmE/V
and the corresponding sampling variance with 1/V
.
The trials were also divided according to the timing of the chomotherapy: (1) adjuvant, after the locoregional treatment, (2) neoadjuvant, before the locoregional treatment, and (3) concomitant, chemotherapy given concomitantly or alternating with radiotherapy.
medicine, oncology, hazard ratios
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Pignon, J. P., Bourhis, J., Domenge, C., & Designe, L. (2000). Chemotherapy added to locoregional treatment for head and neck squamous-cell carcinoma: Three meta-analyses of updated individual data. Lancet, 355(9208), 949–955. https://doi.org/10.1016/S0140-6736(00)90011-4
### copy data into 'dat' and examine data dat <- dat.pignon2000 head(dat) ## Not run: ### load metafor package library(metafor) ### calculate log hazard ratios and sampling variances dat$yi <- with(dat, OmE/V) dat$vi <- with(dat, 1/V) head(dat) ### meta-analysis based on all 65 trials res <- rma(yi, vi, data=dat, method="EE", digits=2) res predict(res, transf=exp) ### only adjuvant trials res <- rma(yi, vi, data=dat, method="EE", subset=grp==1, digits=2) res predict(res, transf=exp) ### only neoadjuvant trials res <- rma(yi, vi, data=dat, method="EE", subset=grp==2, digits=2) res predict(res, transf=exp) ### only concomitant trials res <- rma(yi, vi, data=dat, method="EE", subset=grp==3, digits=2) res predict(res, transf=exp) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.pignon2000 head(dat) ## Not run: ### load metafor package library(metafor) ### calculate log hazard ratios and sampling variances dat$yi <- with(dat, OmE/V) dat$vi <- with(dat, 1/V) head(dat) ### meta-analysis based on all 65 trials res <- rma(yi, vi, data=dat, method="EE", digits=2) res predict(res, transf=exp) ### only adjuvant trials res <- rma(yi, vi, data=dat, method="EE", subset=grp==1, digits=2) res predict(res, transf=exp) ### only neoadjuvant trials res <- rma(yi, vi, data=dat, method="EE", subset=grp==2, digits=2) res predict(res, transf=exp) ### only concomitant trials res <- rma(yi, vi, data=dat, method="EE", subset=grp==3, digits=2) res predict(res, transf=exp) ## End(Not run)
Results from 14 studies on the effectiveness of hyperdynamic therapy for treating cerebral vasospasm.
dat.pritz1997
dat.pritz1997
The data frame contains the following columns:
study | numeric |
study number |
authors | character |
study authors |
xi | numeric |
number of patients that improved with hyperdynamic therapy |
ni | numeric |
total number of patients treated |
As described in Zhou et al. (1999), "hyperdynamic therapy refers to induced hypertension and hypervolaemia (volume expansion) to treat ischaemic symptoms due to vasospasm, and the success of this therapy is defined as clinical improvement in terms of neurologic deficits." For each study that was included in the meta-analysis, the dataset includes information on the number of patients that improved under this form of therapy and the total number of patients that were treated. The goal of the meta-analysis is to estimate the true (average) success rate of hyperdynamic therapy.
medicine, single-arm studies, proportions
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Zhou, X.-H., Brizendine, E. J., & Pritz, M. B. (1999). Methods for combining rates from several studies. Statistics in Medicine, 18(5), 557–566. https://doi.org/10.1002/(SICI)1097-0258(19990315)18:5<557::AID-SIM53>3.0.CO;2-F
Pritz M. B., Zhou, X.-H., & Brizendine, E. J. (1996). Hyperdynamic therapy for cerebral vasospasm: A meta-analysis of 14 studies. Journal of Neurovascular Disease, 1, 6–8.
Pritz, M. B. (1997). Treatment of cerebral vasospasm due to aneurysmal subarachnoid hemorrhage: Past, present, and future of hyperdynamic therapy. Neurosurgery Quarterly, 7(4), 273–285.
### copy data into 'dat' and examine data dat <- dat.pritz1997 dat ## Not run: ### load metafor package library(metafor) ### computation of "weighted average" in Zhou et al. (1999), Table IV dat <- escalc(measure="PR", xi=xi, ni=ni, data=dat, add=0) theta.hat <- sum(dat$ni * dat$yi) / sum(dat$ni) se.theta.hat <- sqrt(sum(dat$ni^2 * dat$vi) / sum(dat$ni)^2) ci.lb <- theta.hat - 1.96 * se.theta.hat ci.ub <- theta.hat + 1.96 * se.theta.hat round(c(estimate = theta.hat, se = se.theta.hat, ci.lb = ci.lb, ci.ub = ci.ub), 4) ### this is identical to an equal-effects model with sample size weights rma(yi, vi, weights=ni, method="EE", data=dat) ### compute sampling variances under the assumption of homogeneity dat <- escalc(measure="PR", xi=xi, ni=ni, data=dat, add=0, vtype="AV") dat ### fit equal-effects model (same estimate, but SE is slightly different) rma(yi, vi, data=dat, method="EE") ### under the assumption of homogeneity, the sum of independent binomial ### counts also follows a binomial distribution; this approach yields the same ### estimate and SE as above agg <- escalc(measure="PR", xi=sum(dat$xi), ni=sum(dat$ni)) summary(agg) ### could also compute an 'exact' CI based on the Clopper-Pearson method binom.test(sum(dat$xi), sum(dat$ni)) ### logistic regression model res <- rma.glmm(measure="PLO", xi=xi, ni=ni, data=dat, method="EE") res predict(res, transf=transf.ilogit) ### the results above suggest that the true proportions may be heterogeneous ### random-effects model with raw proportions dat <- escalc(measure="PR", xi=xi, ni=ni, data=dat) res <- rma(yi, vi, data=dat) predict(res) ### random-effects model with logit transformed proportions dat <- escalc(measure="PLO", xi=xi, ni=ni, data=dat) res <- rma(yi, vi, data=dat) predict(res, transf=transf.ilogit) ### mixed-effects logistic regression model res <- rma.glmm(measure="PLO", xi=xi, ni=ni, data=dat) predict(res, transf=transf.ilogit) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.pritz1997 dat ## Not run: ### load metafor package library(metafor) ### computation of "weighted average" in Zhou et al. (1999), Table IV dat <- escalc(measure="PR", xi=xi, ni=ni, data=dat, add=0) theta.hat <- sum(dat$ni * dat$yi) / sum(dat$ni) se.theta.hat <- sqrt(sum(dat$ni^2 * dat$vi) / sum(dat$ni)^2) ci.lb <- theta.hat - 1.96 * se.theta.hat ci.ub <- theta.hat + 1.96 * se.theta.hat round(c(estimate = theta.hat, se = se.theta.hat, ci.lb = ci.lb, ci.ub = ci.ub), 4) ### this is identical to an equal-effects model with sample size weights rma(yi, vi, weights=ni, method="EE", data=dat) ### compute sampling variances under the assumption of homogeneity dat <- escalc(measure="PR", xi=xi, ni=ni, data=dat, add=0, vtype="AV") dat ### fit equal-effects model (same estimate, but SE is slightly different) rma(yi, vi, data=dat, method="EE") ### under the assumption of homogeneity, the sum of independent binomial ### counts also follows a binomial distribution; this approach yields the same ### estimate and SE as above agg <- escalc(measure="PR", xi=sum(dat$xi), ni=sum(dat$ni)) summary(agg) ### could also compute an 'exact' CI based on the Clopper-Pearson method binom.test(sum(dat$xi), sum(dat$ni)) ### logistic regression model res <- rma.glmm(measure="PLO", xi=xi, ni=ni, data=dat, method="EE") res predict(res, transf=transf.ilogit) ### the results above suggest that the true proportions may be heterogeneous ### random-effects model with raw proportions dat <- escalc(measure="PR", xi=xi, ni=ni, data=dat) res <- rma(yi, vi, data=dat) predict(res) ### random-effects model with logit transformed proportions dat <- escalc(measure="PLO", xi=xi, ni=ni, data=dat) res <- rma(yi, vi, data=dat) predict(res, transf=transf.ilogit) ### mixed-effects logistic regression model res <- rma.glmm(measure="PLO", xi=xi, ni=ni, data=dat) predict(res, transf=transf.ilogit) ## End(Not run)
Results from 19 studies examining how teachers' expectations about their pupils can influence actual IQ levels.
dat.raudenbush1985
dat.raudenbush1985
The data frame contains the following columns:
study | numeric |
study number |
author | character |
study author(s) |
year | numeric |
publication year |
weeks | numeric |
weeks of contact prior to expectancy induction |
setting | character |
whether tests were group or individually administered |
tester | character |
whether test administrator was aware or blind |
n1i | numeric |
sample size of experimental group |
n2i | numeric |
sample size of control group |
yi | numeric |
standardized mean difference |
vi | numeric |
corresponding sampling variance |
In the so-called ‘Pygmalion study’ (Rosenthal & Jacobson, 1968), “all of the predominantly poor children in the so-called Oak elementary school were administered a test pretentiously labeled the ‘Harvard Test of Inflected Acquisition.’ After explaining that this newly designed instrument had identified those children most likely to show dramatic intellectual growth during the coming year, the experimenters gave the names of these ‘bloomers’ to the teachers. In truth, the test was a traditional IQ test and the ‘bloomers’ were a randomly selected 20% of the student population. After retesting the children 8 months later, the experimenters reported that those predicted to bloom had in fact gained significantly more in total IQ (nearly 4 points) and reasoning IQ (7 points) than the control group children. Further, at the end of the study, the teachers rated the experimental children as intellectually more curious, happier, better adjusted, and less in need of approval than their control group peers” (Raudenbush, 1984).
In the following years, a series of studies were conducted attempting to replicate this rather controversial finding. However, the great majority of those studies were unable to demonstrate a statistically significant difference between the two experimental groups in terms of IQ scores. Raudenbush (1984) conducted a meta-analysis based on 19 such studies to further examine the evidence for the existence of the ‘Pygmalion effect’. The dataset includes the results from these studies.
The outcome measure used for the meta-analysis was the standardized mean difference (yi
), with positive values indicating that the supposed ‘bloomers’ had, on average, higher IQ scores than those in the control group. The weeks
variable indicates the number of weeks of prior contact between teachers and students before the expectancy induction. Testing was done either in a group setting or individually, which is indicated by the setting
variable. Finally, the tester
variable indicates whether the test administrators were either aware or blind to the researcher-provided designations of the children's intellectual potential.
The data in this dataset were obtained from Raudenbush and Bryk (1985) with information on the setting
and tester
variables extracted from Raudenbush (1984).
education, standardized mean differences, meta-regression
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Raudenbush, S. W. (1984). Magnitude of teacher expectancy effects on pupil IQ as a function of the credibility of expectancy induction: A synthesis of findings from 18 experiments. Journal of Educational Psychology, 76(1), 85–97. https://doi.org/10.1037/0022-0663.76.1.85
Raudenbush, S. W., & Bryk, A. S. (1985). Empirical Bayes meta-analysis. Journal of Educational Statistics, 10(2), 75–98. https://doi.org/10.3102/10769986010002075
### copy data into 'dat' and examine data dat <- dat.raudenbush1985 dat ## Not run: ### load metafor package library(metafor) ### random-effects model res <- rma(yi, vi, data = dat) res ### create weeks variable where values larger than 3 are set to 3 dat$weeks.c <- ifelse(dat$weeks > 3, 3, dat$weeks) ### mixed-effects model with weeks.c variable as moderator res <- rma(yi, vi, mods = ~ weeks.c, data = dat, digits = 3) res ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.raudenbush1985 dat ## Not run: ### load metafor package library(metafor) ### random-effects model res <- rma(yi, vi, data = dat) res ### create weeks variable where values larger than 3 are set to 3 dat$weeks.c <- ifelse(dat$weeks > 3, 3, dat$weeks) ### mixed-effects model with weeks.c variable as moderator res <- rma(yi, vi, mods = ~ weeks.c, data = dat, digits = 3) res ## End(Not run)
Results from 81 studies examining overall and disease-free survival in neuroblastoma patients with amplified versus normal MYC-N protein levels.
dat.riley2003
dat.riley2003
The data frame contains the following columns:
study | numeric |
study number |
yi | numeric |
log hazard ratio of the outcome in those with amplified versus normal MYC-N protein levels |
vi | numeric |
sampling variance of the log hazard ratio |
sei | numeric |
standard error of the log hazard ratio |
outcome | character |
outcome (OS = overall survival; DFS = disease-free survival) |
The meta-analysis by Riley et al. (2003) examined a variety of prognostic markers for overall and disease-free survival in patients with neuroblastoma. One of the markers examined was amplified levels of the MYC-N protein, with is associated with poorer outcomes.
The dataset given here was extracted from Riley (2011) and has been used in several other publications (e.g., Riley et al., 2004, 2007). The dataset provides the (log) hazard ratios (and corresponding standard errors) with respect to these two outcomes in 81 studies, with positive values indicating a greater risk of death (for OS) or disease recurrence/death (for DFS) for patients with high MYC-N levels compared to those with normal/low levels. Note that information on both outcomes could only be extracted from 17 studies (39 studies only provided sufficient information to extract the OS estimate, while 25 studies only allowed for extraction of the DFS estimate).
medicine, oncology, hazard ratios
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Riley, R. D., Sutton, A. J., Abrams, K. R., & Lambert, P. C. (2004). Sensitivity analyses allowed more appropriate and reliable meta-analysis conclusions for multiple outcomes when missing data was present. Journal of Clinical Epidemiology, 57(9), 911–924. https://doi.org/10.1016/j.jclinepi.2004.01.018
Riley, R. D., Abrams, K. R., Lambert, P. C., Sutton, A. J., & Thompson, J. R. (2007). An evaluation of bivariate random-effects meta-analysis for the joint synthesis of two correlated outcomes. Statistics in Medicine, 26(1), 78–97. https://doi.org/10.1002/sim.2524
Riley, R. D. (2011). Erratum: An evaluation of bivariate random-effects meta-analysis for the joint synthesis of two correlated outcomes. Statistics in Medicine, 30(4), 400. https://doi.org/10.1002/sim.4100
Riley, R. D., Burchill, S. A., Abrams, K. R., Heney, D., Lambert, P. C., Jones, D. R., Sutton, A. J., Young, B., Wailoo, A. J., & Lewis, I. J. (2003). A systematic review and evaluation of the use of tumour markers in paediatric oncology: Ewing's sarcoma and neuroblastoma. Health Technology Assessment, 7(5), 1–162. https://doi.org/10.3310/hta7050
### copy data into 'dat' and examine data dat <- dat.riley2003 dat ## Not run: ### load metafor package library(metafor) ### random-effects model analysis for outcome DFS res <- rma(yi, sei=sei, data=dat, subset=(outcome == "DFS"), method="DL") res predict(res, transf=exp, digits=2) ### random-effects model analysis for outcome OS res <- rma(yi, sei=sei, data=dat, subset=(outcome == "OS"), method="DL") res predict(res, transf=exp, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.riley2003 dat ## Not run: ### load metafor package library(metafor) ### random-effects model analysis for outcome DFS res <- rma(yi, sei=sei, data=dat, subset=(outcome == "DFS"), method="DL") res predict(res, transf=exp, digits=2) ### random-effects model analysis for outcome OS res <- rma(yi, sei=sei, data=dat, subset=(outcome == "OS"), method="DL") res predict(res, transf=exp, digits=2) ## End(Not run)
12 studies investigating the occurrence of dose limiting toxicities (DLTs) at different doses of a combination therapy of Irinotecan and S-1.
dat.roever2022
dat.roever2022
The data frame contains the following columns:
study | character |
study label |
year | integer |
publication year |
dose | numeric |
dose ( ) |
events | integer |
number of DLTs |
total | integer |
number of patients exposed |
A combination therapy of Irinotecan (a topoisomerase 1 inhibitor) and S-1 (a combination of three pharmacological compounds, namely, tegafur, gimeracil, and oteracil potassium) was tested in advanced colorectal and gastric cancer. This dataset contains data from twelve studies investigating this therapy in a Japanese population; it contains the doses investigated, the numbers of patients treated, and the number of dose-limiting toxicities (DLTs) observed. In general, each study investigated several doses according to some dose-escalation scheme.
medicine, oncology, dose-response models
Christian Roever, [email protected]
Ursino, M., Roever, C., Zohar, S., & Friede T. (2021). Random-effects meta-analysis of phase I dose-finding studies using stochastic process priors. The Annals of Applied Statistics, 15(1), 174–193. https://doi.org/10.1214/20-AOAS1390
Roever, C., Ursino, M., Friede, T., & Zohar, S. (2022). A straighforward meta-analysis approach for oncology phase I dose-finding studies. Statistics in Medicine, 41(20), 3915–3940. https://doi.org/10.1002/sim.9484
European Medicines Agency (EMA) (2021). Onivyde pegylated liposomal (irinotecan hydrochloride trihydrate) EPAR summary. https://www.ema.europa.eu/en/medicines/human/EPAR/onivyde-pegylated-liposomal
European Medicines Agency (EMA) (2022). Teysuno (tegafur/gimeracil/oteracil) EPAR summary. https://www.ema.europa.eu/en/medicines/human/EPAR/teysuno
Yamada, Y., Yasui, H., Goto, A., et al. (2003). Phase I study of irinotecan and S-1 combination therapy in patients with metastatic gastric cancer. International Journal of Clinical Oncology, 8(6), 374–380. https://doi.org/10.1007/s10147-003-0359-z
Takiuchi, H., Narahara, H., Tsujinaka, T., et al. (2005). Phase I study of S-1 combined with irinotecan (CPT-11) in patients with advanced gastric cancer (OGSG 0002). Japanese Journal of Clinical Oncology, 35(9), 520–525. https://doi.org/10.1093/jjco/hyi148
Inokuchi, M., Yamashita, T., Yamada, H., et al. (2006). Phase I/II study of S-1 combined with irinotecan for metastatic advanced gastric cancer. British Journal of Cancer, 94(8), 11130. https://doi.org/10.1038/sj.bjc.6603072
Nakafusa, Y., Tanaka, M., Ohtsuka, T., et al. (2008). Phase I/II study of combination therapy with S-1 and CPT-11 for metastatic colorectal cancer. Molecular Medicine Reports, 1(6), 925–930. https://doi.org/10.3892/mmr_00000051
Ishimoto, O., Ishida, T., Honda, Y., Munakata, M., & Sugawara, S. (2009). Phase I study of daily S-1 combined with weekly irinotecan in patients with advanced non-small cell lung cancer. International Journal of Clinical Oncology, 14(1), 43–47. https://doi.org/10.1007/s10147-008-0796-9
Ogata, Y., Sasatomi, T., Akagi, Y., Ishibashi, N., Mori, S., & Shirouzu, K. (2009). Dosage escalation study of S-1 and irinotecan in metronomic chemotherapy against advanced colorectal cancer. The Kurume Medical Journal, 56(1+2), 1–7. https://doi.org/10.2739/kurumemedj.56.1
Shiozawa, M., Sugano, N., Tsuchida, K., Morinaga, S., Akaike, M., & Sugimasa, Y. (2009). A phase I study of combination therapy with S-1 and irinotecan (CPT-11) in patients with advanced colorectal cancer. Journal of Cancer Research and Clinical Oncology, 135(3), 365–370. https://doi.org/10.1007/s00432-008-0480-5
Yoshioka, T., Kato, S., Gamoh, M., et al. (2009). Phase I/II study of sequential therapy with irinotecan and S-1 for metastatic colorectal cancer. British Journal of Cancer, 101, 1972–1977. https://doi.org/10.1038/sj.bjc.6605432
Komatsu, Y., Yuki, S., Fuse, N., et al. (2010). Phase 1/2 clinical study of irinotecan and oral S-1 (IRIS) in patients with advanced gastric cancer. Advances in Therapy, 27(7), 483–492. https://doi.org/10.1007/s12325-010-0037-2
Kusaba, H., Esaki, T., Futami, K., et al. (2010). Phase I/II study of a 3-week cycle of irinotecan and S-1 in patients with advanced colorectal cancer. Cancer Science, 101(12), 2591–2595. https://doi.org/10.1111/j.1349-7006.2010.01728.x
Yoda, S., Soejima, K., Yasuda, H., et al. (2011). A phase I study of S-1 and irinotecan combination therapy in previously treated advanced non-small cell lung cancer patients. Cancer Chemotherapy and Pharmacology, 67(3), 717–722. https://doi.org/10.1007/s00280-010-1539-y
Goya, H., Kuraishi, H., Koyama, S., et al. (2012). Phase I/II study of S-1 combined with biweekly irinotecan chemotherapy in previously treated advanced non-small cell lung cancer. Cancer Chemotherapy and Pharmacology, 70(5), 691–697. https://doi.org/10.1007/s00280-012-1957-0
# show (some) data head(dat.roever2022, n=10) ## Not run: # illustrate data plot(NA, xlim=range(dat.roever2022$dose), ylim=0:1, xlab="dose (mg / m²)", ylab="proportion", main="dat.roever2022 (Irinotecan / S-1 data)") studylab <- unique(dat.roever2022$study) colvec <- rainbow(length(studylab)) for (i in 1:length(studylab)) { idx <- (dat.roever2022$study == studylab[i]) lines(dat.roever2022[idx,"dose"], dat.roever2022[idx,"events"] / dat.roever2022[idx,"total"], col=colvec[i], type="b") } legend("topleft", studylab, col=colvec, pch=15) ## End(Not run)
# show (some) data head(dat.roever2022, n=10) ## Not run: # illustrate data plot(NA, xlim=range(dat.roever2022$dose), ylim=0:1, xlab="dose (mg / m²)", ylab="proportion", main="dat.roever2022 (Irinotecan / S-1 data)") studylab <- unique(dat.roever2022$study) colvec <- rainbow(length(studylab)) for (i in 1:length(studylab)) { idx <- (dat.roever2022$study == studylab[i]) lines(dat.roever2022[idx,"dose"], dat.roever2022[idx,"events"] / dat.roever2022[idx,"total"], col=colvec[i], type="b") } legend("topleft", studylab, col=colvec, pch=15) ## End(Not run)
Results from 26 trials examining the effectiveness of glucose-lowering agents in patients with type 2 diabetes
dat.senn2013
dat.senn2013
The data frame contains the following columns:
study | character |
(first) author and year of study |
ni | numeric |
sample size of the study arm |
treatment | character |
treatment given |
comment | character |
whether figures given are based on raw values at outcome or on change from baseline |
mi | numeric |
raw mean or mean change |
sdi | numeric |
standard deviation |
The dataset includes the results from 26 randomized controlled trials examining the effectiveness of adding various oral glucose-lowering agents to a baseline sulfonylurea therapy in patients with type 2 diabetes. The outcome measured in the studies was either the mean HbA1c level at follow-up or the mean change in HbA1c level from baseline to follow-up. A total of 10 different treatment types were examined in these studies: acarbose, benfluorex, metformin, miglitol, pioglitazone, placebo, rosiglitazone, sitagliptin, sulfonylurea alone, and vildagliptin. One study included three treatment arms (Willms, 1999), while the rest of the studies included two treatment arms (hence, the dataset includes the results from 53 treatment arms).
The data can be used for a network meta-analysis, either using an arm-based or a contrast-based model. See ‘Examples’ below.
medicine, raw mean differences, network meta-analysis
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Senn, S., Gavini, F., Magrez, D., & Scheen, A. (2013). Issues in performing a network meta-analysis. Statistical Methods in Medical Research, 22(2), 169–189. https://doi.org/10.1177/0962280211432220
Law, M., Jackson, D., Turner, R., Rhodes, K., & Viechtbauer, W. (2016). Two new methods to fit models for network meta-analysis with random inconsistency effects. BMC Medical Research Methodology, 16, 87. https://doi.org/10.1186/s12874-016-0184-5
Rücker, G., & Schwarzer, G. (2015). Ranking treatments in frequentist network meta-analysis works without resampling methods. BMC Medical Research Methodology, 15, 58. https://doi.org/10.1186/s12874-015-0060-8
### copy data into 'dat' and examine data dat <- dat.senn2013 dat ## Not run: ### load metafor package library(metafor) ### create network graph ('igraph' package must be installed) library(igraph, warn.conflicts=FALSE) pairs <- data.frame(do.call(rbind, sapply(split(dat$treatment, dat$study), function(x) t(combn(x,2)))), stringsAsFactors=FALSE) pairs$X1 <- factor(pairs$X1, levels=sort(unique(dat$treatment))) pairs$X2 <- factor(pairs$X2, levels=sort(unique(dat$treatment))) tab <- table(pairs[,1], pairs[,2]) tab # adjacency matrix g <- graph_from_adjacency_matrix(tab, mode = "plus", weighted=TRUE, diag=FALSE) plot(g, edge.curved=FALSE, edge.width=E(g)$weight, layout=layout_as_star(g, center="placebo"), vertex.size=45, vertex.color="lightgray", vertex.label.color="black", vertex.label.font=2) ### table of studies versus treatments examined print(addmargins(table(dat$study, dat$treatment)), zero.print="") ### table of frequencies with which treatment pairs were studied print(as.table(crossprod(table(dat$study, dat$treatment))), zero.print="") ### add means and sampling variances of the means to the dataset dat <- escalc(measure="MN", mi=mi, sdi=sdi, ni=ni, data=dat) ### turn treatment variable into factor and set reference level dat$treatment <- relevel(factor(dat$treatment), ref="placebo") ### add a space before each level (this makes the output a bit more legible) levels(dat$treatment) <- paste0(" ", levels(dat$treatment)) ### network meta-analysis using an arm-based fixed-effects model with fixed study effects res.fe <- rma.mv(yi, vi, mods = ~ 0 + study + treatment, data=dat, slab=paste0(study, treatment)) res.fe ### test if treatment factor as a whole is significant anova(res.fe, btt="treatment") ### forest plot of the contrast estimates (treatments versus placebos) forest(tail(coef(res.fe), 9), tail(diag(vcov(res.fe)), 9), slab=levels(dat$treatment)[-1], xlim=c(-2.5, 1.5), alim=c(-1.5, 0.5), psize=1, xlab="Estimate", header="Treatment", top=2) ### weight matrix for the estimation of the fixed effects (leaving out the study effects) w <- t(tail(vcov(res.fe) %*% t(model.matrix(res.fe)) %*% weights(res.fe, type="matrix"), 9)) rownames(w) <- res.fe$slab ### create shade plot for the diabetes network with placebo as the reference treatment ### negative values in blue shades, positive values in red shades cols <- colorRampPalette(c("blue", "gray95", "red"))(9) heatmap(w, Rowv=NA, Colv=NA, scale="none", margins=c(6,11), col=cols, cexRow=.7, cexCol=1, labCol=levels(dat$treatment)[-1]) ### network meta-analysis using an arm-based random-effects model with fixed study effects ### by setting rho=1/2, tau^2 reflects the amount of heterogeneity for all treatment comparisons res.re <- rma.mv(yi, vi, mods = ~ 0 + study + treatment, random = ~ treatment | study, rho=1/2, data=dat, slab=paste0(study, treatment)) res.re ### test if treatment factor as a whole is significant anova(res.re, btt="treatment") ### forest plot of the contrast estimates (treatments versus placebos) forest(tail(coef(res.re), 9), tail(diag(vcov(res.re)), 9), slab=levels(dat$treatment)[-1], xlim=c(-2.5, 1.5), alim=c(-1.5, 0.5), psize=1, xlab="Estimate", header="Treatment", top=2) ### compute the contribution of each study to the overall Q-test value qi <- sort(by((resid(res.fe) / sqrt(dat$vi))^2, dat$study, sum)) ### check that the values add up sum(qi) res.fe$QE ### plot the values s <- length(qi) par(mar=c(5,10,2,1)) plot(qi, 1:s, pch=19, xaxt="n", yaxt="n", xlim=c(0,40), xlab="Chi-Square Contribution", ylab="") axis(side=1) axis(side=2, at=1:s, labels=names(qi), las=1, tcl=0) segments(rep(0,s), 1:s, qi, 1:s) ############################################################################ ### restructure dataset to a contrast-based format dat <- dat.senn2013[c(1,4:2,5:6)] # reorder variables first dat <- to.wide(dat, study="study", grp="treatment", ref="placebo", grpvars=4:6) dat ### calculate mean difference and corresponding sampling variance for each treatment comparison dat <- escalc(measure="MD", m1i=mi.1, sd1i=sdi.1, n1i=ni.1, m2i=mi.2, sd2i=sdi.2, n2i=ni.2, data=dat) dat ### calculate the variance-covariance matrix of the mean differences for the multitreatment studies calc.v <- function(x) { v <- matrix(x$sdi.2[1]^2 / x$ni.2[1], nrow=nrow(x), ncol=nrow(x)) diag(v) <- x$vi v } V <- bldiag(lapply(split(dat, dat$study), calc.v)) ### add contrast matrix to dataset dat <- contrmat(dat, grp1="treatment.1", grp2="treatment.2") dat ### network meta-analysis using a contrast-based random-effects model ### by setting rho=1/2, tau^2 reflects the amount of heterogeneity for all treatment comparisons ### the treatment left out (placebo) becomes the reference level for the treatment comparisons res <- rma.mv(yi, V, mods = ~ 0 + acarbose + benfluorex + metformin + miglitol + pioglitazone + rosiglitazone + sitagliptin + sulfonylurea + vildagliptin, random = ~ comp | study, rho=1/2, data=dat) res ### forest plot of the contrast estimates (treatments versus placebos) forest(coef(res), diag(vcov(res)), slab=names(coef(res)), order="obs", xlim=c(-3.0, 2.5), alim=c(-1.5, 0.5), psize=1, xlab="Estimate", header="Treatment") ### estimate all pairwise differences between treatments contr <- data.frame(t(combn(names(coef(res)), 2))) contr <- contrmat(contr, "X1", "X2", last="vildagliptin") rownames(contr) <- paste(contr$X1, "-", contr$X2) contr <- as.matrix(contr[-c(1:2)]) sav <- predict(res, newmods=contr) sav[["slab"]] <- rownames(contr) sav ### fit random inconsistency effects model (see Law et al., 2016) inc <- rma.mv(yi, V, mods = ~ 0 + acarbose + benfluorex + metformin + miglitol + pioglitazone + rosiglitazone + sitagliptin + sulfonylurea + vildagliptin, random = list(~ comp | study, ~ comp | design), rho=1/2, phi=1/2, data=dat) inc ############################################################################ ### compute P-scores (see Rücker & Schwarzer, 2015) contr <- data.frame(t(combn(c(names(coef(res)),"placebo"), 2))) # add 'placebo' to contrast matrix contr <- contrmat(contr, "X1", "X2", last="placebo", append=FALSE) b <- c(coef(res),0) # add 0 for 'placebo' (the reference treatment) vb <- bldiag(vcov(res),0) # add 0 row/column for 'placebo' (the reference treatment) pvals <- apply(contr, 1, function(x) pnorm((x%*%b) / sqrt(t(x)%*%vb%*%x))) tab <- vec2mat(pvals, corr=FALSE) tab[upper.tri(tab)] <- t((1 - tab)[upper.tri(tab)]) rownames(tab) <- colnames(tab) <- colnames(contr) round(tab, 2) # like Table 2 in the article cbind(pscore=round(sort(apply(tab, 1, mean, na.rm=TRUE), decreasing=TRUE), 3)) # note: the values are slightly different from the ones given in Table 3 of Rücker and # Schwarzer (2015) since model 'res' above is fitted using REML estimation while the # results shown in the article are based on the 'netmeta' package, which uses a DL-type # estimator for the amount of heterogeneity by default ############################################################################ ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.senn2013 dat ## Not run: ### load metafor package library(metafor) ### create network graph ('igraph' package must be installed) library(igraph, warn.conflicts=FALSE) pairs <- data.frame(do.call(rbind, sapply(split(dat$treatment, dat$study), function(x) t(combn(x,2)))), stringsAsFactors=FALSE) pairs$X1 <- factor(pairs$X1, levels=sort(unique(dat$treatment))) pairs$X2 <- factor(pairs$X2, levels=sort(unique(dat$treatment))) tab <- table(pairs[,1], pairs[,2]) tab # adjacency matrix g <- graph_from_adjacency_matrix(tab, mode = "plus", weighted=TRUE, diag=FALSE) plot(g, edge.curved=FALSE, edge.width=E(g)$weight, layout=layout_as_star(g, center="placebo"), vertex.size=45, vertex.color="lightgray", vertex.label.color="black", vertex.label.font=2) ### table of studies versus treatments examined print(addmargins(table(dat$study, dat$treatment)), zero.print="") ### table of frequencies with which treatment pairs were studied print(as.table(crossprod(table(dat$study, dat$treatment))), zero.print="") ### add means and sampling variances of the means to the dataset dat <- escalc(measure="MN", mi=mi, sdi=sdi, ni=ni, data=dat) ### turn treatment variable into factor and set reference level dat$treatment <- relevel(factor(dat$treatment), ref="placebo") ### add a space before each level (this makes the output a bit more legible) levels(dat$treatment) <- paste0(" ", levels(dat$treatment)) ### network meta-analysis using an arm-based fixed-effects model with fixed study effects res.fe <- rma.mv(yi, vi, mods = ~ 0 + study + treatment, data=dat, slab=paste0(study, treatment)) res.fe ### test if treatment factor as a whole is significant anova(res.fe, btt="treatment") ### forest plot of the contrast estimates (treatments versus placebos) forest(tail(coef(res.fe), 9), tail(diag(vcov(res.fe)), 9), slab=levels(dat$treatment)[-1], xlim=c(-2.5, 1.5), alim=c(-1.5, 0.5), psize=1, xlab="Estimate", header="Treatment", top=2) ### weight matrix for the estimation of the fixed effects (leaving out the study effects) w <- t(tail(vcov(res.fe) %*% t(model.matrix(res.fe)) %*% weights(res.fe, type="matrix"), 9)) rownames(w) <- res.fe$slab ### create shade plot for the diabetes network with placebo as the reference treatment ### negative values in blue shades, positive values in red shades cols <- colorRampPalette(c("blue", "gray95", "red"))(9) heatmap(w, Rowv=NA, Colv=NA, scale="none", margins=c(6,11), col=cols, cexRow=.7, cexCol=1, labCol=levels(dat$treatment)[-1]) ### network meta-analysis using an arm-based random-effects model with fixed study effects ### by setting rho=1/2, tau^2 reflects the amount of heterogeneity for all treatment comparisons res.re <- rma.mv(yi, vi, mods = ~ 0 + study + treatment, random = ~ treatment | study, rho=1/2, data=dat, slab=paste0(study, treatment)) res.re ### test if treatment factor as a whole is significant anova(res.re, btt="treatment") ### forest plot of the contrast estimates (treatments versus placebos) forest(tail(coef(res.re), 9), tail(diag(vcov(res.re)), 9), slab=levels(dat$treatment)[-1], xlim=c(-2.5, 1.5), alim=c(-1.5, 0.5), psize=1, xlab="Estimate", header="Treatment", top=2) ### compute the contribution of each study to the overall Q-test value qi <- sort(by((resid(res.fe) / sqrt(dat$vi))^2, dat$study, sum)) ### check that the values add up sum(qi) res.fe$QE ### plot the values s <- length(qi) par(mar=c(5,10,2,1)) plot(qi, 1:s, pch=19, xaxt="n", yaxt="n", xlim=c(0,40), xlab="Chi-Square Contribution", ylab="") axis(side=1) axis(side=2, at=1:s, labels=names(qi), las=1, tcl=0) segments(rep(0,s), 1:s, qi, 1:s) ############################################################################ ### restructure dataset to a contrast-based format dat <- dat.senn2013[c(1,4:2,5:6)] # reorder variables first dat <- to.wide(dat, study="study", grp="treatment", ref="placebo", grpvars=4:6) dat ### calculate mean difference and corresponding sampling variance for each treatment comparison dat <- escalc(measure="MD", m1i=mi.1, sd1i=sdi.1, n1i=ni.1, m2i=mi.2, sd2i=sdi.2, n2i=ni.2, data=dat) dat ### calculate the variance-covariance matrix of the mean differences for the multitreatment studies calc.v <- function(x) { v <- matrix(x$sdi.2[1]^2 / x$ni.2[1], nrow=nrow(x), ncol=nrow(x)) diag(v) <- x$vi v } V <- bldiag(lapply(split(dat, dat$study), calc.v)) ### add contrast matrix to dataset dat <- contrmat(dat, grp1="treatment.1", grp2="treatment.2") dat ### network meta-analysis using a contrast-based random-effects model ### by setting rho=1/2, tau^2 reflects the amount of heterogeneity for all treatment comparisons ### the treatment left out (placebo) becomes the reference level for the treatment comparisons res <- rma.mv(yi, V, mods = ~ 0 + acarbose + benfluorex + metformin + miglitol + pioglitazone + rosiglitazone + sitagliptin + sulfonylurea + vildagliptin, random = ~ comp | study, rho=1/2, data=dat) res ### forest plot of the contrast estimates (treatments versus placebos) forest(coef(res), diag(vcov(res)), slab=names(coef(res)), order="obs", xlim=c(-3.0, 2.5), alim=c(-1.5, 0.5), psize=1, xlab="Estimate", header="Treatment") ### estimate all pairwise differences between treatments contr <- data.frame(t(combn(names(coef(res)), 2))) contr <- contrmat(contr, "X1", "X2", last="vildagliptin") rownames(contr) <- paste(contr$X1, "-", contr$X2) contr <- as.matrix(contr[-c(1:2)]) sav <- predict(res, newmods=contr) sav[["slab"]] <- rownames(contr) sav ### fit random inconsistency effects model (see Law et al., 2016) inc <- rma.mv(yi, V, mods = ~ 0 + acarbose + benfluorex + metformin + miglitol + pioglitazone + rosiglitazone + sitagliptin + sulfonylurea + vildagliptin, random = list(~ comp | study, ~ comp | design), rho=1/2, phi=1/2, data=dat) inc ############################################################################ ### compute P-scores (see Rücker & Schwarzer, 2015) contr <- data.frame(t(combn(c(names(coef(res)),"placebo"), 2))) # add 'placebo' to contrast matrix contr <- contrmat(contr, "X1", "X2", last="placebo", append=FALSE) b <- c(coef(res),0) # add 0 for 'placebo' (the reference treatment) vb <- bldiag(vcov(res),0) # add 0 row/column for 'placebo' (the reference treatment) pvals <- apply(contr, 1, function(x) pnorm((x%*%b) / sqrt(t(x)%*%vb%*%x))) tab <- vec2mat(pvals, corr=FALSE) tab[upper.tri(tab)] <- t((1 - tab)[upper.tri(tab)]) rownames(tab) <- colnames(tab) <- colnames(contr) round(tab, 2) # like Table 2 in the article cbind(pscore=round(sort(apply(tab, 1, mean, na.rm=TRUE), decreasing=TRUE), 3)) # note: the values are slightly different from the ones given in Table 3 of Rücker and # Schwarzer (2015) since model 'res' above is fitted using REML estimation while the # results shown in the article are based on the 'netmeta' package, which uses a DL-type # estimator for the amount of heterogeneity by default ############################################################################ ## End(Not run)
Results from 17 trials, 11 studies in children and 6 studies in adults, reporting the maximum fall in the forced expiratory volume in 1 second (FEV$_1$) over the course of follow-up, expressed as a percentage.
dat.spooner2002
dat.spooner2002
The data frame contains the following columns:
author | character |
first author |
year | character |
year of publication |
Ne | integer |
number of participants in nedocromil sodium group |
Me | numeric |
maximum fall in the FEV$_1$ (nedocromil sodium) |
Se | numeric |
standard deviation (nedocromil sodium) |
Nc | integer |
number of participants in placebo group |
Mc | numeric |
maximum fall in the FEV$_1$ (placebo) |
Sc | numeric |
standard deviation (placebo) |
agegroup | factor |
age group (children or adults) |
Spooner et al. (2002) conducted a Cochrane review comparing nedocromil sodium (experimental treatment) with placebo (control) for preventing exercise-induced bronchoconstriction. Primary outcome was the maximum fall in the forced expiratory volume in 1 second (FEV$_1$) over the course of follow-up, expressed as a percentage. This outcome is available for 17 studies, 11 studies in children and 6 studies in adults. For each study, the mean value, standard deviation, and sample size are reported for both the experimental and control group. The authors conducted a random-effects meta-analysis with the mean difference as effect measure, i.e.\ mean value in the nedocromil sodium group minus mean value in the placebo group.
This data set is used as an example in Schwarzer et al. (2015).
raw mean differences, subgroup analysis
Guido Schwarzer, [email protected], https://github.com/guido-s/
Spooner, C., Saunders, L. D., & Rowe, B. H. (2002). Nedocromil sodium for preventing exercise‐induced bronchoconstriction. Cochrane Database of Systematic Reviews, 1, CD001183. https://doi.org/10.1002/14651858.CD001183
Schwarzer, G., Carpenter, J. R., & Rücker, G. (2015). Meta-analysis with R. Cham, Switzerland: Springer.
### Show first five studies head(dat.spooner2002, 5) ## Not run: ### Load meta package suppressPackageStartupMessages(library("meta")) ### Use settings from RevMan5 oldset <- settings.meta("RevMan5") ### Conduct random effects meta-analysis with age subgroups mc1 <- metacont(Ne, Me, Se, Nc, Mc, Sc, data = dat.spooner2002, studlab = paste(author, year), subgroup = agegroup, print.subgroup.name = FALSE, label.e = "Nedocromil sodium", label.c = "Placebo", common = FALSE) mc1 ### Use previous settings settings.meta(oldset) ## End(Not run)
### Show first five studies head(dat.spooner2002, 5) ## Not run: ### Load meta package suppressPackageStartupMessages(library("meta")) ### Use settings from RevMan5 oldset <- settings.meta("RevMan5") ### Conduct random effects meta-analysis with age subgroups mc1 <- metacont(Ne, Me, Se, Nc, Mc, Sc, data = dat.spooner2002, studlab = paste(author, year), subgroup = agegroup, print.subgroup.name = FALSE, label.e = "Nedocromil sodium", label.c = "Placebo", common = FALSE) mc1 ### Use previous settings settings.meta(oldset) ## End(Not run)
Results from 29 trials assessing efficacy of three drug classes as adjuvant treatment to levodopa therapy in patients with Parkinson disease and motor complications.
dat.stowe2010
dat.stowe2010
The data frame contains the following columns:
study | character |
study label |
id | integer |
study id |
t1 | character |
treatment 1 |
y1 | numeric |
treatment effect arm 1 |
sd1 | numeric |
standard deviation arm 1 |
n1 | integer |
sample size arm 1 |
t2 | character |
treatment 2 |
y2 | numeric |
treatment effect arm 2 |
sd2 | numeric |
standard deviation arm 2 |
n2 | integer |
sample size arm 2 |
t3 | character |
treatment 3 |
y3 | numeric |
treatment effect arm 3 |
sd3 | numeric |
standard deviation arm 3 |
n3 | integer |
sample size arm 3 |
This dataset contains data from a Cochrane review assessing efficacy and safety of three drug classes as adjuvant treatment to levodopa therapy in patients with Parkinson disease and motor complications (Stowe et al., 2010).
The authors conducted three pairwise meta-analyses comparing dopamine agonists, catechol-O-methyl transferase inhibitors (COMTI), and monoamine oxidase type B inhibitors (MAOBI) with placebo. The primary outcome was the mean reduction of the time spent in a relatively immobile ‘off’ phase (mean off-time), calculated in hours per day. Relative treatment effects were expressed as mean difference. Data on this outcome were available for 5,331 patients from 28 studies comparing an active treatment with placebo and one three-arm study comparing two active treatments with placebo.
medicine, raw mean differences, network meta-analysis
Guido Schwarzer, [email protected], https://github.com/guido-s/
Stowe, R., Ives, N., Clarke, C. E., Deane, K., Hilten, V., Wheatley, K., Gray, R., Handley, K., & Furmston, A. (2010). Evaluation of the efficacy and safety of adjuvant treatment to levodopa therapy in Parkinson's disease patients with motor complications. Cochrane Database of Systematic Reviews, 7, CD007166. https://doi.org/10.1002/14651858.CD007166.pub2
pairwise
, metacont
, netmeta
, netrank
, rankogram
, netleague
### Show results from three studies (including three-arm study LARGO) dat.stowe2010[18:20, ] ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print mean differences with two digits and standard errors with 3 ### digits oldset <- settings.meta(digits = 2, digits.se = 3) ### Transform data from wide arm-based format to contrast-based ### format. Argument 'sm' must not be provided as the mean difference ### is the default in R function metacont() called internally. pw <- pairwise(treat = list(t1, t2, t3), n = list(n1, n2, n3), mean = list(y1, y2, y3), sd = list(sd1, sd2, sd3), studlab = study, data = dat.stowe2010, sm = "MD") ### Show calculated mean differences (TE) for three studies selstudy <- c("COMTI(E) INT-OZ", "LARGO", "COMTI(E) Nomecomt") subset(pw, studlab %in% selstudy)[, c(3:7, 10, 1)] ### Conduct random effects network meta-analysis (NMA) ### with placebo as reference net <- netmeta(pw, fixed = FALSE, ref = "plac") ### Show network graph netgraph(net, number = TRUE, multiarm = TRUE, cex = 1.25, offset = 0.025, cex.number = 1, pos.number.of.studies = 0.3) ### Print NMA results net ### Forest plot with NMA results forest(net) ### Forest plot showing all network estimates of active treatments ### compared with other treatments forest(net, ref = c("C", "D", "M"), baseline = FALSE, drop = TRUE) ### Treatment ranking using P-scores netrank(net) ### Rankogram with all ranking probabilities set.seed(1909) ran <- rankogram(net) ran plot(ran) ### Treatment ranking using SUCRAs netrank(ran) ### League table showing network and direct estimates netleague(net, seq = netrank(net), ci = FALSE) ### Use previous settings settings.meta(oldset) ## End(Not run)
### Show results from three studies (including three-arm study LARGO) dat.stowe2010[18:20, ] ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print mean differences with two digits and standard errors with 3 ### digits oldset <- settings.meta(digits = 2, digits.se = 3) ### Transform data from wide arm-based format to contrast-based ### format. Argument 'sm' must not be provided as the mean difference ### is the default in R function metacont() called internally. pw <- pairwise(treat = list(t1, t2, t3), n = list(n1, n2, n3), mean = list(y1, y2, y3), sd = list(sd1, sd2, sd3), studlab = study, data = dat.stowe2010, sm = "MD") ### Show calculated mean differences (TE) for three studies selstudy <- c("COMTI(E) INT-OZ", "LARGO", "COMTI(E) Nomecomt") subset(pw, studlab %in% selstudy)[, c(3:7, 10, 1)] ### Conduct random effects network meta-analysis (NMA) ### with placebo as reference net <- netmeta(pw, fixed = FALSE, ref = "plac") ### Show network graph netgraph(net, number = TRUE, multiarm = TRUE, cex = 1.25, offset = 0.025, cex.number = 1, pos.number.of.studies = 0.3) ### Print NMA results net ### Forest plot with NMA results forest(net) ### Forest plot showing all network estimates of active treatments ### compared with other treatments forest(net, ref = c("C", "D", "M"), baseline = FALSE, drop = TRUE) ### Treatment ranking using P-scores netrank(net) ### Rankogram with all ranking probabilities set.seed(1909) ran <- rankogram(net) ran plot(ran) ### Treatment ranking using SUCRAs netrank(ran) ### League table showing network and direct estimates netleague(net, seq = netrank(net), ci = FALSE) ### Use previous settings settings.meta(oldset) ## End(Not run)
Results from 17 studies on the correlation between school motivation/attitudes and subsequent delinquent/criminal behavior.
dat.tannersmith2016
dat.tannersmith2016
The data frame contains the following columns:
studyid | numeric |
study identifier |
yi | numeric |
r-to-z transformed correlation coefficient |
vi | numeric |
corresponding sampling variance |
sei | numeric |
corresponding standard error |
aget1 | numeric |
age at which the school motivation/attitudes were assessed |
aget2 | numeric |
age at which the delinquent/criminal behavior was assessed |
propmale | numeric |
proportion of male participants in the sample |
sexmix | character |
whether the sample consisted only of males, only of females, or a mix |
The dataset includes 113 r-to-z transformed correlation coefficients from 17 prospective longitudinal studies that examined the relationship between school motivation/attitudes and subsequent delinquent/criminal behavior.
Multiple coefficients could be extracted from the studies “given the numerous ways in which school motivation/attitudes variables could be operationalized (e.g., academic aspirations, academic self-efficacy) as well as the numerous ways in which crime/delinquency could be operationalized (e.g., property crime, violent crime)” (Tanner-Smith et al., 2016).
Since information to compute the covariance between multiple coefficients within studies is not available, Tanner-Smith et al. (2016) illustrate the use of cluster-robust inference methods for the analysis of this dataset.
Note that this dataset is only meant to be used for pedagogical and demonstration purposes and does not constitute a proper review or synthesis of the complete and current research evidence on the given topic.
psychology, criminology, correlation coefficients, multilevel models, cluster-robust inference, meta-regression
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Tanner-Smith, E. E., Tipton, E. & Polanin, J. R. (2016). Handling complex meta-analytic data structures using robust variance estimates: A tutorial in R. Journal of Developmental and Life-Course Criminology, 2(1), 85–112. https://doi.org/10.1007/s40865-016-0026-5
### copy data into 'dat' and examine data dat <- dat.tannersmith2016 head(dat) ## Not run: ### load metafor package library(metafor) ### compute mean age variables within studies dat$aget1 <- ave(dat$aget1, dat$studyid) dat$aget2 <- ave(dat$aget2, dat$studyid) ### construct an effect size identifier variable dat$esid <- 1:nrow(dat) ### construct an approximate var-cov matrix assuming a correlation of 0.8 ### for multiple coefficients arising from the same study V <- vcalc(vi, cluster=studyid, obs=esid, rho=0.8, data=dat) ### fit a multivariate random-effects model using the approximate var-cov matrix V res <- rma.mv(yi, V, random = ~ esid | studyid, data=dat) res ### use cluster-robust inference methods robust(res, cluster=studyid, clubSandwich=TRUE) ### note: the results obtained above and below are slightly different compared ### to those given by Tanner-Smith et al. (2016) since the approach illustrated ### here makes use a multivariate random-effects model for the 'working model' ### before applying the cluster-robust inference methods, while the results given ### in the paper are based on a somewhat simpler working model ### examine the main effects of the age variables res <- rma.mv(yi, V, mods = ~ aget1 + aget2, random = ~ 1 | studyid/esid, data=dat) robust(res, cluster=studyid, clubSandwich=TRUE) ### also examine their interaction res <- rma.mv(yi, V, mods = ~ aget1 * aget2, random = ~ 1 | studyid/esid, data=dat) robust(res, cluster=studyid, clubSandwich=TRUE) ### add the sexmix factor to the model res <- rma.mv(yi, V, mods = ~ aget1 * aget2 + sexmix, random = ~ 1 | studyid/esid, data=dat) robust(res, cluster=studyid, clubSandwich=TRUE) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.tannersmith2016 head(dat) ## Not run: ### load metafor package library(metafor) ### compute mean age variables within studies dat$aget1 <- ave(dat$aget1, dat$studyid) dat$aget2 <- ave(dat$aget2, dat$studyid) ### construct an effect size identifier variable dat$esid <- 1:nrow(dat) ### construct an approximate var-cov matrix assuming a correlation of 0.8 ### for multiple coefficients arising from the same study V <- vcalc(vi, cluster=studyid, obs=esid, rho=0.8, data=dat) ### fit a multivariate random-effects model using the approximate var-cov matrix V res <- rma.mv(yi, V, random = ~ esid | studyid, data=dat) res ### use cluster-robust inference methods robust(res, cluster=studyid, clubSandwich=TRUE) ### note: the results obtained above and below are slightly different compared ### to those given by Tanner-Smith et al. (2016) since the approach illustrated ### here makes use a multivariate random-effects model for the 'working model' ### before applying the cluster-robust inference methods, while the results given ### in the paper are based on a somewhat simpler working model ### examine the main effects of the age variables res <- rma.mv(yi, V, mods = ~ aget1 + aget2, random = ~ 1 | studyid/esid, data=dat) robust(res, cluster=studyid, clubSandwich=TRUE) ### also examine their interaction res <- rma.mv(yi, V, mods = ~ aget1 * aget2, random = ~ 1 | studyid/esid, data=dat) robust(res, cluster=studyid, clubSandwich=TRUE) ### add the sexmix factor to the model res <- rma.mv(yi, V, mods = ~ aget1 * aget2 + sexmix, random = ~ 1 | studyid/esid, data=dat) robust(res, cluster=studyid, clubSandwich=TRUE) ## End(Not run)
13 studies investigating the occurrence of dose limiting toxicities (DLTs) at different doses of Sorafenib.
dat.ursino2021
dat.ursino2021
The data frame contains the following columns:
study | character |
study label |
year | integer |
publication year |
dose | numeric |
dose ( ) |
events | integer |
number of DLTs |
total | integer |
number of patients exposed |
Sorafenib (BAY 43-9006, Nexavar) is a kinase inhibitor that is used in the treatment of advanced renal cell carcinoma, hepatocellular carcinoma, and radioactive iodine resistant advanced thyroid carcinoma. Thirteen trials with published results, described in eleven manuscripts, were identified in a literature search. This dataset contains the doses investigated, the numbers of patients treated, and the number of dose-limiting toxicities (DLTs) observed. In general, each study investigated several doses according to some dose-escalation scheme.
medicine, oncology, dose-response models
Christian Roever, [email protected]
Ursino, M., Roever, C., Zohar, S., & Friede T. (2021). Random-effects meta-analysis of phase I dose-finding studies using stochastic process priors. The Annals of Applied Statistics, 15(1), 174–193. https://doi.org/10.1214/20-AOAS1390
Roever, C., Ursino, M., Friede, T., & Zohar, S. (2022). A straighforward meta-analysis approach for oncology phase I dose-finding studies. Statistics in Medicine, 41(20), 3915–3940. https://doi.org/10.1002/sim.9484
European Medicines Agency (EMA) (2022). Nexavar (sorafenib) EPAR summary. https://www.ema.europa.eu/en/medicines/human/EPAR/nexavar
Awada, A., Hendlisz, A., Gil, T., et al. (2005). Phase I safety and pharmacokinetics of BAY 43-9006 administered for 21 days on / 7 days off in patients with advanced, refractory solid tumours. British Journal of Cancer, 92(10), 1855. https://doi.org/10.1038/sj.bjc.6602584
Clark, J. W., Eder, J. P., Ryan, D., Lathia, C., & Lenz, H.-J. (2005). Safety and pharmacokinetics of the dual action Raf kinase and vascular endothelial growth factor receptor inhibitor, BAY 43-9006, in patients with advanced, refractory solid tumors. Clinical Cancer Research, 11(15), 5472–5480. https://doi.org/10.1158/1078-0432.CCR-04-2658
Moore, M., Hirte, H. W., Siu, L., et al. (2005). Phase I study to determine the safety and pharmacokinetics of the novel Raf kinase and VEGFR inhibitor BAY 43-9006, administered for 28 days on / 7 days off in patients with advanced, refractory solid tumors. Annals of Oncology, 16(10), 1688–1694. https://doi.org/10.1093/annonc/mdi310
Strumberg, D., Richly, H., Hilger, R. A., et al. (2005). Phase I clinical and pharmacokinetic study of the novel Raf kinase and vascular endothelial growth factor receptor inhibitor BAY 43-9006 in patients with advanced refractory solid tumors. Journal of Clinical Oncology, 23(5), 965–972. https://doi.org/10.1200/JCO.2005.06.124
Furuse, J., Ishii, H., Nakachi, K., Suzuki, E., Shimizu, S., & Nakajima, K. (2008). Phase I study of sorafenib in Japanese patients with hepatocellular carcinoma. Cancer Science, 99(1), 159–165. https://doi.org/10.1111/j.1349-7006.2007.00648.x
Minami, H., Kawada, K., Ebi, H., et al. (2008). Phase I and pharmacokinetic study of sorafenib, an oral multikinase inhibitor, in Japanese patients with advanced refractory solid tumors. Cancer Science, 99(7), 1492–1498. https://doi.org/10.1111/j.1349-7006.2008.00837.x
Miller, A. A., Murry, D. J., Owzar, K., et al. (2009). Phase I and pharmacokinetic study of sorafenib in patients with hepatic or renal dysfunction: CALGB 60301. Journal of Clinical Oncology, 27(11), 1800. https://doi.org/10.1200/JCO.2008.20.0931
Crump, M., Hedley, D., Kamel-Reid, S., et al. (2010). A randomized phase I clinical and biologic study of two schedules of sorafenib in patients with myelodysplastic syndrome or acute myeloid leukemia: A NCIC (National Cancer Institute of Canada) Clinical Trials Group Study. Leukemia and Lymphoma, 51(2), 252–260. https://doi.org/10.3109/10428190903585286
Borthakur, G., Kantarjian, H., Ravandi, F., et al. (2011). Phase I study of sorafenib in patients with refractory or relapsed acute Leukemias. Haematologica, 96(1), 62–68. https://doi.org/10.3324/haematol.2010.030452
Nabors, L. B., Supko, J. G., Rosenfeld, M., et al. (2011). Phase I trial of sorafenib in patients with recurrent or progressive malignant glioma. Neuro-Oncology, 13(12), 1324–1330. https://doi.org/10.1093/neuonc/nor145
Chen, Y.-B., Li, S., Lane, A. A., et al. (2014). Phase I trial of maintenance sorafenib after allogeneic hematopoietic stem cell transplantation for FMS-like tyrosine kinase 3 internal tandem duplication acute myeloid leukemia. Biology of Blood and Marrow Transplantation, 20(12), 2042–2048. https://doi.org/10.1016/j.bbmt.2014.09.007
# show (some) data head(dat.ursino2021, n=15) ## Not run: # illustrate data plot(NA, xlim=range(dat.ursino2021$dose), ylim=0:1, xlab="dose (mg)", ylab="proportion", main="dat.ursino2021 (Sorafenib data)") studylab <- unique(dat.ursino2021$study) colvec <- rainbow(length(studylab)) for (i in 1:length(studylab)) { idx <- (dat.ursino2021$study == studylab[i]) lines(dat.ursino2021[idx,"dose"], dat.ursino2021[idx,"events"] / dat.ursino2021[idx,"total"], col=colvec[i], type="b") } legend("topleft", studylab, col=colvec, pch=15) ## End(Not run)
# show (some) data head(dat.ursino2021, n=15) ## Not run: # illustrate data plot(NA, xlim=range(dat.ursino2021$dose), ylim=0:1, xlab="dose (mg)", ylab="proportion", main="dat.ursino2021 (Sorafenib data)") studylab <- unique(dat.ursino2021$study) colvec <- rainbow(length(studylab)) for (i in 1:length(studylab)) { idx <- (dat.ursino2021$study == studylab[i]) lines(dat.ursino2021[idx,"dose"], dat.ursino2021[idx,"events"] / dat.ursino2021[idx,"total"], col=colvec[i], type="b") } legend("topleft", studylab, col=colvec, pch=15) ## End(Not run)
Results from 33 studies examining the association between male circumcision and HIV infection.
dat.vanhowe1999
dat.vanhowe1999
The data frame contains the following columns:
study | character |
study author |
category | character |
study type (high-risk group, partner study, or population survey) |
non.pos | numeric |
number of non-circumcised HIV positive cases |
non.neg | numeric |
number of non-circumcised HIV negative cases |
cir.pos | numeric |
number of circumcised HIV positive cases |
cir.neg | numeric |
number of circumcised HIV negative cases |
The 33 studies provide data in terms of \(2 \times 2\) tables in the form:
HIV positive | HIV negative | |
non-circumcised | non.pos |
non.neg |
circumcised | cir.pos |
cir.neg
|
The goal of the meta-analysis was to examine if the risk of an HIV infection differs between non-circumcised versus circumcised men.
The dataset is interesting because it can be used to illustrate the difference between naively pooling results by summing up the counts across studies and then computing the odds ratio based on the aggregated table (as was done by Van Howe, 1999) and conducting a proper meta-analysis (as illustrated by O'Farrell & Egger, 2000). In fact, a proper meta-analysis shows that the HIV infection risk is on average higher in non-circumcised men, which is the opposite of what the naive pooling approach yields (which makes this an illustration of Simpson's paradox).
medicine, epidemiology, odds ratios
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Van Howe, R. S. (1999). Circumcision and HIV infection: Review of the literature and meta-analysis. International Journal of STD & AIDS, 10(1), 8–16. https://doi.org/10.1258/0956462991913015
O'Farrell, N., & Egger, M. (2000). Circumcision in men and the prevention of HIV infection: A 'meta-analysis' revisited. International Journal of STD & AIDS, 11(3), 137–142. https://doi.org/10.1258/0956462001915480
### copy data into 'dat' and examine data dat <- dat.vanhowe1999 dat ## Not run: ### load metafor package library(metafor) ### naive pooling by summing up the counts within categories and then ### computing the odds ratios and corresponding confidence intervals cat1 <- with(dat[dat$category=="high-risk group",], escalc(measure="OR", ai=sum(non.pos), bi=sum(non.neg), ci=sum(cir.pos), di=sum(cir.neg))) cat2 <- with(dat[dat$category=="partner study",], escalc(measure="OR", ai=sum(non.pos), bi=sum(non.neg), ci=sum(cir.pos), di=sum(cir.neg))) cat3 <- with(dat[dat$category=="population survey",], escalc(measure="OR", ai=sum(non.pos), bi=sum(non.neg), ci=sum(cir.pos), di=sum(cir.neg))) summary(cat1, transf=exp, digits=2) summary(cat2, transf=exp, digits=2) summary(cat3, transf=exp, digits=2) ### naive pooling across all studies all <- escalc(measure="OR", ai=sum(dat$non.pos), bi=sum(dat$non.neg), ci=sum(dat$cir.pos), di=sum(dat$cir.neg)) summary(all, transf=exp, digits=2) ### calculate log odds ratios and corresponding sampling variances dat <- escalc(measure="OR", ai=non.pos, bi=non.neg, ci=cir.pos, di=cir.neg, data=dat) dat ### random-effects model res <- rma(yi, vi, data=dat, method="DL") res predict(res, transf=exp, digits=2) ### random-effects model within subgroups res <- rma(yi, vi, data=dat, method="DL", subset=category=="high-risk group") predict(res, transf=exp, digits=2) res <- rma(yi, vi, data=dat, method="DL", subset=category=="partner study") predict(res, transf=exp, digits=2) res <- rma(yi, vi, data=dat, method="DL", subset=category=="population survey") predict(res, transf=exp, digits=2) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.vanhowe1999 dat ## Not run: ### load metafor package library(metafor) ### naive pooling by summing up the counts within categories and then ### computing the odds ratios and corresponding confidence intervals cat1 <- with(dat[dat$category=="high-risk group",], escalc(measure="OR", ai=sum(non.pos), bi=sum(non.neg), ci=sum(cir.pos), di=sum(cir.neg))) cat2 <- with(dat[dat$category=="partner study",], escalc(measure="OR", ai=sum(non.pos), bi=sum(non.neg), ci=sum(cir.pos), di=sum(cir.neg))) cat3 <- with(dat[dat$category=="population survey",], escalc(measure="OR", ai=sum(non.pos), bi=sum(non.neg), ci=sum(cir.pos), di=sum(cir.neg))) summary(cat1, transf=exp, digits=2) summary(cat2, transf=exp, digits=2) summary(cat3, transf=exp, digits=2) ### naive pooling across all studies all <- escalc(measure="OR", ai=sum(dat$non.pos), bi=sum(dat$non.neg), ci=sum(dat$cir.pos), di=sum(dat$cir.neg)) summary(all, transf=exp, digits=2) ### calculate log odds ratios and corresponding sampling variances dat <- escalc(measure="OR", ai=non.pos, bi=non.neg, ci=cir.pos, di=cir.neg, data=dat) dat ### random-effects model res <- rma(yi, vi, data=dat, method="DL") res predict(res, transf=exp, digits=2) ### random-effects model within subgroups res <- rma(yi, vi, data=dat, method="DL", subset=category=="high-risk group") predict(res, transf=exp, digits=2) res <- rma(yi, vi, data=dat, method="DL", subset=category=="partner study") predict(res, transf=exp, digits=2) res <- rma(yi, vi, data=dat, method="DL", subset=category=="population survey") predict(res, transf=exp, digits=2) ## End(Not run)
Results from 20 hypothetical randomized clinical trials examining the effectiveness of a medication for treating some disease.
dat.viechtbauer2021
dat.viechtbauer2021
The data frame contains the following columns:
trial | numeric |
trial number |
nTi | numeric |
number of patients in the treatment group |
nCi | numeric |
number of patients in the control group |
xTi | numeric |
number of patients in the treatment group with remission |
xCi | numeric |
number of patients in the control group with remission |
dose | numeric |
dosage of the medication provided to patients in the treatment group (in milligrams per day) |
The dataset was constructed for the purposes of illustrating the model checking and diagnostic methods described in Viechtbauer (2021). The code below provides the results for many of the analyses and plots discussed in the book chapter.
medicine, odds ratios, outliers, model checks
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Viechtbauer, W. (2021). Model checking in meta-analysis. In C. H. Schmid, T. Stijnen, & I. R. White (Eds.), Handbook of meta-analysis (pp. 219-254). Boca Raton, FL: CRC Press. https://doi.org/10.1201/9781315119403
### copy data into 'dat' and examine data dat <- dat.viechtbauer2021 dat ## Not run: ### load metafor package library(metafor) ### calculate log odds ratios and corresponding sampling variances dat <- escalc(measure="OR", ai=xTi, n1i=nTi, ci=xCi, n2i=nCi, add=1/2, to="all", data=dat) dat ### number of studies k <- nrow(dat) ### fit models res.CE <- rma(yi, vi, data=dat, method="CE") # same as method="EE" res.CE res.RE <- rma(yi, vi, data=dat, method="DL") res.RE res.MR <- rma(yi, vi, mods = ~ dose, data=dat, method="FE") res.MR res.ME <- rma(yi, vi, mods = ~ dose, data=dat, method="DL") res.ME ### forest and bubble plot par(mar=c(5,4,1,2)) forest(dat$yi, dat$vi, psize=0.8, efac=0, xlim=c(-4,6), ylim=c(-3,23), cex=1, width=c(5,5,5), xlab="Log Odds Ratio (LnOR)") addpoly(res.CE, row=-1.5, mlab="CE Model") addpoly(res.RE, row=-2.5, mlab="RE Model") text(-4, 22, "Trial", pos=4, font=2) text( 6, 22, "LnOR [95% CI]", pos=2, font=2) abline(h=0) tmp <- regplot(res.ME, xlim=c(0,250), ylim=c(-1,1.5), predlim=c(0,250), shade=FALSE, digits=1, xlab="Dosage (mg per day)", psize="seinv", plim=c(NA,5), bty="l", las=1, lty=c("solid", "dashed"), label=TRUE, labsize=0.8, offset=c(1,0.7)) res.sub <- rma(yi, vi, mods = ~ dose, data=dat, method="DL", subset=-6) abline(res.sub, lty="dotted") points(tmp$xi, tmp$yi, pch=21, cex=tmp$psize, col="black", bg="darkgray") par(mar=c(5,4,4,2)) ### number of standardized deleted residuals larger than +-1.96 in each model sum(abs(rstudent(res.CE)$z) >= qnorm(0.975)) sum(abs(rstudent(res.MR)$z) >= qnorm(0.975)) sum(abs(rstudent(res.RE)$z) >= qnorm(0.975)) sum(abs(rstudent(res.ME)$z) >= qnorm(0.975)) ### plot of the standardized deleted residuals for the RE and ME models plot(NA, NA, xlim=c(1,20), ylim=c(-4,4), xlab="Study", ylab="Standardized (Deleted) Residual", xaxt="n", main="Random-Effects Model", las=1) axis(side=1, at=1:20) abline(h=c(-1.96,1.96), lty="dotted") abline(h=0) points(1:20, rstandard(res.RE)$z, type="o", pch=19, col="gray70") points(1:20, rstudent(res.RE)$z, type="o", pch=19) legend("top", pch=19, col=c("gray70","black"), lty="solid", legend=c("Standardized Residuals","Standardized Deleted Residuals"), bty="n") plot(NA, NA, xlim=c(1,20), ylim=c(-4,4), xlab="Study", ylab="Standardized (Deleted) Residual", xaxt="n", main="Mixed-Effects Model", las=1) axis(side=1, at=1:20) abline(h=c(-1.96,1.96), lty="dotted") abline(h=0) points(1:20, rstandard(res.ME)$z, type="o", pch=19, col="gray70") points(1:20, rstudent(res.ME)$z, type="o", pch=19) legend("top", pch=19, col=c("gray70","black"), lty="solid", legend=c("Standardized Residuals","Standardized Deleted Residuals"), bty="n") ### Baujat plots baujat(res.CE, main="Common-Effects Model", xlab="Squared Pearson Residual", ylim=c(0,5), las=1) baujat(res.ME, main="Mixed-Effects Model", ylim=c(0,2), las=1) ### GOSH plots (skipped because this takes quite some time to run) if (FALSE) { res.GOSH.CE <- gosh(res.CE, subsets=10^7) plot(res.GOSH.CE, cex=0.2, out=6, xlim=c(-0.25,1.25), breaks=c(200,100)) res.GOSH.ME <- gosh(res.ME, subsets=10^7) plot(res.GOSH.ME, het="tau2", out=6, breaks=50, adjust=0.6, las=1) } ### plot of treatment dosage against the standardized residuals plot(dat$dose, rstandard(res.ME)$z, pch=19, xlab="Dosage (mg per day)", ylab="Standardized Residual", xlim=c(0,250), ylim=c(-2.5,2.5), las=1) abline(h=c(-1.96,1.96), lty="dotted", lwd=2) abline(h=0) title("Standardized Residual Plot") text(dat$dose[6], rstandard(res.ME)$z[6], "6", pos=4, offset=0.4) ### quadratic polynomial model rma(yi, vi, mods = ~ dose + I(dose^2), data=dat, method="DL") ### lack-of-fit model resLOF <- rma(yi, vi, mods = ~ dose + factor(dose), data=dat, method="DL", btt=3:9) resLOF ### scatter plot to illustrate the lack-of-fit model regplot(res.ME, xlim=c(0,250), ylim=c(-1.0,1.5), xlab="Dosage (mg per day)", ci=FALSE, predlim=c(0,250), psize=1, pch=19, col="gray60", digits=1, lwd=1, bty="l", las=1) dosages <- sort(unique(dat$dose)) lines(dosages, fitted(resLOF)[match(dosages, dat$dose)], type="o", pch=19, cex=2, lwd=2) points(dat$dose, dat$yi, pch=19, col="gray60") legend("bottomright", legend=c("Linear Model", "Lack-of-Fit Model"), pch=c(NA,19), col="black", lty="solid", lwd=c(1,2), pt.cex=c(1,2), seg.len=4, bty="n") ### checking normality of the standardized deleted residuals qqnorm(res.ME, type="rstudent", main="Standardized Deleted Residuals", pch=19, label="out", lwd=2, pos=24, ylim=c(-4,3), lty=c("solid", "dotted"), las=1) ### checking normality of the random effects sav <- qqnorm(ranef(res.ME)$pred, main="BLUPs of the Random Effects", cex=1, pch=19, xlim=c(-2.2,2.2), ylim=c(-0.6,0.6), las=1) abline(a=0, b=sd(ranef(res.ME)$pred), lwd=2) text(sav$x[6], sav$y[6], "6", pos=4, offset=0.4) ### hat values for the CE and RE models plot(NA, NA, xlim=c(1,20), ylim=c(0,0.21), xaxt="n", las=1, xlab="Study", ylab="Hat Value") axis(1, 1:20, cex.axis=1) points(hatvalues(res.CE), type="o", pch=19, col="gray70") points(hatvalues(res.RE), type="o", pch=19) abline(h=1/20, lty="dotted", lwd=2) title("Hat Values for the CE/RE Models") legend("topright", pch=19, col=c("gray70","black"), lty="solid", legend=c("Common-Effects Model", "Random-Effects Model"), bty="n") ### heatmap of the hat matrix for the ME model cols <- colorRampPalette(c("blue", "white", "red"))(101) h <- hatvalues(res.ME, type="matrix") image(1:nrow(h), 1:ncol(h), t(h[nrow(h):1,]), axes=FALSE, xlab="Influence of the Observed Effect of Study ...", ylab="On the Fitted Value of Study ...", col=cols, zlim=c(-max(abs(h)),max(abs(h)))) axis(1, 1:20, tick=FALSE) axis(2, 1:20, labels=20:1, las=1, tick=FALSE) abline(h=seq(0.5,20.5,by=1), col="white") abline(v=seq(0.5,20.5,by=1), col="white") points(1:20, 20:1, pch=19, cex=0.4) title("Heatmap for the Mixed-Effects Model") ### plot of leverages versus standardized residuals for the ME model plot(hatvalues(res.ME), rstudent(res.ME)$z, pch=19, cex=0.2+3*sqrt(cooks.distance(res.ME)), las=1, xlab="Leverage (Hat Value)", ylab="Standardized Deleted Residual", xlim=c(0,0.35), ylim=c(-3.5,2.5)) abline(h=c(-1.96,1.96), lty="dotted", lwd=2) abline(h=0, lwd=2) ids <- c(3,6,9) text(hatvalues(res.ME)[ids] + c(0,0.013,0.010), rstudent(res.ME)$z[ids] - c(0.18,0,0), ids) title("Leverage vs. Standardized Deleted Residuals") ### plot of the Cook's distances for the ME model plot(1:20, cooks.distance(res.ME), ylim=c(0,1.6), type="o", pch=19, las=1, xaxt="n", yaxt="n", xlab="Study", ylab="Cook's Distance") axis(1, 1:20, cex.axis=1) axis(2, seq(0,1.6,by=0.4), las=1) title("Cook's Distances") ### plot of the leave-one-out estimates of tau^2 for the ME model x <- influence(res.ME) plot(1:20, x$inf$tau2.del, ylim=c(0,0.15), type="o", pch=19, las=1, xaxt="n", xlab="Study", ylab=expression(paste("Estimate of ", tau^2, " without the ", italic(i), "th study"))) abline(h=res.ME$tau2, lty="dashed") axis(1, 1:20) title("Residual Heterogeneity Estimates") ### plot of the covariance ratios for the ME model plot(1:20, x$inf$cov.r, ylim=c(0,2.0), type="o", pch=19, las=1, xaxt="n", xlab="Study", ylab="Covariance Ratio") abline(h=1, lty="dashed") axis(1, 1:20) title("Covariance Ratios") ### fit mixed-effects model without studies 3 and/or 6 rma(yi, vi, mods = ~ dose, data=dat, method="DL", subset=-3) rma(yi, vi, mods = ~ dose, data=dat, method="DL", subset=-6) rma(yi, vi, mods = ~ dose, data=dat, method="DL", subset=-c(3,6)) ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.viechtbauer2021 dat ## Not run: ### load metafor package library(metafor) ### calculate log odds ratios and corresponding sampling variances dat <- escalc(measure="OR", ai=xTi, n1i=nTi, ci=xCi, n2i=nCi, add=1/2, to="all", data=dat) dat ### number of studies k <- nrow(dat) ### fit models res.CE <- rma(yi, vi, data=dat, method="CE") # same as method="EE" res.CE res.RE <- rma(yi, vi, data=dat, method="DL") res.RE res.MR <- rma(yi, vi, mods = ~ dose, data=dat, method="FE") res.MR res.ME <- rma(yi, vi, mods = ~ dose, data=dat, method="DL") res.ME ### forest and bubble plot par(mar=c(5,4,1,2)) forest(dat$yi, dat$vi, psize=0.8, efac=0, xlim=c(-4,6), ylim=c(-3,23), cex=1, width=c(5,5,5), xlab="Log Odds Ratio (LnOR)") addpoly(res.CE, row=-1.5, mlab="CE Model") addpoly(res.RE, row=-2.5, mlab="RE Model") text(-4, 22, "Trial", pos=4, font=2) text( 6, 22, "LnOR [95% CI]", pos=2, font=2) abline(h=0) tmp <- regplot(res.ME, xlim=c(0,250), ylim=c(-1,1.5), predlim=c(0,250), shade=FALSE, digits=1, xlab="Dosage (mg per day)", psize="seinv", plim=c(NA,5), bty="l", las=1, lty=c("solid", "dashed"), label=TRUE, labsize=0.8, offset=c(1,0.7)) res.sub <- rma(yi, vi, mods = ~ dose, data=dat, method="DL", subset=-6) abline(res.sub, lty="dotted") points(tmp$xi, tmp$yi, pch=21, cex=tmp$psize, col="black", bg="darkgray") par(mar=c(5,4,4,2)) ### number of standardized deleted residuals larger than +-1.96 in each model sum(abs(rstudent(res.CE)$z) >= qnorm(0.975)) sum(abs(rstudent(res.MR)$z) >= qnorm(0.975)) sum(abs(rstudent(res.RE)$z) >= qnorm(0.975)) sum(abs(rstudent(res.ME)$z) >= qnorm(0.975)) ### plot of the standardized deleted residuals for the RE and ME models plot(NA, NA, xlim=c(1,20), ylim=c(-4,4), xlab="Study", ylab="Standardized (Deleted) Residual", xaxt="n", main="Random-Effects Model", las=1) axis(side=1, at=1:20) abline(h=c(-1.96,1.96), lty="dotted") abline(h=0) points(1:20, rstandard(res.RE)$z, type="o", pch=19, col="gray70") points(1:20, rstudent(res.RE)$z, type="o", pch=19) legend("top", pch=19, col=c("gray70","black"), lty="solid", legend=c("Standardized Residuals","Standardized Deleted Residuals"), bty="n") plot(NA, NA, xlim=c(1,20), ylim=c(-4,4), xlab="Study", ylab="Standardized (Deleted) Residual", xaxt="n", main="Mixed-Effects Model", las=1) axis(side=1, at=1:20) abline(h=c(-1.96,1.96), lty="dotted") abline(h=0) points(1:20, rstandard(res.ME)$z, type="o", pch=19, col="gray70") points(1:20, rstudent(res.ME)$z, type="o", pch=19) legend("top", pch=19, col=c("gray70","black"), lty="solid", legend=c("Standardized Residuals","Standardized Deleted Residuals"), bty="n") ### Baujat plots baujat(res.CE, main="Common-Effects Model", xlab="Squared Pearson Residual", ylim=c(0,5), las=1) baujat(res.ME, main="Mixed-Effects Model", ylim=c(0,2), las=1) ### GOSH plots (skipped because this takes quite some time to run) if (FALSE) { res.GOSH.CE <- gosh(res.CE, subsets=10^7) plot(res.GOSH.CE, cex=0.2, out=6, xlim=c(-0.25,1.25), breaks=c(200,100)) res.GOSH.ME <- gosh(res.ME, subsets=10^7) plot(res.GOSH.ME, het="tau2", out=6, breaks=50, adjust=0.6, las=1) } ### plot of treatment dosage against the standardized residuals plot(dat$dose, rstandard(res.ME)$z, pch=19, xlab="Dosage (mg per day)", ylab="Standardized Residual", xlim=c(0,250), ylim=c(-2.5,2.5), las=1) abline(h=c(-1.96,1.96), lty="dotted", lwd=2) abline(h=0) title("Standardized Residual Plot") text(dat$dose[6], rstandard(res.ME)$z[6], "6", pos=4, offset=0.4) ### quadratic polynomial model rma(yi, vi, mods = ~ dose + I(dose^2), data=dat, method="DL") ### lack-of-fit model resLOF <- rma(yi, vi, mods = ~ dose + factor(dose), data=dat, method="DL", btt=3:9) resLOF ### scatter plot to illustrate the lack-of-fit model regplot(res.ME, xlim=c(0,250), ylim=c(-1.0,1.5), xlab="Dosage (mg per day)", ci=FALSE, predlim=c(0,250), psize=1, pch=19, col="gray60", digits=1, lwd=1, bty="l", las=1) dosages <- sort(unique(dat$dose)) lines(dosages, fitted(resLOF)[match(dosages, dat$dose)], type="o", pch=19, cex=2, lwd=2) points(dat$dose, dat$yi, pch=19, col="gray60") legend("bottomright", legend=c("Linear Model", "Lack-of-Fit Model"), pch=c(NA,19), col="black", lty="solid", lwd=c(1,2), pt.cex=c(1,2), seg.len=4, bty="n") ### checking normality of the standardized deleted residuals qqnorm(res.ME, type="rstudent", main="Standardized Deleted Residuals", pch=19, label="out", lwd=2, pos=24, ylim=c(-4,3), lty=c("solid", "dotted"), las=1) ### checking normality of the random effects sav <- qqnorm(ranef(res.ME)$pred, main="BLUPs of the Random Effects", cex=1, pch=19, xlim=c(-2.2,2.2), ylim=c(-0.6,0.6), las=1) abline(a=0, b=sd(ranef(res.ME)$pred), lwd=2) text(sav$x[6], sav$y[6], "6", pos=4, offset=0.4) ### hat values for the CE and RE models plot(NA, NA, xlim=c(1,20), ylim=c(0,0.21), xaxt="n", las=1, xlab="Study", ylab="Hat Value") axis(1, 1:20, cex.axis=1) points(hatvalues(res.CE), type="o", pch=19, col="gray70") points(hatvalues(res.RE), type="o", pch=19) abline(h=1/20, lty="dotted", lwd=2) title("Hat Values for the CE/RE Models") legend("topright", pch=19, col=c("gray70","black"), lty="solid", legend=c("Common-Effects Model", "Random-Effects Model"), bty="n") ### heatmap of the hat matrix for the ME model cols <- colorRampPalette(c("blue", "white", "red"))(101) h <- hatvalues(res.ME, type="matrix") image(1:nrow(h), 1:ncol(h), t(h[nrow(h):1,]), axes=FALSE, xlab="Influence of the Observed Effect of Study ...", ylab="On the Fitted Value of Study ...", col=cols, zlim=c(-max(abs(h)),max(abs(h)))) axis(1, 1:20, tick=FALSE) axis(2, 1:20, labels=20:1, las=1, tick=FALSE) abline(h=seq(0.5,20.5,by=1), col="white") abline(v=seq(0.5,20.5,by=1), col="white") points(1:20, 20:1, pch=19, cex=0.4) title("Heatmap for the Mixed-Effects Model") ### plot of leverages versus standardized residuals for the ME model plot(hatvalues(res.ME), rstudent(res.ME)$z, pch=19, cex=0.2+3*sqrt(cooks.distance(res.ME)), las=1, xlab="Leverage (Hat Value)", ylab="Standardized Deleted Residual", xlim=c(0,0.35), ylim=c(-3.5,2.5)) abline(h=c(-1.96,1.96), lty="dotted", lwd=2) abline(h=0, lwd=2) ids <- c(3,6,9) text(hatvalues(res.ME)[ids] + c(0,0.013,0.010), rstudent(res.ME)$z[ids] - c(0.18,0,0), ids) title("Leverage vs. Standardized Deleted Residuals") ### plot of the Cook's distances for the ME model plot(1:20, cooks.distance(res.ME), ylim=c(0,1.6), type="o", pch=19, las=1, xaxt="n", yaxt="n", xlab="Study", ylab="Cook's Distance") axis(1, 1:20, cex.axis=1) axis(2, seq(0,1.6,by=0.4), las=1) title("Cook's Distances") ### plot of the leave-one-out estimates of tau^2 for the ME model x <- influence(res.ME) plot(1:20, x$inf$tau2.del, ylim=c(0,0.15), type="o", pch=19, las=1, xaxt="n", xlab="Study", ylab=expression(paste("Estimate of ", tau^2, " without the ", italic(i), "th study"))) abline(h=res.ME$tau2, lty="dashed") axis(1, 1:20) title("Residual Heterogeneity Estimates") ### plot of the covariance ratios for the ME model plot(1:20, x$inf$cov.r, ylim=c(0,2.0), type="o", pch=19, las=1, xaxt="n", xlab="Study", ylab="Covariance Ratio") abline(h=1, lty="dashed") axis(1, 1:20) title("Covariance Ratios") ### fit mixed-effects model without studies 3 and/or 6 rma(yi, vi, mods = ~ dose, data=dat, method="DL", subset=-3) rma(yi, vi, mods = ~ dose, data=dat, method="DL", subset=-6) rma(yi, vi, mods = ~ dose, data=dat, method="DL", subset=-c(3,6)) ## End(Not run)
Results from 41 studies examining the relationship between measures of individual quality and the expression of structurally coloured sexual signals.
dat.white2020
dat.white2020
The object is a data frame which contains the following columns:
study_id | character |
study-level ID |
obs | character |
observation-level ID |
exp_obs | character |
whether the study is observational or experimental |
control | numeric |
whether the study did (1) or did not (0) include a non-sexual control trait |
class | character |
class of the study organisms |
genus | character |
class of the study organisms |
species | character |
species of the study organisms |
sex | character |
sex of the study organisms |
iridescent | numeric |
whether the colour signals were iridescent (1) or not (0) |
col_var | character |
the colour variable quantified |
col_component | character |
whether the colour variable is chromatic or achromatic |
quality_measure | character |
the measure of individual quality used |
region | character |
the body region from which colour was sampled |
n | numeric |
study sample size |
r | numeric |
Pearson's correlation coefficient |
The 186 rows in this dataset come from 41 experimental and observational studies reporting on the correlation between measures of individual quality (age, body condition, immune function, parasite resistance) and the expression of structurally coloured sexual signals across 28 species. The purpose of this meta-analysis was to test whether structural colour signals show heightened condition-dependent expression, as predicted by evolutionary models of 'honest' signalling.
ecology, evolution, correlation coefficients
Thomas E. White, [email protected]
White, T. E. (2020). Structural colours reflect individual quality: A meta-analysis. Biology Letters, 16(4), 20200001. https://doi.org/10.1098/rsbl.2020.0001
### copy data into 'dat' and examine data dat <- dat.white2020 head(dat, 10) ## Not run: ### load metafor package library(metafor) ### calculate r-to-z transformed correlations and corresponding sampling variances dat <- escalc(measure="ZCOR", ri=r, ni=n, data=dat) ### fit multilevel meta-analytic model res <- rma.mv(yi, vi, random = list(~ 1 | study_id, ~ 1 | obs), data=dat) res ## End(Not run)
### copy data into 'dat' and examine data dat <- dat.white2020 head(dat, 10) ## Not run: ### load metafor package library(metafor) ### calculate r-to-z transformed correlations and corresponding sampling variances dat <- escalc(measure="ZCOR", ri=r, ni=n, data=dat) ### fit multilevel meta-analytic model res <- rma.mv(yi, vi, random = list(~ 1 | study_id, ~ 1 | obs), data=dat) res ## End(Not run)
Results from 3 trials examining the mortality risk of three treatments and placebo in patients with chronic obstructive pulmonary disease.
dat.woods2010
dat.woods2010
The data frame contains the following columns:
author | character |
first author / study name |
treatment | character |
treatment |
r | integer |
number of deaths |
N | integer |
number of patients |
Count mortality statistics in randomised controlled trials of treatments for chronic obstructive pulmonary disease (Woods et al., 2010, Table 1).
medicine, odds ratios, network meta-analysis
Guido Schwarzer, [email protected], https://github.com/guido-s/
Woods, B. S., Hawkins, N., & Scott, D. A. (2010). Network meta-analysis on the log-hazard scale, combining count and hazard ratio statistics accounting for multi-arm trials: A tutorial. BMC Medical Research Methodology, 10, 54. https://doi.org/10.1186/1471-2288-10-54
### Show full dataset dat.woods2010 ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print odds ratios and confidence limits with two digits oldset <- settings.meta(digits = 2) ### Change appearance of confidence intervals cilayout("(", "-") ### Transform data from long arm-based format to contrast-based ### format. Argument 'sm' has to be used for odds ratio as summary ### measure; by default the risk ratio is used in the metabin function ### called internally. pw <- pairwise(treatment, event = r, n = N, studlab = author, data = dat.woods2010, sm = "OR") pw ### Conduct network meta-analysis net <- netmeta(pw) net ### Show forest plot forest(net, ref = "Placebo", drop = TRUE, leftlabs = "Contrast to Placebo") ### Use previous settings settings.meta(oldset) ## End(Not run)
### Show full dataset dat.woods2010 ## Not run: ### Load netmeta package suppressPackageStartupMessages(library("netmeta")) ### Print odds ratios and confidence limits with two digits oldset <- settings.meta(digits = 2) ### Change appearance of confidence intervals cilayout("(", "-") ### Transform data from long arm-based format to contrast-based ### format. Argument 'sm' has to be used for odds ratio as summary ### measure; by default the risk ratio is used in the metabin function ### called internally. pw <- pairwise(treatment, event = r, n = N, studlab = author, data = dat.woods2010, sm = "OR") pw ### Conduct network meta-analysis net <- netmeta(pw) net ### Show forest plot forest(net, ref = "Placebo", drop = TRUE, leftlabs = "Contrast to Placebo") ### Use previous settings settings.meta(oldset) ## End(Not run)
Results from studies examining the effectiveness of beta blockers for reducing mortality and reinfarction.
dat.yusuf1985
dat.yusuf1985
The data frame contains the following columns:
table | character |
table number |
id | character |
trial id number |
trial | character |
trial name or first author |
ai | numeric |
number of deaths/reinfarctions in treatment group |
n1i | numeric |
number of patients in treatment group |
ci | numeric |
number of deaths/reinfarctions in control group |
n2i | numeric |
number of patients in control group |
The dataset contains table 6 (total mortality from short-term trials of oral beta blockers), 9 (total mortality at one week from trials with an initial IV dose of a beta blocker), 10 (total mortality from long-term trials with treatment starting late and mortality from day 8 onwards in long-term trials that began early and continued after discharge), 11 (nonfatal reinfarction from long-term trials of beta blockers), 12a (sudden death in long-term beta blocker trials), and 12b (nonsudden death in long-term beta blocker trials) from the meta-analysis by Yusuf et al. (1985) on the effectiveness of of beta blockers for reducing mortality and reinfarction.
The article also describes what is sometimes called Peto's one-step method for meta-analyzing \(2 \times 2\) table data. This method is implemented in the rma.peto
function.
medicine, cardiology, odds ratios, Peto's method
Wolfgang Viechtbauer, [email protected], https://www.metafor-project.org
Yusuf, S., Peto, R., Lewis, J., Collins, R., & Sleight, P. (1985). Beta blockade during and after myocardial infarction: An overview of the randomized trials. Progress in Cardiovascular Disease, 27(5), 335–371. https://doi.org/10.1016/s0033-0620(85)80003-7
### copy data into 'dat' dat <- dat.yusuf1985 dat[dat$table == 6,] ## Not run: ### load metafor package library(metafor) ### to select a table for the analysis tab <- "6" # either: 6, 9, 10, 11, 12a, 12b ### to double-check total counts as reported in article apply(dat[dat$table==tab,4:7], 2, sum, na.rm=TRUE) ### meta-analysis using Peto's one-step method res <- rma.peto(ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=(table==tab)) res predict(res, transf=exp, digits=2) ## End(Not run)
### copy data into 'dat' dat <- dat.yusuf1985 dat[dat$table == 6,] ## Not run: ### load metafor package library(metafor) ### to select a table for the analysis tab <- "6" # either: 6, 9, 10, 11, 12a, 12b ### to double-check total counts as reported in article apply(dat[dat$table==tab,4:7], 2, sum, na.rm=TRUE) ### meta-analysis using Peto's one-step method res <- rma.peto(ai=ai, n1i=n1i, ci=ci, n2i=n2i, data=dat, subset=(table==tab)) res predict(res, transf=exp, digits=2) ## End(Not run)
Function to search among the existing datasets.
datsearch(pattern, concept=TRUE, matchall=TRUE, fixed=TRUE, pkgdown=FALSE)
datsearch(pattern, concept=TRUE, matchall=TRUE, fixed=TRUE, pkgdown=FALSE)
pattern |
character string or vector of strings specifying the terms to search for within the datasets. Can also be left unspecified to start the function in an interactive mode. |
concept |
logical indicating whether the search should be confined to the concept terms ( |
matchall |
logical indicating whether only the datasets matching all terms (if multiple are specified) are returned ( |
fixed |
logical indicating whether a term is a string to be matched as is ( |
pkgdown |
logical indicating whether the standard help file or the pkgdown docs (at https://wviechtb.github.io/metadat/) should be shown for a chosen dataset ( |
The function can be used to search all existing datasets in the metadat package based on their concept terms (see below) or based on a full-text search of their corresponding help files.
When running datsearch()
without the pattern
argument specified, the function starts in an interactive mode and prompts for one or multiple search terms.
Alternatively, one can specify a single search term via the pattern
argument or multiple search terms by using a string vector as the pattern
or by separating multiple search terms in a single string with ‘,’, ‘;’, or ‘and’.
If matchall=TRUE
(the default), only datasets matching all search terms (if multiple are specified) are returned. If matchall=FALSE
, datasets matching any one of the search terms are returned.
If a single match is found, the corresponding help file is directly shown. If multiple matches are found, the user is prompted to choose one of the matching datasets of interest.
Concept Terms
Each dataset is tagged with one or multiple concept terms that refer to various aspects of a dataset, such as the field/topic of research, the outcome measure used for the analysis, the model(s) used for analyzing the data, and the methods/concepts that can be illustrated with the dataset.
In terms of ‘fields/topics’, the following terms have been used at least once: alternative medicine, attraction, cardiology, climate change, covid-19, criminology, dentistry, ecology, education, engineering, epidemiology, evolution, genetics, human factors, medicine, memory, obstetrics, oncology, persuasion, physics, primary care, psychiatry, psychology, smoking, social work, sociology.
In terms of ‘outcome measures’, the following terms have been used at least once: correlation coefficients, Cronbach's alpha, hazard ratios, incidence rates, raw mean differences, odds ratios, proportions, ratios of means, raw means, risk differences, risk ratios, (semi-)partial correlations, standardized mean changes, standardized mean differences.
In terms of ‘models/methods/concepts’, the following terms have been used at least once: cluster-robust inference, component network meta-analysis, cumulative meta-analysis, diagnostic accuracy studies, dose response models, generalized linear models, longitudinal models, Mantel-Haenszel method, meta-regression, model checks, multilevel models, multivariate models, network meta-analysis, outliers, Peto's method, phylogeny, publication bias, reliability generalization, single-arm studies, spatial correlation, subgroup analysis.
Daniel Noble, [email protected]
Wolfgang Viechtbauer, [email protected]
# note: the examples below are not run since they require interactivity if (FALSE) { # start the function in the interactive mode datsearch() # find all datasets tagged with the concept term 'standardized mean differences' datsearch("standardized mean differences") # find all datasets tagged with the concept terms 'odds ratio' and 'multilevel' datsearch("odds ratio, multilevel") # do a full-text search for the term 'infarct' datsearch("infarct", concept=FALSE) # do a full-text search for 'rma.mv(' (essentially finds all datasets where # the rma.mv() function was used in the examples section of a help file) datsearch("rma.mv(", concept=FALSE) }
# note: the examples below are not run since they require interactivity if (FALSE) { # start the function in the interactive mode datsearch() # find all datasets tagged with the concept term 'standardized mean differences' datsearch("standardized mean differences") # find all datasets tagged with the concept terms 'odds ratio' and 'multilevel' datsearch("odds ratio, multilevel") # do a full-text search for the term 'infarct' datsearch("infarct", concept=FALSE) # do a full-text search for 'rma.mv(' (essentially finds all datasets where # the rma.mv() function was used in the examples section of a help file) datsearch("rma.mv(", concept=FALSE) }