Simulate Participant Accrual Times
sim_accrual(n, accrual_periods, accrual_props)
Number of participants
Vector of right endpoints defining the time periods of accrual, e.g., c(6,8) defines 0<=x<6, 6<=x<8.
Vector indicating the proportion of participants that are expected to be enrolled during each of the defined accrual periods. Should sum to 1, otherwise these proportions will be normalized.
Vector of accrual times corresponding to when each participant enters the study
Simulate the accrual times for each participant, where
accrual_periods
defines the right time points for each accrual period
(with the last element corresponding to the end of accrual), and
accrual_props
defines the proportion of study participants who are
enrolled during each of these periods. The simulated accrual times for
participants within a given accrual period are assumed to be uniformly
distributed.