eEvents_df | R Documentation |
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.
eEvents_df( enrollRates = tibble::tibble(duration = c(2, 2, 10), rate = c(3, 6, 9)), failRates = tibble::tibble(duration = c(3, 100), failRate = log(2)/c(9, 18), dropoutRate = rep(0.001, 2)), totalDuration = 25, simple = TRUE )
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 |
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.
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
.
library(tibble) library(gsDesign2) # Default arguments, simple output (total event count only) eEvents_df() # Event count by time period eEvents_df(simple = FALSE) # Early cutoff eEvents_df(totalDuration = .5) # 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) # 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.