tEvents | R Documentation |
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.
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) )
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 |
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;
# ------------------------# # Example 1 # # ------------------------# # default tEvents() # ------------------------# # 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 # 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.