Learn R Programming

BayesianHybridDesign (version 0.1.0)

DPP: Bayesian Hybrid Design using Dynamic Power Prior Framework

Description

This function calculates the sample size and Bayesian hybrid design parameters using dynamic power prior framework.

Usage

DPP(
  pt,
  pc,
  pch,
  pc.calib,
  nch,
  nc.range = NULL,
  r,
  q,
  alpha = 0.1,
  power = 0.8,
  delta_threshold = 0.1,
  method = "Empirical Bayes",
  theta = 0.5,
  eta = 1,
  a0c = 0.001,
  b0c = 0.001,
  a0t = 0.001,
  b0t = 0.001,
  nsim = 1e+05,
  seed = NULL
)

Value

An object with values

  • alpha: nominal type I error rate

  • power: The calculated power by simulation.

  • type1err: empirical type I error rate.

  • tau: The calibrated threshold for statistical significance.

  • nt: sample size for experimental arm

  • nc: sample size for control arm

  • nche: maximum amount of borrowing in terms of number of subjects

  • delta.bound: significance boundary of delta between the study experimental group and study control group

  • mean.PMD: mean of posterior mean difference over nsim estimates

  • sd.PMD: standard deviation of posterior mean difference over nsim estimates

  • mean_pc_hca: a vector of nsim length. Storing the posterior means of pc based on hybrid control for nsim replications.

  • mean_pc_c: a vector of nsim length. Storing the posterior means of pc based on study control for nsim replications.

Arguments

pt

A scalar. Response rate for experimental arm in current study.

pc

A scalar. Response rate for control arm in current study.

pch

A scalar. Response rate for control treatment in historical study.

pc.calib

A scalar. Response rate for control arm in current study for calibration. Usually, pc.calib = pch.

nch

A scalar. Total number of patients in historical control.

nc.range

A vector with length = 2. Search range for nc. Default is NULL, and the range will be automatically determined.

r

A scalar. Randomization ratio for current study. r=1 means 1:1 and r=2 means 2:1.

q

A scalar. Specification of n_che in terms of times of nc; i.e. n_che = q*nc. Usually, q >= 1 and q <= nch/n_che.

alpha

A scalar. One sided type I error rate.

power

A scalar. Power. Default 0.8.

delta_threshold

Borrow when abs(pc_hat (current study) - pch) <= delta_threshold. Default 0.1.

method

A string characters. Method for dynamic borrowing, "Empirical Bayes", "Bayesian p", "Generalized BC", "JSD". Default "Empirical Bayes".

theta

A scalar parameter with a range of (0, 1), and applicable to method: "Generalized BC". Default 0.5.

eta

A scalar parameter with a range of (0, infty), and applicable to method: "Bayesian p", "Generalized BC", "JSD". "Generalized BC" method requires two parameters theta and eta. Default 1.

a0c

A scalar. Hyperprior for control response rate beta(a0c, b0c). Default 0.001.

b0c

A scalar. Hyperprior for control response rate beta(a0c, b0c). Default 0.001.

a0t

A scalar. Hyperprior for experimental response rate beta(a0t, b0t). Default 0.001.

b0t

A scalar. Hyperprior for experimental response rate beta(a0t, b0t). Default 0.001.

nsim

A scalar. Number of replications to calculate power. Default 100,000.

seed

A scalar. seed for simulations. Default NULL.

Examples

Run this code
# \donttest{
o <- DPP(pt = 0.5, pc = 0.3, pch = 0.3, pc.calib = 0.3, nch = 200, nc.range = NULL,
         r = 2, q = 1, alpha = 0.1, power = 0.8,
         delta_threshold = 0.1,
         method = "Empirical Bayes", theta = 0.5, eta = 1,
         a0c = 0.001, b0c = 0.001, a0t = 0.001, b0t = 0.001,
         nsim = 1000, seed = 2000)
print(o)
# }

Run the code above in your browser using DataLab