library(nphRCT)
set.seed(1)
sim_data <- sim_events_delay(
event_model=list(
duration_c = 36,
duration_e = c(6,30),
lambda_c = log(2)/9,
lambda_e = c(log(2)/9,log(2)/18)
),
recruitment_model=list(
rec_model="power",
rec_period = 12,
rec_power = 1
),
n_c=5,
n_e=5,
max_cal_t = 36
)
#with censoring times included
find_at_risk(formula=survival::Surv(event_time,event_status)~group,
data=sim_data,
include_cens=TRUE)
#with censoring times excluded
find_at_risk(formula=survival::Surv(event_time,event_status)~group,
data=sim_data,
include_cens=FALSE)
Run the code above in your browser using DataLab