-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathREADME.Rmd
More file actions
80 lines (59 loc) · 3.27 KB
/
Copy pathREADME.Rmd
File metadata and controls
80 lines (59 loc) · 3.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# estmeansd: Estimating the Sample Mean and Standard Deviation from Commonly Reported Quantiles in Meta-Analysis
[](https://cran.r-project.org/package=estmeansd)
[](https://www.r-pkg.org/pkg/estmeansd)
[](https://www.r-pkg.org/pkg/estmeansd)
The `estmeansd` package implements the methods of [McGrath et al. (2020)](https://doi.org/10.1177/0962280219889080) and [Cai et al. (2021)](https://doi.org/10.1177/09622802211047348) for estimating the sample mean and standard deviation from commonly reported quantiles in meta-analysis. Specifically, these methods can be applied to studies that report one of the following sets of summary statistics:
* S1: median, minimum and maximum values, and sample size
* S2: median, first and third quartiles, and sample size
* S3: median, minimum and maximum values, first and third quartiles, and sample size
This package also implements the methods described by [McGrath et al. (2023)](https://doi.org/10.1177/09622802221139233) to estimate the standard error of these mean and standard deviation estimators. The estimated standard errors are needed for computing the weights in conventional inverse-variance weighted meta-analysis approaches.
Additionally, the Shiny app [estmeansd](https://smcgrath.shinyapps.io/estmeansd/) implements these methods.
Note that the R package [metamedian](https://CRAN.R-project.org/package=metamedian) can apply these methods (as well as several others) to perform a meta-analysis. See [McGrath et al. (in press)](https://doi.org/10.1002/jrsm.1686) for a guide on using the `metamedian` package.
## Installation
You can install the released version of `estmeansd` from CRAN with:
``` r
install.packages("estmeansd")
```
After installing the `devtools` package (i.e., calling `install.packages(devtools)`), the development version of `estmeansd` can be installed from GitHub with:
``` r
devtools::install_github("stmcg/estmeansd")
```
## Usage
Specifically, this package implements the Box-Cox (BC), Quantile Estimation (QE), and Method for Unknown Non-Normal Distributions (MLN) approaches to estimate the sample mean and standard deviation. The BC, QE, and MLN methods can be applied using the `bc.mean.sd()` `qe.mean.sd()`, and `mln.mean.sd()` functions, respectively:
```{r}
library(estmeansd)
set.seed(1)
# BC Method
res_bc <- bc.mean.sd(min.val = 2, med.val = 4, max.val = 9, n = 100)
res_bc
# QE Method
res_qe <- qe.mean.sd(min.val = 2, med.val = 4, max.val = 9, n = 100)
res_qe
# MLN Method
res_mln <- mln.mean.sd(min.val = 2, med.val = 4, max.val = 9, n = 100)
res_mln
```
To estimate the standard error of these mean estimators, we can apply the `get_SE()` function as follows:
```{r}
# BC Method
res_bc_se <- get_SE(res_bc)
res_bc_se$est.se
# QE Method
res_qe_se <- get_SE(res_qe)
res_qe_se$est.se
# MLN Method
res_mln_se <- get_SE(res_mln)
res_mln_se$est.se
```