Skip to contents

eAccrual() computes the expected cumulative enrollment (accrual) given a set of piecewise constant enrollment rates and times.

Usage

eAccrual(
  x = 0:24,
  enrollRates = tibble(duration = c(3, 3, 18), rate = c(5, 10, 20))
)

Arguments

x

times at which enrollment is to be computed.

enrollRates

Piecewise constant enrollment rates expressed as a tibble with duration for each piecewise constant period and the rate of enrollment for that period.

Value

A vector with expected cumulative enrollment for the specified times.

Specification

The contents of this section are shown in PDF user manual only.

Examples

library(tibble)

# Example 1: default
eAccrual()
#>  [1]   0   5  10  15  25  35  45  65  85 105 125 145 165 185 205 225 245 265 285
#> [20] 305 325 345 365 385 405

# Example 2: unstratified design
eAccrual(x = c(5, 10, 20), 
         enrollRates = tibble(duration = c(3, 3, 18), rate = c(5, 10, 20)))
#> [1]  35 125 325

eAccrual(x = c(5, 10, 20), 
         enrollRates = tibble(duration = c(3, 3, 18), rate = c(5, 10, 20), 
         Stratum = "All"))
#> [1]  35 125 325
         
# Example 3: stratified design
eAccrual(x = c(24, 30, 40), 
         enrollRates = tibble(Stratum=c("subgroup", "complement"), 
                              duration = 33, 
                              rate = c(30, 30)))
#> [1] 1440 1800 1980