R-script for Bayesian meta-analysis and meta-regression analysis

#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 input
library (xlsx)       # For data input
library(tidyverse)   #It includes "ggplot2","dplyr","tidyr","readr", "stringr', etc packages
library(dplyr)
library(DescTools)   #Tools for descriptive statistics, data visualization, and various statistical analyses
library(binom)       #Binary data and binomial distributions. helps to calculate 95%CI
library(forcats)
library (gtsummary)  # generating tables
library(gt)          # generating tables
library(metafor)     # Frequentist meta-analysis 
library(meta)        # Frequentist meta-analysis, includes Q-statistics and I-square
library(brms)        #For Bayesian models for meta-analysis and meta-regression
library(bayesmeta)   #Facilitates Bayesian meta-analysis
library(rstan)       #To fit complex statistical models using Bayesian inference
library(rstantools)  #For working with RStan
library(bayestestR)  #For interpreting Bayesian models and isualization of results
library(posterior)   #For summarizing and visualizing posterior distributions and diagnostics
library(bayesplot)   #For creating plots to visualize Bayesian model results
library(ggdist)      #To extend ggplot2 to include geoms for visualizing distributions
library(ggridges)    # For comparing distributions in Bayesian modeling
library(glue)        #To construct strings with embedded expressions; easy formating
library(stringr)
library(webshot2)    #R-Markdown:To include screenshots directly in reports or presentations
library(tiff)        #R-Markdown: Reading and writing TIFF (Tagged Image File Format) files
library(knitr)       #R-Markdown: file knitting
library(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.

2 (this script is under development)