CARAEE_Sim_Surv: Simulation Function of of CARA Designs Based on Efficiency...

View source: R/CARA_function.R

CARAEE_Sim_SurvR Documentation

Simulation Function of of CARA Designs Based on Efficiency and Ethics for Survival Response.

Description

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.

Usage

CARAEE_Sim_Surv(
  n,
  thetaA,
  thetaB,
  m0 = 40,
  pts.cov,
  gamma,
  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.

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.

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

Logical. Indicates whether the treatment effect is statistically significant based on a Wald test.

Examples

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
)

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