Skip to contents

Group sequential design using average hazard ratio under non-proportional hazards

Usage

gs_design_ahr(
  enrollRates = tibble::tibble(Stratum = "All", duration = c(2, 2, 10), rate = c(3, 6,
    9)),
  failRates = tibble::tibble(Stratum = "All", duration = c(3, 100), failRate =
    log(2)/c(9, 18), hr = c(0.9, 0.6), dropoutRate = rep(0.001, 2)),
  ratio = 1,
  alpha = 0.025,
  beta = 0.1,
  IF = NULL,
  analysisTimes = 36,
  binding = FALSE,
  upper = gs_b,
  upar = gsDesign(k = 3, test.type = 1, n.I = c(0.25, 0.75, 1), sfu = sfLDOF, sfupar =
    NULL)$upper$bound,
  lower = gs_b,
  lpar = c(qnorm(0.1), -Inf, -Inf),
  h1_spending = TRUE,
  test_upper = TRUE,
  test_lower = TRUE,
  r = 18,
  tol = 1e-06
)

Arguments

enrollRates

enrollment rates

failRates

failure and dropout rates

ratio

Experimental:Control randomization ratio (not yet implemented)

alpha

One-sided Type I error

beta

Type II error

IF

Targeted information fraction at each analysis

analysisTimes

Minimum time of analysis

binding

indicator of whether futility bound is binding; default of FALSE is recommended

upper

Function to compute upper bound

upar

Parameter passed to upper()

lower

Function to compute lower bound

lpar

Parameter passed to lower()

h1_spending

Indicator that lower bound to be set by spending under alternate hypothesis (input failRates) if spending is used for lower bound

test_upper

indicator of which analyses should include an upper (efficacy) bound; single value of TRUE (default) indicates all analyses; otherwise, a logical vector of the same length as info should indicate which analyses will have an efficacy bound

test_lower

indicator of which analyses should include an lower bound; single value of TRUE (default) indicates all analyses; single value FALSE indicated no lower bound; otherwise, a logical vector of the same length as info should indicate which analyses will have a lower bound

r

Integer, at least 2; default of 18 recommended by Jennison and Turnbull

tol

Tolerance parameter for boundary convergence (on Z-scale)

Value

a tibble with columns Analysis, Bound, Z, Probability, theta, Time, AHR, Events

Details

Need to be added

Specification

The contents of this section are shown in PDF user manual only.

Examples

library(gsDesign)
library(gsDesign2)
library(dplyr)
# call with defaults
gs_design_ahr()
#> $enrollRates
#> # A tibble: 3 × 3
#>   Stratum duration  rate
#>   <chr>      <dbl> <dbl>
#> 1 All            2  13.2
#> 2 All            2  26.4
#> 3 All           10  39.7
#> 
#> $failRates
#> # A tibble: 2 × 5
#>   Stratum duration failRate    hr dropoutRate
#>   <chr>      <dbl>    <dbl> <dbl>       <dbl>
#> 1 All            3   0.0770   0.9       0.001
#> 2 All          100   0.0385   0.6       0.001
#> 
#> $bounds
#> # A tibble: 1 × 11
#>   Analysis Bound  Time     N Events     Z Probability   AHR theta  info info0
#>      <dbl> <chr> <dbl> <dbl>  <dbl> <dbl>       <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1        1 Upper    36  476.   292.  1.96         0.9 0.683 0.381  71.7  73.0
#> 

# Single analysis
gs_design_ahr(analysisTimes = 40)
#> $enrollRates
#> # A tibble: 3 × 3
#>   Stratum duration  rate
#>   <chr>      <dbl> <dbl>
#> 1 All            2  11.9
#> 2 All            2  23.8
#> 3 All           10  35.6
#> 
#> $failRates
#> # A tibble: 2 × 5
#>   Stratum duration failRate    hr dropoutRate
#>   <chr>      <dbl>    <dbl> <dbl>       <dbl>
#> 1 All            3   0.0770   0.9       0.001
#> 2 All          100   0.0385   0.6       0.001
#> 
#> $bounds
#> # A tibble: 1 × 11
#>   Analysis Bound  Time     N Events     Z Probability   AHR theta  info info0
#>      <dbl> <chr> <dbl> <dbl>  <dbl> <dbl>       <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1        1 Upper    40  428.   280.  1.96         0.9 0.678 0.389  68.8  69.9
#> 

# Multiple analysisTimes
gs_design_ahr(analysisTimes = c(12,24,36))
#> $enrollRates
#> # A tibble: 3 × 3
#>   Stratum duration  rate
#>   <chr>      <dbl> <dbl>
#> 1 All            2  14.0
#> 2 All            2  27.9
#> 3 All           10  41.9
#> 
#> $failRates
#> # A tibble: 2 × 5
#>   Stratum duration failRate    hr dropoutRate
#>   <chr>      <dbl>    <dbl> <dbl>       <dbl>
#> 1 All            3   0.0770   0.9       0.001
#> 2 All          100   0.0385   0.6       0.001
#> 
#> $bounds
#> # A tibble: 6 × 11
#>   Analysis Bound  Time     N Events       Z Probability   AHR theta  info info0
#>      <int> <chr> <dbl> <dbl>  <dbl>   <dbl>       <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1        1 Upper    12  419.   95.0    4.33    0.000454 0.811 0.210  23.4  23.8
#> 2        2 Upper    24  503.  229.     2.34    0.566    0.715 0.335  55.9  57.1
#> 3        3 Upper    36  503.  309.     2.01    0.900    0.683 0.381  75.8  77.1
#> 4        1 Lower    12  419.   95.0   -1.28    0.0108   0.811 0.210  23.4  23.8
#> 5        2 Lower    24  503.  229.  -Inf       0.0108   0.715 0.335  55.9  57.1
#> 6        3 Lower    36  503.  309.  -Inf       0.0108   0.683 0.381  75.8  77.1
#> 

# Specified information fraction
gs_design_ahr(IF = c(.25,.75,1), analysisTimes = 36)
#> $enrollRates
#> # A tibble: 3 × 3
#>   Stratum duration  rate
#>   <chr>      <dbl> <dbl>
#> 1 All            2  14.2
#> 2 All            2  28.4
#> 3 All           10  42.5
#> 
#> $failRates
#> # A tibble: 2 × 5
#>   Stratum duration failRate    hr dropoutRate
#>   <chr>      <dbl>    <dbl> <dbl>       <dbl>
#> 1 All            3   0.0770   0.9       0.001
#> 2 All          100   0.0385   0.6       0.001
#> 
#> $bounds
#> # A tibble: 6 × 11
#>   Analysis Bound  Time     N Events       Z Probability   AHR theta  info info0
#>      <int> <chr> <dbl> <dbl>  <dbl>   <dbl>       <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1        1 Upper  10.7  371.   78.3    4.33    0.000254 0.823 0.195  19.3  19.6
#> 2        2 Upper  24.4  511.  235.     2.34    0.585    0.714 0.337  57.4  58.7
#> 3        3 Upper  36    511.  313.     2.01    0.900    0.683 0.381  76.9  78.3
#> 4        1 Lower  10.7  371.   78.3   -1.28    0.0163   0.823 0.195  19.3  19.6
#> 5        2 Lower  24.4  511.  235.  -Inf       0.0163   0.714 0.337  57.4  58.7
#> 6        3 Lower  36    511.  313.  -Inf       0.0163   0.683 0.381  76.9  78.3
#> 

# multiple analysis times & IF
# driven by times
gs_design_ahr(IF = c(.25,.75,1), analysisTimes = c(12,25,36))
#> $enrollRates
#> # A tibble: 3 × 3
#>   Stratum duration  rate
#>   <chr>      <dbl> <dbl>
#> 1 All            2  14.0
#> 2 All            2  27.9
#> 3 All           10  41.9
#> 
#> $failRates
#> # A tibble: 2 × 5
#>   Stratum duration failRate    hr dropoutRate
#>   <chr>      <dbl>    <dbl> <dbl>       <dbl>
#> 1 All            3   0.0770   0.9       0.001
#> 2 All          100   0.0385   0.6       0.001
#> 
#> $bounds
#> # A tibble: 6 × 11
#>   Analysis Bound  Time     N Events       Z Probability   AHR theta  info info0
#>      <int> <chr> <dbl> <dbl>  <dbl>   <dbl>       <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1        1 Upper    12  419.   95.0    4.33    0.000454 0.811 0.210  23.4  23.8
#> 2        2 Upper    25  503.  236.     2.34    0.600    0.711 0.341  57.8  59.1
#> 3        3 Upper    36  503.  308.     2.01    0.900    0.683 0.381  75.8  77.1
#> 4        1 Lower    12  419.   95.0   -1.28    0.0108   0.811 0.210  23.4  23.8
#> 5        2 Lower    25  503.  236.  -Inf       0.0108   0.711 0.341  57.8  59.1
#> 6        3 Lower    36  503.  308.  -Inf       0.0108   0.683 0.381  75.8  77.1
#> 
# driven by IF
gs_design_ahr(IF = c(1/3, .8, 1), analysisTimes = c(12,25,36))
#> $enrollRates
#> # A tibble: 3 × 3
#>   Stratum duration  rate
#>   <chr>      <dbl> <dbl>
#> 1 All            2  13.9
#> 2 All            2  27.8
#> 3 All           10  41.7
#> 
#> $failRates
#> # A tibble: 2 × 5
#>   Stratum duration failRate    hr dropoutRate
#>   <chr>      <dbl>    <dbl> <dbl>       <dbl>
#> 1 All            3   0.0770   0.9       0.001
#> 2 All          100   0.0385   0.6       0.001
#> 
#> $bounds
#> # A tibble: 6 × 11
#>   Analysis Bound  Time     N Events       Z Probability   AHR theta  info info0
#>      <int> <chr> <dbl> <dbl>  <dbl>   <dbl>       <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1        1 Upper  12.5  439.   102.    4.33    0.000576 0.806 0.216  25.2  25.6
#> 2        2 Upper  26.4  501.   246.    2.34    0.640    0.706 0.348  60.1  61.4
#> 3        3 Upper  36    501.   307.    2.01    0.900    0.683 0.381  75.4  76.8
#> 4        1 Lower  12.5  439.   102.   -1.28    0.00904  0.806 0.216  25.2  25.6
#> 5        2 Lower  26.4  501.   246. -Inf       0.00904  0.706 0.348  60.1  61.4
#> 6        3 Lower  36    501.   307. -Inf       0.00904  0.683 0.381  75.4  76.8
#> 

# 2-sided symmetric design with O'Brien-Fleming spending
gs_design_ahr(analysisTimes = c(12, 24, 36),
              binding = TRUE,
              upper = gs_spending_bound,
              upar = list(sf = gsDesign::sfLDOF, total_spend = 0.025, 
                          param = NULL, timing = NULL),
              lower = gs_spending_bound,
              lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.025, 
                          param = NULL, timing = NULL),
              h1_spending = FALSE)
#> $enrollRates
#> # A tibble: 3 × 3
#>   Stratum duration  rate
#>   <chr>      <dbl> <dbl>
#> 1 All            2  13.7
#> 2 All            2  27.5
#> 3 All           10  41.2
#> 
#> $failRates
#> # A tibble: 2 × 5
#>   Stratum duration failRate    hr dropoutRate
#>   <chr>      <dbl>    <dbl> <dbl>       <dbl>
#> 1 All            3   0.0770   0.9       0.001
#> 2 All          100   0.0385   0.6       0.001
#> 
#> $bounds
#> # A tibble: 6 × 11
#>   Analysis Bound  Time     N Events     Z Probability   AHR theta  info info0
#>      <int> <chr> <dbl> <dbl>  <dbl> <dbl>       <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1        1 Upper    12  412.   93.4  3.87 0.00208     0.811 0.210  23.0  23.4
#> 2        2 Upper    24  494.  225.   2.36 0.551       0.715 0.335  54.9  56.2
#> 3        3 Upper    36  494.  303.   2.01 0.900       0.683 0.381  74.5  75.8
#> 4        1 Lower    12  412.   93.4 -3.87 0.000000532 0.811 0.210  23.0  23.4
#> 5        2 Lower    24  494.  225.  -2.36 0.00000116  0.715 0.335  54.9  56.2
#> 6        3 Lower    36  494.  303.  -2.01 0.00000120  0.683 0.381  74.5  75.8
#> 

# 2-sided asymmetric design with O'Brien-Fleming upper spending
# Pocock lower spending under H1 (NPH)
gs_design_ahr(analysisTimes = c(12, 24, 36),
              binding = TRUE,
              upper = gs_spending_bound,
              upar = list(sf = gsDesign::sfLDOF, total_spend = 0.025, 
                          param = NULL, timing = NULL),
              lower = gs_spending_bound,
              lpar = list(sf = gsDesign::sfLDPocock, total_spend = 0.1, 
                          param = NULL, timing = NULL),
              h1_spending = TRUE)
#> $enrollRates
#> # A tibble: 3 × 3
#>   Stratum duration  rate
#>   <chr>      <dbl> <dbl>
#> 1 All            2  16.5
#> 2 All            2  33.0
#> 3 All           10  49.5
#> 
#> $failRates
#> # A tibble: 2 × 5
#>   Stratum duration failRate    hr dropoutRate
#>   <chr>      <dbl>    <dbl> <dbl>       <dbl>
#> 1 All            3   0.0770   0.9       0.001
#> 2 All          100   0.0385   0.6       0.001
#> 
#> $bounds
#> # A tibble: 6 × 11
#>   Analysis Bound  Time     N Events      Z Probability   AHR theta  info info0
#>      <int> <chr> <dbl> <dbl>  <dbl>  <dbl>       <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1        1 Upper    12  495.   112.  3.87      0.00281 0.811 0.210  27.7  28.1
#> 2        2 Upper    24  594.   270.  2.36      0.639   0.715 0.335  66.0  67.5
#> 3        3 Upper    36  594.   364.  1.98      0.900   0.683 0.381  89.5  91.1
#> 4        1 Lower    12  495.   112. -0.618     0.0426  0.811 0.210  27.7  28.1
#> 5        2 Lower    24  594.   270.  1.13      0.0819  0.715 0.335  66.0  67.5
#> 6        3 Lower    36  594.   364.  1.98      0.100   0.683 0.381  89.5  91.1
#>