Simulation for time-to-event outcome for Bayesian Adaptive trial with different inputs to control for power, sample size, type 1 error rate, etc.

survivalBACT(
  hazard_treatment,
  cutpoint = NULL,
  hazard_control = NULL,
  N_total,
  breaks = NULL,
  time0 = NULL,
  treatment0 = NULL,
  event0 = NULL,
  lambda = 0.3,
  lambda_time = NULL,
  interim_look = NULL,
  EndofStudy,
  prior = c(0.1, 0.1),
  block = 2,
  rand_ratio = c(1, 1),
  prop_loss_to_followup = 0.1,
  alternative = "greater",
  h0 = 0,
  futility_prob = 0.05,
  expected_success_prob = 0.9,
  prob_ha = 0.95,
  N_impute = 10,
  number_mcmc = 10000,
  discount_function = "identity",
  alpha_max = 1,
  fix_alpha = FALSE,
  weibull_scale = 0.135,
  weibull_shape = 3,
  method = "fixed"
)

Arguments

hazard_treatment

vector. Constant hazard rates under the treatment arm.

cutpoint

vector. The change-point vector indicating time when the hazard rates change.

hazard_control

vector. Constant hazard rates under the control arm.

N_total

scalar. Total sample size.

breaks

vector. Breaks (interval starts) used to compose the breaks of the piecewise exponential model. Do not include zero. Default breaks are the quantiles of the input times.

time0

vector. Historical exposure time for the subjects. It must be the same length as the treatment variable.

treatment0

vector. the historical treatment assignment for patients, 1 for treatment group and 0 for control group.

event0

vector. Historical status indicator, normally 0=alive, 1=dead. Other choices are TRUE/FALSE (TRUE = death) or 1/2 (2 = death). For censored data, the status indicator is 0 = right censored, 1 = event at time. Although unusual, the event indicator can be omitted, in which case all subjects are assumed to have an event.

lambda

vector. Enrollment rates across simulated enrollment times. See enrollment for more details.

lambda_time

vector. Enrollment time(s) at which the enrollment rates change. Must be same length as lambda. See enrollment for more details.

interim_look

vector. Sample size for each interim look. Note: the maximum sample size should not be included.

EndofStudy

scalar. Length of the study.

prior

vector. Prior values of the gamma rate, Gamma(a0, b0). The default is set to Gamma(0.1, 0.1).

block

scalar. Block size for generating the randomization schedule.

rand_ratio

vector. Randomization allocation for the ratio of control to treatment. Integer values mapping the size of the block. See randomization for more details.

prop_loss_to_followup

scalar. Overall proportion of subjects lost to follow-up.

alternative

character. The string specifying the alternative hypothesis, must be one of "greater" (default), "less" or "two.sided".

h0

scalar. Threshold for comparing two mean values. Default is h0 = 0.

futility_prob

scalar. Probability of stopping early for futility.

expected_success_prob

scalar. Probability of stopping early for success.

prob_ha

scalar. Probability of alternative hypothesis.

N_impute

scalar. Number of imputations for Monte Carlo simulation of missing data.

number_mcmc

scalar. Number of Markov Chain Monte Carlo draws in sampling posterior.

discount_function

character. If incorporating historical data, specify the discount function. Currently supports the Weibull function (discount_function = "weibull"), the scaled-Weibull function (discount_function = "scaledweibull"), and the identity function (discount_function = "identity"). The scaled-Weibull discount function scales the output of the Weibull CDF to have a maximum value of 1. The identity discount function uses the posterior probability directly as the discount weight. Default value is "identity". See bdpnormal for more details.

alpha_max

scalar. Maximum weight the discount function can apply. Default is 1. For a two-arm trial, users may specify a vector of two values where the first value is used to weight the historical treatment group and the second value is used to weight the historical control group.

fix_alpha

logical. Fix alpha at alpha_max? Default value is FALSE.

weibull_scale

scalar. Scale parameter of the Weibull discount function used to compute alpha, the weight parameter of the historical data. Default value is 0.135. For a two-arm trial, users may specify a vector of two values where the first value is used to estimate the weight of the historical treatment group and the second value is used to estimate the weight of the historical control group. Not used when discount_function = "identity".

weibull_shape

scalar. Shape parameter of the Weibull discount function used to compute alpha, the weight parameter of the historical data. Default value is 3. For a two-arm trial, users may specify a vector of two values where the first value is used to estimate the weight of the historical treatment group and the second value is used to estimate the weight of the historical control group. Not used when discount_function = "identity".

method

character. Analysis method with respect to estimation of the weight parameter alpha. Default method "mc" estimates alpha for each Monte Carlo iteration. Alternate value "fixed" estimates alpha once and holds it fixed throughout the analysis. See the the bdpsurvival vignette
vignette("bdpsurvival-vignette", package="bayesDP") for more details.

Value

A list of output for a single trial simulation.

lambda_treatment

vector. The input parameter of constant hazard rates in the treatment group.

cutpoint_treatment

vector. The change-point vector when the constant hazard rate(s) changes for the treatment group.

lambda_control

vector. The input parameter of constant hazard rates in the control group.

cutpoint_control

vector. The change-point vector when the constant hazard rate(s) changes for the control group.

prob_of_accepting_alternative

scalar. The input parameter of probability threshold of accepting the alternative.

margin

scalar. The margin input value of difference between mean estimate of treatment and mean estimate of the control.

alternative

character. The input parameter of alternative hypothesis.

interim_look

vector. The sample size for each interim look.

N_treatment

scalar. The number of patients enrolled in the treatment group for each simulation.

event_treatment

scalar. The number of events in the treatment group for each simulation.

N_control

scalar. The number of patients enrolled in the control group for each simulation.

event_control

scalar. The number of events in the control group for each simulation.

N_enrolled

vector. The number of patients enrolled in the trial (sum of control and experimental group for each simulation).

N_complete

scalar. The number of patients who completed the trial and had no loss to follow-up.

post_prob_accept_alternative

vector. The final probability of accepting the alternative hypothesis after the analysis is done.

est_final

scalar. The final estimate of the difference in posterior estimate of treatment and posterior estimate of the control group.

stop_futility

scalar. Did the trial stop for futility during imputation of patient who had loss to follow up? 1 for yes and 0 for no.

stop_expected_success

scalar. Did the trial stop for early success during imputation of patient who had loss to follow up? 1 for yes and 0 for no.

est_interim

scalar. The interim estimate of the difference in posterior estimate of treatment and posterior estimate of the control group.