simu_time {psborrow} | R Documentation |
Simulate time-to-events for multiple scenarios
Description
Simulate time-to-events for multiple scenarios
Usage
simu_time(dt, eventObj, clinInt, clinExt, seed, path)
Arguments
dt |
a list of |
eventObj |
an object of class |
clinInt |
an object of class |
clinExt |
an object of class |
seed |
the seed of R‘s random number generator. Default is the first element of .Random.seed |
path |
file name for saving the output including folder path |
Value
a list of matrix
containing simulated time-to-events information
Examples
# simulate patient-level data without covariates
# simulate survival time following weibull distribution
# simulate trial indicator and set hazard ratios
sample = set_n(ssC = 10, ssE = 20, ssExt = 40)
sample_hr <- simu_cov(ssObj = sample, HR = 1, driftHR=c(1,1.2), nsim = 10)
# enrollment pattern, drop-out, analysis start time
c_int = set_clin(gamma = 2, e_itv = 10, etaC = 0.5, CCOD = "fixed-first", CCOD_t = 64)
c_ext = c_int
# simulate time-to-event with a weibull distribution
evt1 <- set_event(event = "weibull", shape = 0.8, lambdaC = 0.01)
simu_time(dt = sample_hr, eventObj = evt1, clinInt = c_int, clinExt = c_ext)
# simulate time-to-event with an exponential distribution
evt2 <- set_event(event = "pwexp", t_itv = 1, lambdaC = c(0.1, 0.02))
simu_time(dt = sample_hr, eventObj = evt2, clinInt = c_int, clinExt = c_int)
[Package psborrow version 0.2.1 Index]