tEvents()
is made to match input format with AHR()
and to solve for the
time at which the expected accumulated events is equal to an input target.
Enrollment and failure rate distributions are specified as follows.
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.
Usage
tEvents(
enrollRates = tibble::tibble(Stratum = "All", duration = c(2, 2, 10), rate = c(3, 6, 9)
* 5),
failRates = tibble::tibble(Stratum = "All", duration = c(3, 100), failRate =
log(2)/c(9, 18), hr = c(0.9, 0.6), dropoutRate = rep(0.001, 2)),
targetEvents = 150,
ratio = 1,
interval = c(0.01, 100)
)
Arguments
- enrollRates
Piecewise constant enrollment rates by stratum and time period.
- failRates
Piecewise constant control group failure rates, duration for each piecewise constant period, hazard ratio for experimental vs control, and dropout rates by stratum and time period.
- targetEvents
The targeted number of events to be achieved.
- ratio
Experimental:Control randomization ratio.
- interval
An interval that is presumed to include the time at which expected event count is equal to
targetEvents
.
Value
A tibble
with Time
(computed to match events in targetEvents
), AHR
(average hazard ratio),
Events
(targetEvents
input), info (information under given scenarios),
and info0 (information under related null hypothesis) for each value of totalDuration
input;
Examples
# ------------------------#
# Example 1 #
# ------------------------#
# default
tEvents()
#> # A tibble: 1 × 5
#> Time AHR Events info info0
#> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 14.9 0.787 150. 36.9 37.5
# ------------------------#
# Example 2 #
# ------------------------#
# check that result matches a finding using AHR()
# Start by deriving an expected event count
enrollRates <- tibble::tibble(Stratum = "All", duration = c(2, 2, 10), rate = c(3, 6, 9) * 5)
failRates <- tibble::tibble(Stratum = "All", duration = c(3, 100), failRate = log(2) / c(9, 18),
hr = c(.9,.6), dropoutRate = rep(.001, 2))
totalDuration <- 20
xx <- AHR(enrollRates, failRates, totalDuration)
xx
#> # A tibble: 1 × 5
#> Time AHR Events info info0
#> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 20 0.738 208. 51.0 52.1
# Next we check that the function confirms the timing of the final analysis.
tEvents(enrollRates, failRates,
targetEvents = xx$Events, interval = c(.5, 1.5) * xx$Time)
#> # A tibble: 1 × 5
#> Time AHR Events info info0
#> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 20.0 0.738 208. 51.0 52.1