MyNixOS website logo
Description

Implementation of the Bayesian Discount Prior Approach for Clinical Trials.

Functions for data augmentation using the Bayesian discount prior method for single arm and two-arm clinical trials, as described in Haddad et al. (2017) <doi:10.1080/10543406.2017.1300907>. The discount power prior methodology was developed in collaboration with the The Medical Device Innovation Consortium (MDIC) Computer Modeling & Simulation Working Group.

bayesDP

CRAN_Status_Badge Downloads License R-CMD-check Codecov testcoverage

bayesDP implements the Bayesian discount prior approach for borrowing historical information in one-arm and two-arm clinical trials. The package supports binomial, normal, survival, linear-model, and logistic-regression settings, and provides plotting and summary methods for inspecting posterior estimates and discount weights.

The method adaptively discounts historical information according to the agreement between current and historical data. See Haddad et al. (2017) for methodological details.

Links

Installation

Install the released version from CRAN:

install.packages("bayesDP")

Install the development version from GitHub:

# install.packages("remotes")
remotes::install_github("graemeleehickey/bayesDP")

Supported analyses

FunctionOutcome / modelTypical use
bdpbinomial()Binomial responseEvent rates and proportions
bdpnormal()Normal summary statisticsContinuous endpoints with known summaries
bdpsurvival()Survival responseTime-to-event endpoints
bdplm()Linear modelIndividual-level continuous outcomes
bdplogit()Logistic regressionIndividual-level binary outcomes

Basic examples

Binomial endpoint

library(bayesDP)
#> Loading required package: ggplot2
#> Loading required package: survival

fit_bin <- bdpbinomial(
  y_t = 10, N_t = 500,
  y0_t = 25, N0_t = 250,
  method = "fixed"
)

summary(fit_bin)
#> 
#>     One-armed bdp binomial
#> 
#> Current treatment data: 10 and 500
#> Historical treatment data: 25 and 250
#> Stochastic comparison (p_hat) - treatment (current vs. historical data): 0
#> Discount function value (alpha) - treatment: 0
#> 95 percent CI: 
#>  0.011  0.0362
#> sample estimates:
#>  0.0211

Normal endpoint

fit_norm <- bdpnormal(
  mu_t = 30, sigma_t = 10, N_t = 250,
  mu0_t = 50, sigma0_t = 5, N0_t = 250,
  method = "fixed"
)

summary(fit_norm)
#> 
#>     One-armed bdp normal
#> 
#> data:
#>   Current treatment: mu_t = 30, sigma_t = 10, N_t = 250
#>   Historical treatment: mu0_t = 50, sigma0_t = 5, N0_t = 250
#> Stochastic comparison (p_hat) - treatment (current vs. historical data): 0
#> Discount function value (alpha) - treatment: 0
#> 95 percent CI: 
#>  28.7373  31.2483
#> posterior sample estimate:
#> mean of treatment group
#>  29.9928

Individual-level linear model

set.seed(2710)
n_t <- 30
n_c <- 30
n_t0 <- 80
n_c0 <- 80

treatment <- c(rep(1, n_t), rep(0, n_c))
treatment0 <- c(rep(1, n_t0), rep(0, n_c0))
x <- rnorm(n_t + n_c, 1, 5)
x0 <- rnorm(n_t0 + n_c0, 1, 5)

Y <- 10 + 31 * treatment + 3 * x + rnorm(n_t + n_c, 0, 5)
Y0 <- 10 + 30 * treatment0 + 3 * x0 + rnorm(n_t0 + n_c0, 0, 5)

df <- data.frame(Y = Y, treatment = treatment, x = x)
df0 <- data.frame(Y = Y0, treatment = treatment0, x = x0)

fit_lm <- bdplm(Y ~ treatment + x, data = df, data0 = df0, method = "fixed")
summary(fit_lm)
#> 
#> Call:
#> bdplm(formula = Y ~ treatment + x, data = df, data0 = df0, method = "fixed")
#> 
#> Residuals:
#>      Min     1Q Median    3Q   Max
#>  -11.455 -1.249  2.773 6.652 14.12
#> 
#> Coefficients:
#>             Estimate Std. Error
#> (Intercept)   9.8228     0.6956
#> treatment    32.3783     1.1265
#> x             3.1145     0.1299
#> 
#> Discount function value (alpha):
#>  treatment control
#>       0.07  0.3812
#> 
#> Residual standard error: 5.4394

Citation

If you use bayesDP, please cite the package and the methodological paper:

citation("bayesDP")
Metadata

Version

1.3.8

License

Unknown

Platforms (79)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    wasip1
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasip1
  • wasm64-wasip1
  • x86_64-cygwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows