knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
robvis
now provides some functionality to work with the results of meta-analyses performed using the metafor
package.
First let's load the relevant packages and define our datasets:
library(robvis) library(metafor) library(dplyr) # Define your studies, using the BCG dataset included in the metadat package dat_bcg <- metadat::dat.bcg glimpse(dat_bcg) # Create some example data for ROB2 using rob_dummy(), and add it to the BCG # data. # We don't need a "Study" column for this example, so we set `study = FALSE` dat_rob <- rob_dummy(13, "ROB2", study = FALSE) dat_analysis <- cbind(dat_bcg, dat_rob) glimpse(dat_analysis)
Now each row in the dataset contains a single numerical result and it's corresponding risk-of-bias assessment.
Let's now perform a simple random-effects meta-analysis using metafor::rma()
:
# Calculate effect estimates and sampling variances for each study dat_analysis <- metafor::escalc( measure = "RR", ai = tpos, bi = tneg, ci = cpos, di = cneg, data = dat_analysis ) # Perform the meta-analysis res <- metafor::rma(yi, vi, data = dat_analysis, slab = paste(author, year)) # Explore the results res
Having performed the meta-analysis, you can now append a risk-of-bias traffic-light plot onto the standard output from metafor::forest()
by simply passing the results object (res
) to rob_forest()
:
rob_forest(res, rob_tool = "ROB2")
This function is designed to make it as easy as possible to substitute rob_forest()
for metafor::forest()
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.