Skip to contents

Creates a group sequential design from sample_size_nbinom() using expected information fractions for interim analyses and a calendar-timed final analysis.

Usage

gsNB(
  x,
  k = 3,
  timing = 0,
  test.type = 4,
  alpha = 0.025,
  beta = 0.1,
  astar = 0.1,
  delta = 0,
  sfu = gsDesign::sfHSD,
  sfupar = -4,
  sfl = gsDesign::sfHSD,
  sflpar = -2,
  sfharm = gsDesign::sfLDPocock,
  sfharmparam = -2,
  testUpper = TRUE,
  testLower = TRUE,
  testHarm = TRUE,
  tol = 1e-06,
  r = 18,
  usTime = NULL,
  lsTime = NULL
)

Arguments

x

An object of class sample_size_nbinom_result from sample_size_nbinom().

k

Number of analyses (interim + final). Default is 3.

timing

Information fractions, specified as in gsDesign::gsDesign(). Supply k - 1 interim fractions, or k fractions ending in 1. The default, 0, uses equally spaced information fractions. Calendar times are solved using expected information from sample_size_nbinom(), with the final analysis fixed at x$inputs$trial_duration.

test.type

Test type as in gsDesign::gsDesign():

1

One-sided

2

Two-sided symmetric

3

Two-sided, asymmetric, binding futility bound, beta-spending

4

Two-sided, asymmetric, non-binding futility bound, beta-spending

5

Two-sided, asymmetric, binding futility bound, lower spending

6

Two-sided, asymmetric, non-binding futility bound, lower spending

7

Two-sided, asymmetric, binding futility and binding harm bounds

8

Two-sided, asymmetric, non-binding futility and non-binding harm bounds

Default is 4.

alpha

Type I error (one-sided). Default is 0.025.

beta

Type II error (1 - power). Default is 0.1.

astar

For test.type 5 or 6, total null spending for the lower bound. For test.type 7 or 8, total null spending for the harm bound. Default is 0.1, matching gsDesign 4.0.0. Specify astar = 1 - alpha to reproduce the earlier test.type 5 or 6 default, where the lower and upper bounds meet at the final analysis. astar = 0 is deprecated in gsDesign 4.0.0 and triggers a warning from gsDesign::gsDesign(). Ignored for test.type 1 to 4.

delta

Standardized effect size. Default is 0 (computed from design).

sfu

Spending function for upper bound. Default is gsDesign::sfHSD.

sfupar

Parameter for upper spending function. Default is -4.

sfl

Spending function for lower bound. Default is gsDesign::sfHSD.

sflpar

Parameter for lower spending function. Default is -2.

sfharm

Spending function for the harm bound (test.type 7 or 8). Default is gsDesign::sfLDPocock, matching gsDesign 4.0.0.

sfharmparam

Parameter for the harm spending function. Default is -2 (not used by sfLDPocock).

testUpper

Logical scalar or vector of length k specifying which analyses include an upper (efficacy) bound. TRUE (default) means all analyses. Where FALSE, the bound is inactive and displayed as NA. Must be TRUE at the final analysis.

testLower

Logical scalar or vector of length k specifying which analyses include a lower (futility) bound. TRUE (default) means all analyses. Where FALSE, the bound is inactive and displayed as NA. Ignored for test.type 1.

testHarm

Logical scalar or vector of length k specifying which analyses include a harm bound (test.type 7 or 8 only). TRUE (default) means all analyses. Where FALSE, the bound is inactive and displayed as NA.

tol

Tolerance for convergence. Default is 1e-06.

r

Integer controlling grid size for numerical integration. Default is 18.

usTime

Spending time for upper bound (optional).

lsTime

Spending time for lower bound (optional).

Value

An object of class gsNB which inherits from gsDesign and sample_size_nbinom_result. While the final sample size would be planned total enrollment, interim analysis sample sizes are the expected number enrolled at the supplied or solved calendar times. Output value contains all elements from gsDesign::gsDesign() plus:

nb_design

The original sample_size_nbinom_result object

n1

A vector with sample size per analysis for group 1

n2

A vector with sample size per analysis for group 2

n_total

A vector with total sample size per analysis

events

A vector with expected total events per analysis

events1

A vector with expected events per analysis for group 1

events2

A vector with expected events per analysis for group 2

exposure

A vector with expected average calendar exposure per analysis

exposure_at_risk1

A vector with expected at-risk exposure per analysis for group 1

exposure_at_risk2

A vector with expected at-risk exposure per analysis for group 2

variance

A vector with variance of log rate ratio per analysis

T

Supplied or solved calendar time at each analysis

testUpper

Logical vector indicating which analyses have an efficacy bound

testLower

Logical vector indicating which analyses have a futility bound

testHarm

Logical vector indicating which analyses have a harm bound (test.type 7 or 8 only)

Note that n.I in the returned object represents the statistical information at each analysis.

Details

Information-fraction timing is based on planned, not observed, information. Interim calendar times solve \(I(t) / I(T) = \mathrm{timing}\), where \(T\) is the fixed design's trial duration. The calculation retains its piecewise accrual pattern, dropout, dispersion, follow-up caps, and event gaps. Multiplying all accrual rates by the same constant changes information and sample size but not these calendar times. Spending and the required information inflation are determined by gsDesign::gsDesign(), including usTime and lsTime when supplied.

References

Jennison, C. and Turnbull, B.W. (2000), Group Sequential Methods with Applications to Clinical Trials. Boca Raton: Chapman and Hall.

See also

gsNBCalendar() for explicitly specified calendar analysis times.

Examples

nb_ss <- sample_size_nbinom(
  lambda1 = 0.5, lambda2 = 0.3, dispersion = 0.1, power = 0.9,
  accrual_rate = 10, accrual_duration = 20, trial_duration = 24
)
gs_info <- gsNB(nb_ss, k = 3, timing = c(0.5, 0.75))
gs_info$T
#> [1] 15.51551 19.70681 24.00000
gs_info$timing
#> [1] 0.50 0.75 1.00