Skip to contents

Computes the sequential p-value as the minimum repeated p-value over completed analyses, using [repeatedPValueBinomialExact()].

Usage

sequentialPValueBinomialExact(
  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 single numeric one-sided sequential p-value.

See also

[repeatedPValueBinomialExact()], [sequentialPValue()]

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{
sequentialPValueBinomialExact(gsD = x, n.I = counts, x = c(12, 23, 38))
#> [1] 0.008683036
# }