eEvents_df
computes expected events over time and by strata
under the assumption of piecewise constant enrollment rates and piecewise
exponential failure and censoring rates.
The piecewise exponential distribution allows a simple method to specify a distribtuion
and enrollment pattern
where the enrollment, failure and dropout rates changes over time.
While the main purpose may be to generate a trial that can be analyzed at a single point in time or
using group sequential methods, the routine can also be used to simulate an adaptive trial design.
The intent is to enable sample size calculations under non-proportional hazards assumptions
for stratified populations.
Arguments
- enrollRates
Enrollment rates; see details and examples
- failRates
Failure rates and dropout rates by period
- totalDuration
Total follow-up from start of enrollment to data cutoff
- simple
If default (TRUE), return numeric expected number of events, otherwise a
tibble
as described below.
Value
The default when simple=TRUE
is to return the total expected number of events as a real number.
Otherwise, when simple=FALSE
a tibble
is returned with the following variables for each period specified in 'failRates':
t
start of period,
failRate
failure rate during the period
Events
expected events during the period,
The records in the returned tibble
correspond to the input tibble
failRates
.
Details
More periods will generally be supplied in output than those that are input. The intent is to enable expected event calculations in a tidy format to maximize flexibility for a variety of purposes.
Examples
library(tibble)
library(gsDesign2)
# Default arguments, simple output (total event count only)
eEvents_df()
#> [1] 57.3537
# Event count by time period
eEvents_df(simple = FALSE)
#> # A tibble: 2 × 3
#> t failRate Events
#> <dbl> <dbl> <dbl>
#> 1 0 0.0770 22.2
#> 2 3 0.0385 35.1
# Early cutoff
eEvents_df(totalDuration = .5)
#> [1] 0.02850923
# Single time period example
eEvents_df(enrollRates = tibble(duration = 10,rate = 10),
failRates = tibble(duration=100, failRate = log(2) / 6 ,dropoutRate = .01),
totalDuration = 22,
simple = FALSE)
#> # A tibble: 1 × 3
#> t failRate Events
#> <dbl> <dbl> <dbl>
#> 1 0 0.116 80.4
# Single time period example, multiple enrollment periods
eEvents_df(enrollRates = tibble(duration = c(5,5), rate = c(10, 20)),
failRates = tibble(duration = 100, failRate = log(2)/6, dropoutRate = .01),
totalDuration = 22, simple = FALSE)
#> # A tibble: 1 × 3
#> t failRate Events
#> <dbl> <dbl> <dbl>
#> 1 0 0.116 119.