Skip to contents

Computes repeated p-values for the exact binomial design implied by a [gsSurv()] object. The p-value at analysis `j` is the largest local one-sided alpha level at which the observed experimental arm event count does not cross the exact lower efficacy bound at that analysis; the count crosses at every larger level. Non-binding futility and harm bounds are ignored for the Type I error calculation.

Usage

repeatedPValueBinomialExact(
  gsD,
  n.I = NULL,
  x = NULL,
  interval = c(1e-20, 0.9999),
  tol = 1e-08,
  maxiter = 100,
  check = FALSE,
  usTime = NULL,
  finalReview = NULL,
  sfu = NULL,
  sfupar = NULL
)

Arguments

gsD

A `gsSurv` object with non-binding `test.type` 1, 4, 6, or 8.

n.I

Non-decreasing non-negative integer total event counts at completed reviews. Zero events and unchanged counts between reviews are allowed. If `NULL`, the planned integer event counts from `toInteger(gsD)` are used.

x

Integer experimental arm event counts at the reviews in `n.I`. These must be non-decreasing and cannot increase by more than `n.I`.

interval

Search interval for the p-values. As in [sequentialPValue()], values outside this interval are truncated to the nearest endpoint.

tol

Relative tolerance on the alpha scale for locating each change in the exact bounds.

maxiter

Maximum number of bisection iterations for locating each change in the exact bounds.

check

Logical. If `TRUE`, checks the monotonicity of the alpha-indexed integer efficacy bounds on a coarse grid and warns if it is violated. Non-monotone bounds do not invalidate the p-values (see Details).

usTime

Optional non-decreasing spending times (length of `n.I`) in `[0, 1]` (larger values are set to 1) for the upper (efficacy) spending function, for example elapsed calendar time over the planned final calendar time. If `NULL` (default), spending uses `min(n.I / planned final events, 1)`, where planned final events are `gsD$maxn.IPlan` if available, otherwise `max(gsD$n.I)`. Use the original planned denominator, not a realized future final count or time.

finalReview

Optional integer index of the scheduled final review. Spending time is set to 1 at that review and any later ones, so the remaining spending is a target there (discreteness can leave achieved spending below it). Only the scheduled final review triggers this; the last supplied review or an earlier boundary crossing does not. This is the analog of `maxSpend` in [toBinomialExact()]. If `NULL` (default), no override is applied.

sfu, sfupar

Optional spending function and parameter for the inference spending, replacing `gsD$upper$sf` and `gsD$upper$param` without modifying `gsD`. If `sfu` is given without `sfupar`, the parameter is `NULL`.

Value

A data frame with one row per completed analysis containing:

`Analysis`

Analysis index.

`n.I`

Total events at analysis.

`x`

Observed experimental arm events.

`repeated_p_value`

Repeated p-value for the analysis.

`bound_at_repeated_p_value`

Integer efficacy bound at the repeated p-value.

Details

Because probability left unspent by an integer bound is carried forward, exact bounds need not be monotone in alpha: a count can cross at one level and not at a larger one. The p-value is the upper end of the levels without a crossing, found by tracing every change in the bounds over `interval`. Thus a p-value at or below a level implies a crossing at that level, while a crossing at a level can occur with a larger p-value. The prespecified boundary, not the p-value, governs the decision at the design level.

See also

[sequentialPValueBinomialExact()], [sequentialPValue()], [toBinomialExact()], [gsBinomialExact()]

Examples

x <- gsSurv(
  k = 3, test.type = 4, alpha = 0.025, beta = 0.1, timing = c(0.45, 0.7),
  sfu = sfHSD, sfupar = -4, sfl = sfLDOF, sflpar = 0,
  lambdaC = 0.001, hr = 0.3, hr0 = 0.7, eta = 5e-04,
  gamma = 10, R = 16, T = 24, minfup = 8, ratio = 3
)
counts <- toBinomialExact(x)$n.I
# \donttest{
repeatedPValueBinomialExact(gsD = x, n.I = counts, x = c(12, 23, 38))
#>   Analysis n.I  x repeated_p_value bound_at_repeated_p_value
#> 1        1  31 12      0.008683036                        12
#> 2        2  48 23      0.013085131                        23
#> 3        3  69 38      0.019672838                        38
# }