Introduction of eAccrual()
Use cases of eAccrual()
Example 1
For the enrollment in the first 3 months, it is exactly \(3 \times 5 = 15\).
eAccrual(x = 3,
enrollRates = tibble(duration = c(3, 3, 18), rate = c(5, 10, 20)))
## [1] 15
Example 2
For the enrollment in the first 6 months, it is exactly \(3 \times 5 + 3 \times 10 = 45\).
eAccrual(x = 6,
enrollRates = tibble(duration = c(3, 3, 18), rate = c(5, 10, 20)))
## [1] 45
Example 3
For the enrollment in the first 24 months, it is exactly \(3 \times 5 + 3 \times 10 + 18 * 20 = 405\).
eAccrual(x = 24,
enrollRates = tibble(duration = c(3, 3, 18), rate = c(5, 10, 20)))
## [1] 405
Example 4
For the enrollment after 24 months, it is the same as that from the 24 months, since the enrollment is stopped.
eAccrual(x = 25,
enrollRates = tibble(duration = c(3, 3, 18), rate = c(5, 10, 20)))
## [1] 405
Example 5
Instead of compute the enrolled subjects one time point by one time point, we can also compute it once.
eAccrual(x = c(3, 6, 24, 25),
enrollRates = tibble(duration = c(3, 3, 18), rate = c(5, 10, 20)))
## [1] 15 45 405 405
Inner Logic of eAccrual()
TODO