CADBCD_Sim_Surv: Simulation For Covariate Adjusted Doubly Biased Coin Design...

View source: R/CARA_function.R

CADBCD_Sim_SurvR Documentation

Simulation For Covariate Adjusted Doubly Biased Coin Design for Survival Response

Description

This function simulates a clinical trial with time-to-event (survival) outcomes using the Covariate Adjusted Doubly Biased Coin Design (CADBCD). Patient responses are generated under the Cox proportional hazards model, assuming the proportional hazards assumption holds.

Usage

CADBCD_Sim_Surv(
  n,
  thetaA,
  thetaB,
  m0 = 40,
  pts.cov,
  v = 2,
  target,
  censor.time,
  arrival.rate
)

Arguments

n

a positive integer. The value specifies the total number of participants involved in each round of the simulation.

thetaA

a vector of length k. The true coefficient parameter value for treatment A.

thetaB

a vector of length k. The true coefficient parameter value for treatment B.

m0

a positive integer. The number of first 2m0 patients will be allocated equally for estimation. The default value is 40.

pts.cov

a n x k matrix. The simulated covariate matrix for patients.

v

a non-negative integer that controls the randomness of CADBCD design. The default value is 2.

target

the type of optimal allocation target. Options are "Neyman" or "RSIHR".

censor.time

a positive value. The upper bound to the simulated uniform censor time.

arrival.rate

a positive value. The rate of simulated exponential arrival time.

Value

A list with the following elements:

method

The name of procedure.

sampleSize

Sample size of the trial.

parameter

Estimated parameters used to do the simulations.

N.events

Total number of events of the trial.

assignment

The randomization sequence.

proportion

Average allocation proportion for treatment A.

responses

The simulated observed survival responses of patients.

events

Whether events are observed for patients(1=event,0=censored).

rejectNull

Whether the study to detect a significant difference of treatment effect using Wald test.

Examples

set.seed(123)

## Run CADBCD simulation with survival response
results = CADBCD_Sim_Surv(
  thetaA = c(0.1, 0.1),
  thetaB = c(-1, 0.1),
  n = 400,
  pts.cov = cbind(sample(c(1, 0), 400, replace = TRUE), rnorm(400)),
  target = "RSIHR",
  censor.time = 2,
  arrival.rate = 150
)

caradpt documentation built on Aug. 28, 2025, 9:09 a.m.