knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%", dpi = 320, fig.width = 5 )
The goal of metaconfoundr is to make it easy to visualize confounding control in meta-analyses. Researchers use a causal diagram to assess factors that are required to control for to estimate an effect unbiased by confounding. Then, the researchers create a data frame of confounding variables and how well each study in the meta-analysis controlled for each: adequately, inadequately, or with some control. See the vignette on collecting confounder data for more information.
In addition to the package, metaconfoundr ships with a Shiny app to help create visualizations. You can start the app locally with launch_metaconfoundr_app()
or use the hosted version.
Install the most recent released version of metaconfoundr from CRAN:
install.packages("metaconfoundr")
You can install the development version of metaconfoundr from GitHub with:
# if needed # install.packages("remotes") remotes::install_github("malcolmbarrett/metaconfoundr")
metaconfoundr includes an example dataset, ipi
, that contains information on a meta-analysis of interpregnancy interval and the risk of preterm birth. Use metaconfoundr()
to prepare the dataset to work with metaconfoundr functions. ipi
includes several domains of confounders, but for ease of visualization, we will just show one, Sociodemographics
.
library(metaconfoundr) mc_ipi <- metaconfoundr(ipi) %>% dplyr::filter(construct == "Sociodemographics") mc_ipi
metaconfoundr includes several tools for visualizing the results of a confounding control assesment. The most common are mc_heatmap()
and mc_trafficlight()
.
mc_heatmap(mc_ipi) mc_trafficlight(mc_ipi)
These plotting functions return ggplots, so they are easy to modify.
mc_heatmap(mc_ipi) + theme_mc() + ggplot2::guides(x = ggplot2::guide_axis(n.dodge = 2))
metaconfoundr also includes geoms and scales to make output similar to other types of bias assessments for meta-analyses.
mc_trafficlight(mc_ipi) + theme_mc() + geom_cochrane() + scale_fill_cochrane() + ggplot2::guides(x = ggplot2::guide_axis(n.dodge = 2))
For working with common assessments of bias in studies, such as the ROBINS tool, see the excellent robvis package.
Please note that the metaconfoundr project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.