Learn R Programming

BayesianHybridDesign (version 0.1.0)

power.DPP: Power Calculation for Bayesian Hybrid Design

Description

Calculates statistical power and other design parameters for a Bayesian Hybrid Design using a dynamic power prior approach, based on simulations.

Usage

power.DPP(
  pt,
  nt,
  pc,
  nc,
  pc.calib,
  pch,
  nche,
  nch,
  alpha = 0.1,
  tau = NULL,
  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 = 1e+05,
  seed = NULL
)

Value

A large list containing the power, the calibrated tau, all input parameters, and detailed simulation results such as:

power

The calculated statistical power.

tau

The calibrated significance threshold.

pc.PMD, pc.sd.PMD

The mean and standard deviation of the posterior mean difference between the hybrid and concurrent controls.

delta.bound

The minimum detectable difference in response rates.

phat_pt_larger_pc_all

A vector of posterior probabilities P(pt > pc | data) for each of the nsim simulations.

mean_hca, mean_c

Vectors of the posterior means for the hybrid and concurrent control arms for each simulation.

simulated.data

A matrix of the simulated response counts used.

w

A vector of the final borrowing weights used in each simulation.

...

and all input parameters.

Arguments

pt, pc

Numerics. The response rates for the experimental and control arms, respectively.

nt, nc

Integers. The sample sizes for the experimental and control arms, respectively.

pc.calib

A scalar numeric. The control response rate assumed for calibrating the type I error threshold, tau. Often pc.calib = pch.

pch, nch

Numeric and integer. The response rate and sample size of the historical control arm.

nche

An integer. The effective number of subjects to be borrowed, used for calculating the global borrowing weight.

alpha

A scalar numeric. The one-sided Type I error rate, used for calibration if tau is not provided.

tau

(Optional) A scalar numeric. The pre-calibrated threshold for statistical significance. If NULL, it will be calculated internally.

a0c, b0c, a0t, b0t

Numerics. Hyperparameters for the Beta priors on the response rates.

delta_threshold

A scalar numeric. The similarity threshold for borrowing.

method

A string specifying the dynamic borrowing method.

theta, eta

Numerics. Additional parameters for certain borrowing methods.

datamat

(Optional) A matrix with nsim rows and 2 columns (experimental, control) of pre-simulated response counts.

w0

(Optional) A scalar numeric. A fixed borrowing weight to override the dynamic calculation.

nsim

An integer. The number of simulations to run.

seed

An integer. A seed for the random number generator. Default NULL.

Examples

Run this code
# \donttest{
o <- power.DPP(pt=0.5, nt=40, pc=0.3, nc=40, pc.calib = 0.3, pch=0.3,
               nche=40, nch=180, alpha=0.1, nsim = 1000, seed=2000) # nsim is reduced
# }

Run the code above in your browser using DataLab