
Translate survival design bounds to exact binomial bounds
Source:R/toBinomialExact.R
toBinomialExact.RdTranslate survival design bounds to exact binomial bounds
Usage
toBinomialExact(
x,
observedEvents = NULL,
alpha = NULL,
usTime = NULL,
lsTime = NULL,
maxSpend = FALSE
)Arguments
- x
An object of class
gsSurv; i.e., an object generated by thegsSurv()function.- observedEvents
If NULL (default), targeted timing of analyses will come from
x$n.I. Otherwise, this should be a vector of increasing positive integers, of length at least 2 for a sequential design or length 1 for a fixed design. Only one value can be greater than or equal tox$maxn.IPlan. This determines the case count at each analysis performed. Primarily, this is used for updating a design at the time of analysis.- alpha
Optional alpha level for deriving updated exact efficacy bounds. If
NULL, the alpha level fromxis used.- usTime
Optional upper spending-time override (length
kork - 1, with final value appended as 1 if needed). IfNULL, this defaults toobservedEvents / x$maxn.IPlan(capped at 1) whenobservedEventsis supplied, or to the planned design timing otherwise.- lsTime
Optional lower spending-time override for
test.type = 4,6, or8(same length and monotonicity requirements asusTime). IfNULL, it defaults tousTime.- maxSpend
Logical scalar. If `TRUE`, force full alpha spending (and, for `test.type = 4` or `8`, full beta spending; for `test.type = 6`, full lower-bound spending under the null; and, for `test.type = 8`, full harm spending under the null) at the final analysis even when `observedEvents[k] < x$maxn.IPlan`. This keeps earlier analysis spending unchanged and applies the override only at the last look.
Value
An object with primary class gsBinomialExactSpending,
inheriting from gsBinomialExact and gsProbability. In
addition to the exact bounds and crossing probabilities, the returned
object records `test.type`, `alpha`, `beta`, `ratio`, applicable `astar`,
analysis-specific testing indicators, spending times, planned final event
count, `maxSpend`, and the evaluated conversion call. The retained
randomization ratio can be used by VEtable. For
`test.type = 6`, the exact object's upper event-count bound represents the
non-binding lower stopping bound, with its first probability column
calibrated under the null hypothesis. For `test.type = 8`, `upper`
represents all upper event-count stops, while `futility` and `harm`
partition those stops into mutually exclusive components.
Details
Fixed survival designs (gsSurv(k = 1)) are converted using the exact
lower binomial tail under hr0. The largest integer efficacy cutoff
with probability no greater than the available alpha spending is selected;
discreteness may reduce achieved power. A single observedEvents value
can update a fixed design. Spending still uses the original planned final
event count as denominator, including under- and over-runs; maxSpend
can request full spending for an under-run. No artificial interim is added.
Test types 1 (one-sided), 4 (non-binding beta-spending futility), 6
(non-binding lower-bound spending under the null), and 8 (non-binding
futility and harm) are supported for full conversion. For Type 8, the exact
upper event-count stopping probability is partitioned into mutually
exclusive futility and harm components. Binding
designs (types 2, 3, 5, and 7) are outside the non-binding exact-efficacy
framework. Exact repeated and sequential efficacy
p-values can nevertheless be computed for non-binding types 1, 4, 6, and 8
with repeatedPValueBinomialExact() and
sequentialPValueBinomialExact(), which intentionally ignore
non-binding lower and harm bounds.
The exact binomial routine gsBinomialExact has requirements that may not be satisfied
by the initial asymptotic approximation.
Thus, the approximations are updated to satisfy the following requirements of gsBinomialExact:
a (the efficacy bound) must be positive, non-decreasing, and strictly less than n.I
b (the upper event-count stopping bound for futility, harm, or the
Type 6 lower bound) must be positive, non-decreasing, and strictly greater than a
n.I - b must be non-decreasing and >= 0
With `observedEvents`, spending times are based on
observedEvents / x$maxn.IPlan. If maxSpend = TRUE, the final
spending time is set to 1 so all remaining spending is used at the last look.
If x$testLower is present (for example from gsSurv() with
selective lower-bound looks), lower-bound spending is flattened at analyses
where testLower = FALSE.
For Type 4, the exact futility bound at a skipped look carries forward
n.I - b from the preceding look (or uses b = n.I + 1
at a skipped first look). It cannot be crossed by a continuing path and
spends no additional beta. Efficacy calibration ignores these non-binding
futility bounds.
Examples
# Fixed survival design: exact probabilities, without an artificial interim
fixed <- gsSurv(k = 1, hr = .3, hr0 = .7, ratio = 1)
toBinomialExact(fixed)
#> Bounds
#> Analysis N a b
#> 1 60 16 61
#>
#> Boundary crossing probabilities and expected sample size assume
#> any cross stops the trial
#>
#> Upper boundary
#> Analysis
#> Theta 1 Total E{N}
#> 0.4118 0 0 60
#> 0.2308 0 0 60
#>
#> Lower boundary
#> Analysis
#> Theta 1 Total
#> 0.4118 0.0141 0.0141
#> 0.2308 0.7947 0.7947
# The following code derives the group sequential design using the method
# of Lachin and Foulkes
x <- gsSurv(
k = 3, # 3 analyses
test.type = 4, # Non-binding futility bound 1 (no futility bound) and 4 are allowable
alpha = .025, # 1-sided Type I error
beta = .1, # Type II error (1 - power)
timing = c(0.45, 0.7), # Proportion of final planned events at interims
sfu = sfHSD, # Efficacy spending function
sfupar = -4, # Parameter for efficacy spending function
sfl = sfLDOF, # Futility spending function; not needed for test.type = 1
sflpar = 0, # Parameter for futility spending function
lambdaC = .001, # Exponential failure rate
hr = 0.3, # Assumed proportional hazard ratio (1 - vaccine efficacy = 1 - VE)
hr0 = 0.7, # Null hypothesis VE
eta = 5e-04, # Exponential dropout rate
gamma = 10, # Piecewise exponential enrollment rates
R = 16, # Time period durations for enrollment rates in gamma
T = 24, # Planned trial duration
minfup = 8, # Planned minimum follow-up
ratio = 3 # Randomization ratio (experimental:control)
)
# Convert bounds to exact binomial bounds
toBinomialExact(x)
#> Bounds
#> Analysis N a b
#> 1 31 12 22
#> 2 48 23 30
#> 3 69 38 39
#>
#> Boundary crossing probabilities and expected sample size assume
#> any cross stops the trial
#>
#> Upper boundary
#> Analysis
#> Theta 1 2 3 Total E{N}
#> 0.6774 0.4328 0.3960 0.1523 0.9811 44.1
#> 0.4737 0.0068 0.0206 0.0578 0.0851 52.2
#>
#> Lower boundary
#> Analysis
#> Theta 1 2 3 Total
#> 0.6774 0.0008 0.0030 0.0151 0.0189
#> 0.4737 0.2167 0.3767 0.3215 0.9149
# Update bounds at time of analysis
toBinomialExact(x, observedEvents = c(20,55,80))
#> Bounds
#> Analysis N a b
#> 1 20 6 17
#> 2 55 28 33
#> 3 80 45 46
#>
#> Boundary crossing probabilities and expected sample size assume
#> any cross stops the trial
#>
#> Upper boundary
#> Analysis
#> Theta 1 2 3 Total E{N}
#> 0.6774 0.0732 0.8400 0.0668 0.9800 54.4
#> 0.4737 0.0006 0.0404 0.0205 0.0615 57.1
#>
#> Lower boundary
#> Analysis
#> Theta 1 2 3 Total
#> 0.6774 0.0006 0.0067 0.0127 0.0200
#> 0.4737 0.0903 0.6571 0.1911 0.9385
# Update exact efficacy bounds using a different alpha level
toBinomialExact(x, observedEvents = c(20,55,80), alpha = 0.01)
#> Bounds
#> Analysis N a b
#> 1 20 5 17
#> 2 55 27 33
#> 3 80 43 45
#>
#> Boundary crossing probabilities and expected sample size assume
#> any cross stops the trial
#>
#> Upper boundary
#> Analysis
#> Theta 1 2 3 Total E{N}
#> 0.6774 0.0732 0.8401 0.0752 0.9884 54.5
#> 0.4737 0.0006 0.0404 0.0401 0.0811 61.4
#>
#> Lower boundary
#> Analysis
#> Theta 1 2 3 Total
#> 0.6774 0.0001 0.0031 0.0043 0.0075
#> 0.4737 0.0355 0.6177 0.2386 0.8919
# Explicit spending-time override
toBinomialExact(x, observedEvents = c(20, 55, 80), usTime = c(.25, .65, 1))
#> Bounds
#> Analysis N a b
#> 1 20 6 17
#> 2 55 27 33
#> 3 80 45 46
#>
#> Boundary crossing probabilities and expected sample size assume
#> any cross stops the trial
#>
#> Upper boundary
#> Analysis
#> Theta 1 2 3 Total E{N}
#> 0.6774 0.0732 0.8400 0.0684 0.9816 54.5
#> 0.4737 0.0006 0.0404 0.0216 0.0625 59.4
#>
#> Lower boundary
#> Analysis
#> Theta 1 2 3 Total
#> 0.6774 0.0006 0.0030 0.0148 0.0184
#> 0.4737 0.0903 0.5656 0.2816 0.9375
# Optionally force full spending at final look when final events are below plan
toBinomialExact(x, observedEvents = c(20, 55, 75), maxSpend = TRUE)
#> Bounds
#> Analysis N a b
#> 1 20 6 17
#> 2 55 28 33
#> 3 75 42 43
#>
#> Boundary crossing probabilities and expected sample size assume
#> any cross stops the trial
#>
#> Upper boundary
#> Analysis
#> Theta 1 2 3 Total E{N}
#> 0.6774 0.0732 0.8400 0.0655 0.9787 54.0
#> 0.4737 0.0006 0.0404 0.0256 0.0666 56.1
#>
#> Lower boundary
#> Analysis
#> Theta 1 2 3 Total
#> 0.6774 0.0006 0.0067 0.014 0.0213
#> 0.4737 0.0903 0.6571 0.186 0.9334