pvEBayespvEBayes is an R package that implements a suite ofnonparametric empirical Bayes methods for pharmacovigilance, includingGamma-Poisson Shrinker (GPS), K-gamma, general-gamma, Koenker-Mizera(KM), and Efron models. It provides tools for fitting these models tothe spontaneous reporting system (SRS) frequency tables, extractingsummaries, performing hyperparameter tuning, and generating graphicalsummaries (eye plots and heatmaps) for signal detection andestimation.
Spontaneous Reporting System (SRS) Table: An drugsafety SRS dataset catalogs AE reports onI AE rows acrossJ drug columns. Let
Empirical Bayes modeling for disproportionalityanalysis: We assume that for each AE-drug pair,
In addition tosignal detection, Tan et al. (Stat. inMed., 2025) broaden the role of disproportionality tosignalestimation. The use of the flexible non-parametric empirical Bayesmodels enables more nuanced empirical Bayes posterior inference(parameter estimation and uncertainty quantification) on signal strengthparameter\(\{ \lambda_{ij} \}\). Thisallows researchers to distinguish AE-drug pairs that would appearsimilar under a binary signal detection framework. For example, theAE-drug pairs with signal strengths of 1.5 and 4.0 could both besignificantly greater than 1 and detected as a signal. Such differencesin signal strength may have distinct implications in medical andclinical contexts.
The methods included inpvEBayes differ by theirassumptions on the prior distribution. Implemented methods include theGamma-Poisson Shrinker (GPS), Koenker-Mizera (KM) method, Efron’snonparametric empirical Bayes approach, the K-gamma model, and thegeneral-gamma model. The selection of the prior distribution is criticalin Bayesian analysis. The GPS model uses a gamma mixture prior byassuming the signal/non-signal structure in SRS data. However, inreal-world setting, signal strengths
Implementations: The KM method has an existingimplementation in theREBayes package, but it relies onMosek, a commercial convex optimization solver, which may limitaccessibility due to licensing issues. ThepvEBayes packageprovides an alternative fully open-source implementation of the KMmethod usingCVXR. Efron’s method also has a generalnonparametric empirical Bayes implementation in thedeconvolveR package; however, that implementation does notsupport an exposure or offset parameter in the Poisson model, whichcorresponds to the expected null valuepvEBayes, theimplementation of Efron’s method is adapted and modified fromdeconvolveR to support
In addition, this package implements the novel bi-level ExpectationConditional Maximization (ECM) algorithm proposed by Tan et al. (2025)for efficient parameter estimation in gamma mixture prior based modelsmentioned above.
The stable version ofpvEBayes can be installed fromCRAN:
install.packages("pvEBayes")The development version is available from GitHub:
# if (!requireNamespace("devtools")) install.packages("devtools")devtools::install_github("YihaoTancn/pvEBayes")Here is a minimal example analyzing the built-in FDA statin44 datasetwith general-gamma model:
library(pvEBayes)# Load the statin44 contingency table of 44 AEs for 6 statinsdata("statin2025_44")# Fit a general-gamma model with a specified alphafit <- pvEBayes( contin_table = statin2025_44, model = "general-gamma", alpha = 0.3, n_posterior_draws = 1000)# Print out a concise description of the fitted modelfit# Obtain a logical matrix for the detected signalsummary(fit, return = "detected signal")# Visualize posterior distributions for top AE-drug pairsplot(fit, type = "eyeplot")For a more detailed illustration, please see ‘Vignette’.
pvEBayes is released under the GPL-3 license. See‘LICENSE.md’ for details.
Please note that thepvEBayes project is released with aContributorCode of Conduct. By contributing to this project, you agree to abideby its terms.
Tan Y, Markatou M and Chakraborty S. Flexible Empirical BayesianApproaches to Pharmacovigilance for Simultaneous Signal Detection andSignal Strength Estimation in Spontaneous Reporting Systems Data.Statistics in Medicine. 2025; 44: 18-19,https://doi.org/10.1002/sim.70195.
Tan Y, Markatou M and Chakraborty S. pvEBayes: An R Package forEmpirical Bayes Methods in Pharmacovigilance.arXiv:2512.01057(stat.AP). https://doi.org/10.48550/arXiv.2512.01057
Koenker R, Mizera I. Convex Optimization, Shape Constraints, CompoundDecisions, and Empirical Bayes Rules.Journal of the AmericanStatistical Association 2014; 109(506): 674–685,https://doi.org/10.1080/01621459.2013.869224
Efron B. Empirical Bayes Deconvolution Estimates.Biometrika2016; 103(1); 1-20, https://doi.org/10.1093/biomet/asv068
DuMouchel W. Bayesian data mining in large frequency tables, with anapplication to the FDA spontaneous reporting system.The AmericanStatistician. 1999; 1;53(3):177-90.