View source: R/CARA_function.R
CADBCD_Sim_Surv | R Documentation |
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.
CADBCD_Sim_Surv(
n,
thetaA,
thetaB,
m0 = 40,
pts.cov,
v = 2,
target,
censor.time,
arrival.rate
)
n |
a positive integer. The value specifies the total number of participants involved in each round of the simulation. |
thetaA |
a vector of length |
thetaB |
a vector of length |
m0 |
a positive integer. The number of first 2m0 patients will be allocated equally for estimation. The default value is 40. |
pts.cov |
a |
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 |
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. |
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. |
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
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.