Learn R Programming

BayesianHybridDesign (version 0.1.0)

calibration: Calibration for Bayesian Hybrid Design

Description

This function calculates the threshold tau for calibration of Bayesian Hybrid Design. P(pt>pc|hybrid data)>tau is used to determine statistical significance.

Usage

calibration(
  nt,
  pc.calib,
  nc,
  pch,
  nche,
  nch,
  alpha = 0.1,
  a0c = 0.001,
  b0c = 0.001,
  a0t = 0.001,
  b0t = 0.001,
  delta_threshold = 0.1,
  method = "Empirical Bayes",
  theta = 0.5,
  eta = 1,
  datamat = NULL,
  w0 = NULL,
  nsim = 10000,
  seed = NULL
)

Value

The scalar threshold for statistical significance that can control the type I error (1-sided)

Arguments

nt

A scalar number of patients in experimental arm in current study

pc.calib

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

nc

A scalar number of patients in control arm in current study

pch

A scalar. Response rate for control treatment in historical study

nche

A scalar representing the equivalent number of patients borrowed from historical study

nch

A scalar for total number of patients in historical control

alpha

A scalar. One sided type I error rate.

a0c

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

b0c

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

a0t

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

b0t

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

delta_threshold

A scale threshold parameter. Only if abs(pc (current study) - pch) <= delta_threshold, we borrow from historical control. Default 0.1.

method

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

theta

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

eta

A scalar parameter with a range of (0, infty), and applicable to methods "Bayesian p", "Generalized BC", "JSD". Default 1.

datamat

A matrix with dimension nsim * 2 containing pre-simulated data for the experimental arm (column 1) and control arm (column 2), respectively. Default is NULL, and binomial random Monte Carlo samples will be generated in the function.

w0

A scale prior power parameters w. If not specified (default), w_d is calculated by the specified method for dynamic borrowing.

nsim

A scalar. Number of replications to calculate power

seed

A scalar. seed for simulations

Examples

Run this code
# \donttest{
  tau <- calibration(nt=40, pc.calib=0.3, nc=40,
                     pch=0.3, nche=40, nch=200,
                     alpha = 0.10,
                     a0c=0.001, b0c=0.001, a0t=0.001, b0t=0.001,
                     delta_threshold=0.1,
                     method="Empirical Bayes", theta=0.5, eta=1,
                     nsim = 1000, seed=2000) # nsim reduced for quick example
# }

Run the code above in your browser using DataLab