R-script for Bayesian meta-analysis and meta-regression analysis
Code
#If needed install all packages listed below:#install.packages (c("readxl","xlsx","tidyverse","DescTools","binom","gtsummary","gt","metafor","meta","brms","bayesmeta","rstan","rstantools","bayestestR","posterior","bayesplot","ggdist","ggridges","glue","webshot2","tiff","knitr","loo"))library (readxl) # For data inputlibrary (xlsx) # For data inputlibrary(tidyverse) #It includes "ggplot2","dplyr","tidyr","readr", "stringr', etc packageslibrary(dplyr)library(DescTools) #Tools for descriptive statistics, data visualization, and various statistical analyseslibrary(binom) #Binary data and binomial distributions. helps to calculate 95%CIlibrary(forcats)library (gtsummary) # generating tableslibrary(gt) # generating tableslibrary(metafor) # Frequentist meta-analysis library(meta) # Frequentist meta-analysis, includes Q-statistics and I-squarelibrary(brms) #For Bayesian models for meta-analysis and meta-regressionlibrary(bayesmeta) #Facilitates Bayesian meta-analysislibrary(rstan) #To fit complex statistical models using Bayesian inferencelibrary(rstantools) #For working with RStanlibrary(bayestestR) #For interpreting Bayesian models and isualization of resultslibrary(posterior) #For summarizing and visualizing posterior distributions and diagnosticslibrary(bayesplot) #For creating plots to visualize Bayesian model resultslibrary(ggdist) #To extend ggplot2 to include geoms for visualizing distributionslibrary(ggridges) # For comparing distributions in Bayesian modelinglibrary(glue) #To construct strings with embedded expressions; easy formatinglibrary(stringr)library(webshot2) #R-Markdown:To include screenshots directly in reports or presentationslibrary(tiff) #R-Markdown: Reading and writing TIFF (Tagged Image File Format) fileslibrary(knitr) #R-Markdown: file knittinglibrary(loo) knitr::opts_chunk$set(include =FALSE)
1 Background
Neurocysticercosis (NCC) is a zoonotic infection of the human central nervous system caused by the larval stage (cysticercus) of Taenia solium, a parasitic tapeworm that infects both humans and pigs. In 2010, Ndimubanzi et al. estimated that the prevalence of NCC among people with epilepsy (PWE) was 29%, based on a systematic review and meta-analysis of studies published between January 1, 1990, and June 1, 2008.
To update this estimate using more recent data, we recently completed a follow-up systematic review, meta-analysis, and meta-regression of the literature on NCC frequency published between January 1, 1990, and May 9, 2023. These analyses aimed to provide an updated pooled estimate and to explore the sources of heterogeneity observed across studies.
This document provides necessary R-codes to estimate the proportion of NCC among people with epileptic seizures (PWES).
For the paper, all analyses were performed using RStudio (version 2024.04.2, Build 764) and R (version 4.4.2). While the code should run smoothly, differences in R or RStudio versions might affect compatibility in some cases.