eAccrual: Piecewise constant expected accrual

View source: R/eAccrual.R

eAccrualR Documentation

Piecewise constant expected accrual

Description

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()

# Example 2: unstratified design
eAccrual(x = c(5, 10, 20), 
         enrollRates = tibble(duration = c(3, 3, 18), rate = c(5, 10, 20)))

eAccrual(x = c(5, 10, 20), 
         enrollRates = tibble(duration = c(3, 3, 18), rate = c(5, 10, 20), 
         Stratum = "All"))
         
# Example 3: stratified design
eAccrual(x = c(24, 30, 40), 
         enrollRates = tibble(Stratum=c("subgroup", "complement"), 
                              duration = 33, 
                              rate = c(30, 30)))


keaven/gsDesign2 documentation built on Oct. 13, 2022, 8:42 p.m.