View source: R/CARA_function.R
CARAEE_Sim_Surv | R Documentation |
This function simulates a clinical trial with time-to-event (survival) outcomes using the CARA Designs Based on Efficiency and Ethics for Survival Response(CARAEE). Patient responses are generated under the Cox proportional hazards model, assuming the proportional hazards assumption holds.
CARAEE_Sim_Surv(
n,
thetaA,
thetaB,
m0 = 40,
pts.cov,
gamma,
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 |
gamma |
a non-negative number. A tuning parameter that reflects the importance of the efficiency component compared to the ethics component. |
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 |
Logical. Indicates whether the treatment effect is statistically significant based on a Wald test. |
set.seed(123)
results = CARAEE_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)),
gamma=1,
censor.time = 2,
arrival.rate = 150
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.