Funnel Plots with MAIVE

Overview

get_funnel_plot() draws a base-graphics funnel plot using the original meta-analysis inputs and a fitted MAIVE/WAIVE result. Device management (e.g., png(), svg(), pdf(), base64 encoding) is left to you so you can embed the graphic wherever you need.

For a guided, interactive workflow, visit https://www.easymeta.org.

What it shows:

Required inputs

get_funnel_plot(dat, result, instrument = NULL, model_type = "MAIVE")

Minimal synthetic example (quick to run)

The code below is set to eval = FALSE to keep the vignette fast. Run it interactively to produce the plot.

library(MAIVE)

set.seed(123)
n <- 40
dat <- data.frame(
  bs = rnorm(n, mean = 0.2, sd = 0.25),
  sebs = runif(n, min = 0.05, max = 0.3),
  Ns = sample(80:800, n, replace = TRUE),
  study_id = rep(1:10, each = 4)
)

# Fit MAIVE (instrumented PET-PEESE, no weights, cluster-robust, wild bootstrap)
res <- maive(
  dat = dat,
  method = 3,
  weight = 0,
  instrument = 1,
  studylevel = 2,
  SE = 3,
  AR = 1
)

# Draw to the current device
get_funnel_plot(dat = dat, result = res, model_type = "MAIVE")

Saving to file (PNG example)

Device control is up to you; this pattern works for PNG. Replace png() with svg()/pdf() as needed.

png("maive-funnel.png", width = 1800, height = 1400, res = 200)
get_funnel_plot(dat = dat, result = res, model_type = "MAIVE")
dev.off()

Interpreting the plot

Tips and edge cases

See also