knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The metamedian
package implements methods to meta-analyze studies that report estimates of the median of the outcome of interest.
This package implements several methods to directly meta-analyze studies reporting sample medians. When the primary studies are one-group studies, the methods of McGrath et al. (2019) and Ozturk and Balakrishnan (2020) can be applied to estimate the pooled median. In the two-group context, the methods of McGrath et al. (2020a) can be applied to estimate the pooled difference of medians between groups.
The package also implements methods to meta-analyze median survival times. The package can apply the methods described by McGrath et al. (2025) to meta-analyze the median survival time, difference of median survival times between groups, and the ratio of median survival times between groups.
These methods estimate the study-specific means and their standard errors from studies reporting sample medians in order to estimate the pooled (difference of) means. Specifically, one can apply the following methods:
You can install the released version of metamedian
from CRAN with:
install.packages("metamedian")
After installing the devtools
package (i.e., calling install.packages(devtools)
), the development version of metamedian
can be installed from GitHub with:
devtools::install_github("stmcg/metamedian")
See McGrath et al. (2024) for a detailed guide on using the metamedian
package. Below, we include the code used in the main examples in the paper. The examples are based on the dataset dat.age
included in the package.
Loading the package:
library(metamedian)
Setting a random number seed for reproducibility:
set.seed(1234)
describe_studies(data = dat.age, group_labels = c ("Nonsurvivors", "Survivors"))
The analyses below may take 5-10 minutes to run on a standard laptop. For faster runtime, consider using fewer bootstrap replicates for the QE, BC, and MLN methods.
res_wan <- metamean(dat.age, mean_method = "hozo/wan/bland") res_luo <- metamean(dat.age, mean_method = "luo") res_shi <- metamean(dat.age, mean_method = "shi_lognormal") res_qe_mean <- metamean(dat.age, mean_method = "qe") res_bc <- metamean(dat.age, mean_method = "bc") res_mln <- metamean(dat.age, mean_method = "mln") res_yang <- metamean(dat.age, mean_method = "yang")
The output of res_mln
is illustrated below:
res_mln
res_mm <- metamedian(dat.age, median_method = "mm") res_wm <- metamedian(dat.age, median_method = "wm") res_qe_median <- metamedian(dat.age, median_method = "qe")
The output of res_qe_median
is illustrated below:
res_qe_median
To cite this package, use:
McGrath S, Zhao X, Ozturk O, Katzenschlager S, Steele R, Benedetti A. metamedian: An R package for meta-analyzing studies reporting medians. Research Synthesis Methods. 2024; 15(2):332-346. doi:10.1002/jrsm.1686
For a BibTeX citation, use:
@article{mcgrath2024metamedian, title={metamedian: An R package for meta-analyzing studies reporting medians}, author={McGrath, Sean and Zhao, XiaoFei and Ozturk, Omer and Katzenschlager, Stephan and Steele, Russell and Benedetti, Andrea}, journal={Research Synthesis Methods}, volume={15}, number={2}, pages={332--346}, year={2024}, publisher={Wiley Online Library} }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.