Skip to contents

Model fitting and tuning

Functions for fitting empirical Bayes models, tuning hyperparameters, and preparing contingency-table inputs.

pvEBayes()
Fit a general-gamma, GPS, K-gamma, KM or efron model for a contingency table.
pvEBayes_tune()
Select hyperparameter and obtain the optimal general-gamma or efron model based on AIC and BIC
estimate_null_expected_count()
Estimate expected null baseline count based on reference row and column
generate_contin_table()
Generate random contingency tables based on a reference table embedded signals,and possibly with zero inflation

Posterior inference and extraction

Functions for generating posterior draws, computing posterior signal probabilities, and extracting fitted models.

posterior_draws()
Generate posterior draws for each AE-drug combination
get_posterior_prob()
Obtain posterior probability of being a signal
extract_all_fitted_models()
Extract all fitted models from a tuned pvEBayes Object

Model summaries and comparison

S3 methods and helper functions for summarizing fitted pvEBayes objects and comparing fitted models.

summary(<pvEBayes>)
Summary method for a pvEBayes object
summary_table_pvEBayes()
Obtain a summary table for a pvEBayes object
print(<pvEBayes>)
Print method for a pvEBayes object
logLik(<pvEBayes>)
Extract log marginal likelihood for a pvEBayes object
AIC(<pvEBayes>)
Obtain Akaike Information Criterion (AIC) for a pvEBayes object
BIC(<pvEBayes>)
Obtain Bayesian Information Criterion (BIC) for a pvEBayes object

Visualization

Functions for visualizing fitted pvEBayes models, posterior draws, and posterior signal probabilities.

plot(<pvEBayes>)
Plotting method for a pvEBayes object
eyeplot_pvEBayes()
Generate an eyeplot showing the distribution of posterior draws for selected drugs and adverse events
heatmap_pvEBayes()
Generate a heatmap plot visualizing posterior probabilities for selected drugs and adverse events

Example datasets

Example spontaneous reporting system datasets included with the package.

statin2025
FDA statin dataset with 5119 adverse events
statin2025_44
FDA statin dataset with 44 adverse events
statin42
FDA statin dataset with 42 adverse events
gbca2025
FDA GBCA dataset with 1328 adverse events
gbca2025_69
FDA GBCA dataset with 69 adverse events
faers_opioid_mental
FDA opioid dataset with 243 mental-related adverse events
vigi_opioid_mental
VigiBase opioid dataset with 100 mental-related adverse events

Package overview

pvEBayes-package
A suite of empirical Bayes methods to use in pharmacovigilance.