Skip to contents

Group sequential design using MaxCombo test under non-proportional hazards

Usage

gs_design_combo(
  enroll_rate = define_enroll_rate(duration = 12, rate = 500/12),
  fail_rate = define_fail_rate(duration = c(4, 100), fail_rate = log(2)/15, hr = c(1,
    0.6), dropout_rate = 0.001),
  fh_test = rbind(data.frame(rho = 0, gamma = 0, tau = -1, test = 1, analysis = 1:3,
    analysis_time = c(12, 24, 36)), data.frame(rho = c(0, 0.5), gamma = 0.5, tau = -1,
    test = 2:3, analysis = 3, analysis_time = 36)),
  ratio = 1,
  alpha = 0.025,
  beta = 0.2,
  binding = FALSE,
  upper = gs_b,
  upar = c(3, 2, 1),
  lower = gs_b,
  lpar = c(-1, 0, 1),
  algorithm = mvtnorm::GenzBretz(maxpts = 1e+05, abseps = 1e-05),
  n_upper_bound = 1000,
  ...
)

Arguments

enroll_rate

Enrollment rates.

fail_rate

Failure and dropout rates.

fh_test

A data frame to summarize the test in each analysis. See examples for its data structure.

ratio

Experimental:Control randomization ratio (not yet implemented).

alpha

One-sided Type I error.

beta

Type II error.

binding

Indicator of whether futility bound is binding; default of FALSE is recommended.

upper

Function to compute upper bound.

upar

Parameters passed to upper.

lower

Function to compute lower bound.

lpar

Parameters passed to lower.

algorithm

an object of class GenzBretz, Miwa or TVPACK specifying both the algorithm to be used as well as the associated hyper parameters.

n_upper_bound

A numeric value of upper limit of sample size.

...

Additional parameters passed to mvtnorm::pmvnorm.

Value

A list with input parameters, enrollment rate, analysis, and bound.

Examples

# The example is slow to run
library(dplyr)
library(mvtnorm)
library(gsDesign)

enroll_rate <- define_enroll_rate(
  duration = 12,
  rate = 500 / 12
)

fail_rate <- define_fail_rate(
  duration = c(4, 100),
  fail_rate = log(2) / 15, # median survival 15 month
  hr = c(1, .6),
  dropout_rate = 0.001
)

fh_test <- rbind(
  data.frame(
    rho = 0, gamma = 0, tau = -1,
    test = 1, analysis = 1:3, analysis_time = c(12, 24, 36)
  ),
  data.frame(
    rho = c(0, 0.5), gamma = 0.5, tau = -1,
    test = 2:3, analysis = 3, analysis_time = 36
  )
)

x <- gsSurv(
  k = 3,
  test.type = 4,
  alpha = 0.025,
  beta = 0.2,
  astar = 0,
  timing = 1,
  sfu = sfLDOF,
  sfupar = 0,
  sfl = sfLDOF,
  sflpar = 0,
  lambdaC = 0.1,
  hr = 0.6,
  hr0 = 1,
  eta = 0.01,
  gamma = 10,
  R = 12,
  S = NULL,
  T = 36,
  minfup = 24,
  ratio = 1
)

# Example 1 ----
# User-defined boundary
# \donttest{
gs_design_combo(
  enroll_rate,
  fail_rate,
  fh_test,
  alpha = 0.025, beta = 0.2,
  ratio = 1,
  binding = FALSE,
  upar = x$upper$bound,
  lpar = x$lower$bound
)
#> $enroll_rate
#> # A tibble: 1 × 3
#>   stratum duration  rate
#>   <chr>      <dbl> <dbl>
#> 1 All           12  37.1
#> 
#> $fail_rate
#> # A tibble: 2 × 5
#>   stratum duration fail_rate dropout_rate    hr
#>   <chr>      <dbl>     <dbl>        <dbl> <dbl>
#> 1 All            4    0.0462        0.001   1  
#> 2 All          100    0.0462        0.001   0.6
#> 
#> $bounds
#>   analysis bound probability probability0          z    nominal p
#> 1        1 upper 0.002056984 0.0001035057  3.7103029 0.0001035057
#> 2        1 lower 0.140694990 0.4066436377 -0.2361874 0.5933563623
#> 3        2 upper 0.469124612 0.0060406872  2.5114070 0.0060125477
#> 4        2 lower 0.185586571 0.8846152138  1.1703638 0.1209273043
#> 5        3 upper 0.799998476 0.0254946088  1.9929702 0.0231323552
#> 6        3 lower 0.200008755 0.9745050358  1.9929702 0.0231323552
#> 
#> $analysis
#>   analysis time        n     event event_frac       ahr
#> 1        1   12 444.7987  95.53766  0.3241690 0.8418858
#> 2        2   24 444.7987 219.09306  0.7434051 0.7164215
#> 3        3   36 444.7987 294.71556  1.0000000 0.6831740
#> 
#> attr(,"class")
#> [1] "non_binding" "combo"       "gs_design"   "list"       
# }
# Example 2 ----
# \donttest{
# Boundary derived by spending function
gs_design_combo(
  enroll_rate,
  fail_rate,
  fh_test,
  alpha = 0.025,
  beta = 0.2,
  ratio = 1,
  binding = FALSE,
  upper = gs_spending_combo,
  upar = list(sf = gsDesign::sfLDOF, total_spend = 0.025), # alpha spending
  lower = gs_spending_combo,
  lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.2), # beta spending
)
#> $enroll_rate
#> # A tibble: 1 × 3
#>   stratum duration  rate
#>   <chr>      <dbl> <dbl>
#> 1 All           12  25.1
#> 
#> $fail_rate
#> # A tibble: 2 × 5
#>   stratum duration fail_rate dropout_rate    hr
#>   <chr>      <dbl>     <dbl>        <dbl> <dbl>
#> 1 All            4    0.0462        0.001   1  
#> 2 All          100    0.0462        0.001   0.6
#> 
#> $bounds
#>   analysis bound  probability probability0          z    nominal p
#> 1        1 upper 2.087715e-08 3.299865e-10  6.1753973 3.299865e-10
#> 2        1 lower 3.269631e-04 3.303090e-03 -2.7160707 9.966969e-01
#> 3        2 upper 2.203276e-01 2.565830e-03  2.7986508 2.565830e-03
#> 4        2 lower 8.468643e-02 7.431751e-01  0.6531624 2.568258e-01
#> 5        3 upper 8.000054e-01 2.371235e-02  2.0972454 1.798593e-02
#> 6        3 lower 1.999978e-01 9.762886e-01  2.0972475 1.798584e-02
#> 
#> $analysis
#>   analysis time        n     event event_frac       ahr
#> 1        1   12 301.2538  64.70585  0.3241690 0.8418858
#> 2        2   24 301.2538 148.38759  0.7434051 0.7164215
#> 3        3   36 301.2538 199.60528  1.0000000 0.6831740
#> 
#> attr(,"class")
#> [1] "non_binding" "combo"       "gs_design"   "list"       
# }