Analysis code for a Bayesian meta-analysis comparing general anesthesia (GA) vs conscious sedation / non-GA during endovascular thrombectomy (EVT) for acute ischemic stroke, based on randomized controlled trials.
- Primary: mRS 0–2 at 90 days (functional independence)
- Secondary (binary): mRS 0–1, mortality at 90 days, TICI 2b–3 (successful reperfusion), symptomatic ICH, pneumonia, hypotension
- Secondary (continuous): Hospital length of stay, ICU length of stay, NIHSS change (24h – baseline)
All primary analyses use Bayesian random-effects meta-analysis via the bayesmeta R package with weakly informative priors:
| Parameter | Binary outcomes (OR) | Continuous outcomes (MD) |
|---|---|---|
| Effect prior (mu) | N(0, 1.5) | N(0, 5) |
| Heterogeneity prior (tau) | Half-normal(0, 0.5) | Half-normal(0, 2) |
Results are reported as posterior median with 95% credible intervals (CrI) and the posterior probability of benefit for GA, P(benefit).
R/
run_all.R # Master script (sources everything in order)
meta_analysis.R # Primary Bayesian meta-analyses for all outcomes
publication_bias.R # Harbord's test (binary) / Egger's test (continuous)
meta_regression.R # Bayesian meta-regression (mortality, TICI 2b-3)
sensitivity_analyses.R # Low RoB, anterior only, HKSJ, leave-one-out
trial_sequential_analysis.R # TSA for mRS 0-2
data/
data_prepared.xlsx # Template with column definitions (no patient data)
Scripts must be run sequentially (each depends on objects from prior scripts). Use source("R/run_all.R") to run the full pipeline.
The analysis expects a file data/data_prepared.xlsx with one row per study. The included template shows the required column structure with example values. Replace the example rows with your extracted study data.
R >= 4.1 with the following packages:
install.packages(c(
"readxl", "tidyverse", "writexl",
"bayesmeta", "metafor",
"RTSA"
))# Set working directory to the project root
setwd("path/to/this/repo")
# Run full analysis pipeline
source("R/run_all.R")
# Or run individual scripts
source("R/meta_analysis.R") # creates bma_* objects
source("R/publication_bias.R") # requires bma_* from meta_analysis.RThis code is provided for academic reproducibility. Please cite the associated publication if you use or adapt this code.