enrollment {goldilocks} | R Documentation |
Simulate enrollment times
Description
Simulate enrollment time using a piecewise Poisson distribution.
Usage
enrollment(lambda = 1, N_total, lambda_time = 0)
Arguments
lambda |
vector. Rate parameter(s) for Poisson distribution. |
N_total |
integer. Value of total sample size. |
lambda_time |
vector. Knots (of |
Details
Subject recruitment is assumed to follow a (piecewise stationary) Poisson process. We assume trial recruitment to be an independent process, thus the 'memoryless' property modelling of subject recruitment is used. Since the subject recruitment rate can vary over time, we can account for differential rates over time. Note that the first trial enrollment is assumed to occur at time zero.
To illustrate, suppose we use a piecewise function to specify the change in enrollment rate over time:
\lambda = \left\{
\begin{array}{ll}
0.3 & \textrm{time} \in [0, 5) \\
0.7 & \textrm{time} \in [5, 10) \\
0.9 & \textrm{time} \in [10, 15) \\
1.2 & \textrm{time} \in [15, \infty) \\
\end{array}
\right.
Then, to simulate individual patient enrollment dates with a sample size
(N_total
) of 50, we use
enrollment(lambda = c(0.3, 0.7, 0.9, 1.2), N_total = 50,
lambda_time = c(0, 5, 10, 15))
Value
A vector of enrollment times (from time of first patient enrollment) in unit time (e.g. days).
See Also
This function is based on the enrollment
function from the
bayesCT
R package.
Examples
enrollment(lambda = c(0.003, 0.7), N_total = 100, lambda_time = c(0, 10))
enrollment(lambda = c(0.3, 0.5, 0.9, 1.2, 2.1), N_total = 200,
lambda_time = c(0, 20, 30, 40, 60))