-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
executable file
·70 lines (50 loc) · 4.44 KB
/
README.Rmd
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
---
output: github_document
bibliography: references.yaml
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# metahelpr
<!-- badges: start -->
<!-- badges: end -->
![](hex_metahelpr.png){width="20%"}
The goal of `metahelpr` is to offer tutorials and helper functions for conducting meta-analysis using the `metafor` package [@metafor]. The package contains some helper functions that I often use when I conduct meta-analysis, but I offer no guarantees that they'll actually work for you because I'm not a particularly experienced programmer. Feel free to contribute and make them better and more robust.
## Installation
You can install the development version of `metahelpr` from [GitHub](https://github.com/) with:
``` r
# install.packages("remotes")
remotes::install_github("profandyfield/metahelpr")
```
## Interactive tutorials
I recommend working through [this playlist of tutorials](https://youtube.com/playlist?list=PLEzw67WWDg83weG3idsgy4wuOIJAashA2&si=PiI-sDvqc1DkaWOq) on how to install, set up and work within <img src="./data-raw/images/r_logo.png" width="18"/> and <img src="./data-raw/images/rstudio_logo.png" width="48"/> before starting the interactive tutorials.
- **meta_d**: A tutorial on using the [`metafor` package](https://wviechtb.github.io/metafor/) to conduct a meta-analysis using Cohen's $\hat{d}$ as the effect size measure.
- **meta_r**: A tutorial on using the [`metafor` package](https://wviechtb.github.io/metafor/) to conduct a meta-analysis using Pearson's $r$ as the effect size measure.
## Data files
- `brewin_2024`: Raw data from the meta-analysis by @brewin_meta-analysis_2024.
- `brewin_es`: Reduced dataset from the meta-analysis by @brewin_meta-analysis_2024 that includes effect sizes.
- `pearce_2016`: A selection of variables from the dataset from the meta-analysis by @pearce2016
## Helper functions
The package contains some (probably badly written and easily breakable) helper functions that I often use when I conduct meta-analysis.
- `d_from_r`: estimate Cohen's *d* based on a biserial correlation coefficient, or when a biserial correlation isn't available the conversion uses the method described by @mathur2020.
- `d_to_g`: converts Cohen's *d* to the unbiased Hedges' *g*.
- `forest_add_het_stats`: Add heterogeneity statistics to a forest plot
- `forest_subgroups`: plots a forest plot where effect sizes are split by subcategories of a factor.
- `get_mas`: Fit individual meta-analyses for each level of a categorical predictor and (optionally) collate the results into a tabulated form for printing in a quarto document.
- `get_mod_mas`: does the same thing as `get_mas()` but allows the user to specify a moderator/predictor within the individual meta-analyses. So, it fits individual meta-analyses models with a moderator specified using the `rma.mv()` function from the `metafor` package within each level of a categorical variable. Optionally, the results can be collated into a tabulated form for printing in a quarto document.
- `get_pbm`: fits and collates publication bias models (optionally across categories of a predictor variable). It is assumed that you will supply two vectors of values one representing moderate publication bias and the other representing severe.
- `plot_bubble`: create a bubble plot (using `ggplot2`) based on a `regtest()` object.
- `pooled_var`: computes a full sample variance estimate based on means and variances from two subgroups.
- `regtest_tbl`: puts the results of `metafor::regtest()` into a tibble for reporting.
- `report_het`: collates information from heterogeneity tests and outputs text that summarizes the results in a format that will render nicely in quarto.
- `report_mod`: outputs text that reports (and renders nicely in quarto/Rmarkdown) the omnibus statistical tests from a moderation model.
- `report_par_tbl`: outputs a tibble of the table of coefficients of a meta-analyses object (`rma` or `rma.mv`) created using the `metafor` package. This function will mostly be useful for models containing predictors of effect sizes (so-called meta-regression).
- `report_pars`: outputs text that reports (and renders nicely in quarto/Rmarkdown) the individual effects from a meta-analysis model.
- `var_d_from_r`: Estimate the sampling variance of Cohen's *d* based on a correlation coefficient
## References