Description
The NAPrior package facilitates the implementation of the Network Meta-Analytic Predictive (NAP) prior framework, specifically designed to address changes in the Standard of Care (SoC) during ongoing randomized controlled trials (RCTs). The framework synthesizes in-trial data from both pre- and post-SoC change periods by leveraging external trial data—specifically the head-to-head comparisons between the original and new SoC that established the new SoC—to bridge the two phases of evidence.
To ensure robust inference, the package implements two robustified priors: (i) the mixture NAP (mNAP), which incorporates a noninformative prior via a fixed mixing weight, and (ii) the elastic NAP (eNAP), which adaptively adjusts mixing weight and information borrowing based on the consistency between direct and indirect evidence. The NAP framework is fully prespecifiable, easy to calibrate, and computationally straightforward. This package provides a comprehensive toolkit to calibrate eNAP tuning parameters, generate NAP priors, simulate operating characteristics, and obtain posterior distributions.
Installation
System requirements
The NAPrior package fits Bayesian models using JAGS via the
R2jags interface.
Please ensure that JAGS is installed on your system before running model
functions.
- macOS:
brew install jags - Ubuntu/Debian:
sudo apt-get install jags - Windows: https://mcmc-jags.sourceforge.io/
Install and load
install.packages("devtools") devtools::install_github("EstravenZZZ/NAPrior")
library(NAPrior)Quick start
Consider a scenario in which the SoC changes mid-trial in a registrational or pivotal RCT that was initially designed to compare an experimental treatment