Skip to contents

Group sequential design power using weighted log rank test under non-proportional hazards

Usage

gs_power_wlr(
  enrollRates = tibble(Stratum = "All", duration = c(2, 2, 10), rate = c(3, 6, 9)),
  failRates = tibble(Stratum = "All", duration = c(3, 100), failRate = log(2)/c(9, 18),
    hr = c(0.9, 0.6), dropoutRate = rep(0.001, 2)),
  events = c(30, 40, 50),
  analysisTimes = NULL,
  binding = FALSE,
  upper = gs_b,
  lower = gs_b,
  upar = gsDesign(k = 3, test.type = 1, n.I = c(30, 40, 50), maxn.IPlan = 50, sfu =
    sfLDOF, sfupar = NULL)$upper$bound,
  lpar = c(qnorm(0.1), rep(-Inf, 2)),
  test_upper = TRUE,
  test_lower = TRUE,
  ratio = 1,
  weight = wlr_weight_fh,
  info_scale = c(0, 1, 2),
  approx = "asymptotic",
  r = 18,
  tol = 1e-06
)

Arguments

enrollRates

enrollment rates

failRates

failure and dropout rates

events

Targeted events 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

lower

Function to compute lower bound

upar

Parameter passed to upper()

lpar

Parameter passed to lower()

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

ratio

Experimental:Control randomization ratio (not yet implemented)

weight

weight of weighted log rank test

  • "1"=unweighted,

  • "n"=Gehan-Breslow,

  • "sqrtN"=Tarone-Ware,

  • "FH_p[a]_q[b]"= Fleming-Harrington with p=a and q=b

info_scale

the information scale for calculation

approx

approximate estimation method for Z statistics

  • "event driven" = only work under proportional hazard model with log rank test

  • "asymptotic"

r

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

tol

Tolerance parameter for boundary convergence (on Z-scale)

Specification

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

Examples

library(tibble)
library(gsDesign)
library(gsDesign2)

# set enrollment rates
enrollRates <- tibble(Stratum = "All", duration = 12, rate = 500/12)

# set failure rates
failRates <- tibble(
  Stratum = "All",
  duration = c(4, 100),
  failRate = log(2) / 15,  # median survival 15 month
  hr = c(1, .6),
  dropoutRate = 0.001)
  
# set the targeted number of events and analysis time
target_events <- c(30, 40, 50)
target_analysisTime <- c(10, 24, 30)

# -------------------------#
#       example 1          #
# ------------------------ #
# fixed bounds and calculate the power for targeted number of events
gs_power_wlr(
  enrollRates = enrollRates,
  failRates = failRates,
  events = target_events,
  analysisTimes = NULL,
  upper = gs_b,
  upar = gsDesign(k = length(target_events), test.type = 1, n.I = target_events, maxn.IPlan = max(target_events), sfu = sfLDOF, sfupar = NULL)$upper$bound,
  lower = gs_b,
  lpar = c(qnorm(.1), rep(-Inf, 2)))
#> $enrollRates
#> # A tibble: 1 × 3
#>   Stratum duration  rate
#>   <chr>      <dbl> <dbl>
#> 1 All           12  41.7
#> 
#> $failRates
#> # A tibble: 2 × 5
#>   Stratum duration failRate    hr dropoutRate
#>   <chr>      <dbl>    <dbl> <dbl>       <dbl>
#> 1 All            4   0.0462   1         0.001
#> 2 All          100   0.0462   0.6       0.001
#> 
#> $bounds
#> # A tibble: 6 × 7
#>   Analysis Bound Probability Probability0       Z `~HR at bound` `Nominal p`
#>      <int> <chr>       <dbl>        <dbl>   <dbl>          <dbl>       <dbl>
#> 1        1 Upper     0.00470      0.00381    2.67          0.377     0.00381
#> 2        1 Lower     0.0881       0.100     -1.28          1.60      0.9    
#> 3        2 Upper     0.0182       0.0127     2.29          0.485     0.0110 
#> 4        2 Lower     0.0881       0.100   -Inf           Inf         1      
#> 5        3 Upper     0.0439       0.0268     2.03          0.563     0.0211 
#> 6        3 Lower     0.0881       0.100   -Inf           Inf         1      
#> 
#> $analysis
#>   Analysis     Time        N   Events       AHR      theta     info    info0
#> 1        1 5.893973 245.5822 30.00022 0.9636346 0.03704306 3.683843 3.684245
#> 2        2 6.900914 287.5381 39.99994 0.9373448 0.06470406 5.749098 5.750773
#> 3        3 7.808461 325.3525 50.00009 0.9155821 0.08819526 8.132517 8.136765
#>          IF       IF0
#> 1 0.4529769 0.4527898
#> 2 0.7069273 0.7067640
#> 3 1.0000000 1.0000000
#> 
#> attr(,"class")
#> [1] "wlr"       "gs_design" "list"     
  
# -------------------------#
#       example 2          #
# ------------------------ #
# fixed bounds and calculate the power for targeted analysis time
gs_power_wlr(
  enrollRates = enrollRates,
  failRates = failRates,
  events = NULL,
  analysisTimes = target_analysisTime,
  upper = gs_b,
  upar = gsDesign(k = length(target_events), test.type = 1, n.I = target_events, maxn.IPlan = max(target_events), sfu = sfLDOF, sfupar = NULL)$upper$bound,
  lower = gs_b,
  lpar = c(qnorm(.1), rep(-Inf, 2)))
#> $enrollRates
#> # A tibble: 1 × 3
#>   Stratum duration  rate
#>   <chr>      <dbl> <dbl>
#> 1 All           12  41.7
#> 
#> $failRates
#> # A tibble: 2 × 5
#>   Stratum duration failRate    hr dropoutRate
#>   <chr>      <dbl>    <dbl> <dbl>       <dbl>
#> 1 All            4   0.0462   1         0.001
#> 2 All          100   0.0462   0.6       0.001
#> 
#> $bounds
#> # A tibble: 6 × 7
#>   Analysis Bound Probability Probability0       Z `~HR at bound` `Nominal p`
#>      <int> <chr>       <dbl>        <dbl>   <dbl>          <dbl>       <dbl>
#> 1        1 Upper      0.0172      0.00381    2.67          0.546     0.00381
#> 2        1 Lower      0.0335      0.100     -1.28          1.34      0.9    
#> 3        2 Upper      0.622       0.0141     2.29          0.747     0.0110 
#> 4        2 Lower      0.0335      0.100   -Inf           Inf         1      
#> 5        3 Upper      0.842       0.0263     2.03          0.789     0.0211 
#> 6        3 Lower      0.0335      0.100   -Inf           Inf         1      
#> 
#> $analysis
#>   Analysis Time        N    Events       AHR     theta     info    info0
#> 1        1   10 416.6667  77.80361 0.8720599 0.1368971 16.20843 16.22923
#> 2        2   24 500.0000 246.28341 0.7164215 0.3334865 61.35217 62.08666
#> 3        3   30 500.0000 293.69568 0.6955693 0.3630247 72.91885 74.25144
#>          IF       IF0
#> 1 0.2222803 0.2185712
#> 2 0.8413760 0.8361677
#> 3 1.0000000 1.0000000
#> 
#> attr(,"class")
#> [1] "wlr"       "gs_design" "list"     

# -------------------------#
#       example 3          #
# ------------------------ #
# fixed bounds and calculate the power for targeted analysis time & number of events
gs_power_wlr(
  enrollRates = enrollRates,
  failRates = failRates,
  events = target_events,
  analysisTimes = target_analysisTime,
  upper = gs_b,
  upar = gsDesign(k = length(target_events), test.type = 1, n.I = target_events, maxn.IPlan = max(target_events), sfu = sfLDOF, sfupar = NULL)$upper$bound,
  lower = gs_b,
  lpar = c(qnorm(.1), rep(-Inf, 2)))
#> $enrollRates
#> # A tibble: 1 × 3
#>   Stratum duration  rate
#>   <chr>      <dbl> <dbl>
#> 1 All           12  41.7
#> 
#> $failRates
#> # A tibble: 2 × 5
#>   Stratum duration failRate    hr dropoutRate
#>   <chr>      <dbl>    <dbl> <dbl>       <dbl>
#> 1 All            4   0.0462   1         0.001
#> 2 All          100   0.0462   0.6       0.001
#> 
#> $bounds
#> # A tibble: 6 × 7
#>   Analysis Bound Probability Probability0       Z `~HR at bound` `Nominal p`
#>      <int> <chr>       <dbl>        <dbl>   <dbl>          <dbl>       <dbl>
#> 1        1 Upper      0.0172      0.00381    2.67          0.546     0.00381
#> 2        1 Lower      0.0335      0.100     -1.28          1.34      0.9    
#> 3        2 Upper      0.622       0.0141     2.29          0.747     0.0110 
#> 4        2 Lower      0.0335      0.100   -Inf           Inf         1      
#> 5        3 Upper      0.842       0.0263     2.03          0.789     0.0211 
#> 6        3 Lower      0.0335      0.100   -Inf           Inf         1      
#> 
#> $analysis
#>   Analysis Time        N    Events       AHR     theta     info    info0
#> 1        1   10 416.6667  77.80361 0.8720599 0.1368971 16.20843 16.22923
#> 2        2   24 500.0000 246.28341 0.7164215 0.3334865 61.35217 62.08666
#> 3        3   30 500.0000 293.69568 0.6955693 0.3630247 72.91885 74.25144
#>          IF       IF0
#> 1 0.2222803 0.2185712
#> 2 0.8413760 0.8361677
#> 3 1.0000000 1.0000000
#> 
#> attr(,"class")
#> [1] "wlr"       "gs_design" "list"     
  
# -------------------------#
#       example 4          #
# ------------------------ #
# spending bounds and calculate the power for targeted number of events
gs_power_wlr(
  enrollRates = enrollRates,
  failRates = failRates,
  events = target_events,
  analysisTimes = NULL,
  upper = gs_spending_bound,
  upar = list(sf = gsDesign::sfLDOF, total_spend = 0.025),
  lower = gs_spending_bound,
  lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.2))
#> $enrollRates
#> # A tibble: 1 × 3
#>   Stratum duration  rate
#>   <chr>      <dbl> <dbl>
#> 1 All           12  41.7
#> 
#> $failRates
#> # A tibble: 2 × 5
#>   Stratum duration failRate    hr dropoutRate
#>   <chr>      <dbl>    <dbl> <dbl>       <dbl>
#> 1 All            4   0.0462   1         0.001
#> 2 All          100   0.0462   0.6       0.001
#> 
#> $bounds
#> # A tibble: 6 × 7
#>   Analysis Bound Probability Probability0      Z `~HR at bound` `Nominal p`
#>      <int> <chr>       <dbl>        <dbl>  <dbl>          <dbl>       <dbl>
#> 1        1 Upper     0.00110     0.000865  3.13           0.319    0.000865
#> 2        1 Lower     0.0569      0.0568   -1.58           1.78     0.943   
#> 3        2 Upper     0.0115      0.00767   2.44           0.463    0.00739 
#> 4        2 Lower     0.127       0.127    -1.22           1.47     0.889   
#> 5        3 Upper     0.0427      0.0250    2.00           0.568    0.0226  
#> 6        3 Lower     0.200       0.2      -0.990          1.32     0.839   
#> 
#> $analysis
#>   Analysis     Time        N   Events       AHR      theta     info    info0
#> 1        1 5.893973 245.5822 30.00022 0.9636346 0.03704306 3.683843 3.684245
#> 2        2 6.900914 287.5381 39.99994 0.9373448 0.06470406 5.749098 5.750773
#> 3        3 7.808461 325.3525 50.00009 0.9155821 0.08819526 8.132517 8.136765
#>          IF       IF0
#> 1 0.4529769 0.4527898
#> 2 0.7069273 0.7067640
#> 3 1.0000000 1.0000000
#> 
#> attr(,"class")
#> [1] "wlr"       "gs_design" "list"     
  
# -------------------------#
#       example 5          #
# ------------------------ #
# spending bounds and calculate the power for targeted analysis time
gs_power_wlr(
  enrollRates = enrollRates,
  failRates = failRates,
  events = NULL,
  analysisTimes = target_analysisTime,
  upper = gs_spending_bound,
  upar = list(sf = gsDesign::sfLDOF, total_spend = 0.025),
  lower = gs_spending_bound,
  lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.2))
#> $enrollRates
#> # A tibble: 1 × 3
#>   Stratum duration  rate
#>   <chr>      <dbl> <dbl>
#> 1 All           12  41.7
#> 
#> $failRates
#> # A tibble: 2 × 5
#>   Stratum duration failRate    hr dropoutRate
#>   <chr>      <dbl>    <dbl> <dbl>       <dbl>
#> 1 All            4   0.0462   1         0.001
#> 2 All          100   0.0462   0.6       0.001
#> 
#> $bounds
#> # A tibble: 6 × 7
#>   Analysis Bound Probability Probability0      Z `~HR at bound` `Nominal p`
#>      <int> <chr>       <dbl>        <dbl>  <dbl>          <dbl>       <dbl>
#> 1        1 Upper   0.0000207   0.00000163  4.65           0.348  0.00000163
#> 2        1 Lower   0.00659     0.00612    -2.51           1.76   0.994     
#> 3        2 Upper   0.663       0.0142      2.19           0.756  0.0142    
#> 4        2 Lower   0.162       0.161      -0.998          1.14   0.841     
#> 5        3 Upper   0.811       0.0250      2.04           0.789  0.0209    
#> 6        3 Lower   0.200       0.2        -1.00           1.12   0.842     
#> 
#> $analysis
#>   Analysis Time        N    Events       AHR     theta     info    info0
#> 1        1   10 416.6667  77.80361 0.8720599 0.1368971 16.20843 16.22923
#> 2        2   24 500.0000 246.28341 0.7164215 0.3334865 61.35217 62.08666
#> 3        3   30 500.0000 293.69568 0.6955693 0.3630247 72.91885 74.25144
#>          IF       IF0
#> 1 0.2222803 0.2185712
#> 2 0.8413760 0.8361677
#> 3 1.0000000 1.0000000
#> 
#> attr(,"class")
#> [1] "wlr"       "gs_design" "list"     
  
# -------------------------#
#       example 6          #
# ------------------------ #
# spending bounds and calculate the power for targeted analysis time & number of events
gs_power_wlr(
  enrollRates = enrollRates,
  failRates = failRates,
  events = target_events,
  analysisTimes = target_analysisTime,
  upper = gs_spending_bound,
  upar = list(sf = gsDesign::sfLDOF, total_spend = 0.025),
  lower = gs_spending_bound,
  lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.2))
#> $enrollRates
#> # A tibble: 1 × 3
#>   Stratum duration  rate
#>   <chr>      <dbl> <dbl>
#> 1 All           12  41.7
#> 
#> $failRates
#> # A tibble: 2 × 5
#>   Stratum duration failRate    hr dropoutRate
#>   <chr>      <dbl>    <dbl> <dbl>       <dbl>
#> 1 All            4   0.0462   1         0.001
#> 2 All          100   0.0462   0.6       0.001
#> 
#> $bounds
#> # A tibble: 6 × 7
#>   Analysis Bound Probability Probability0      Z `~HR at bound` `Nominal p`
#>      <int> <chr>       <dbl>        <dbl>  <dbl>          <dbl>       <dbl>
#> 1        1 Upper   0.0000207   0.00000163  4.65           0.348  0.00000163
#> 2        1 Lower   0.00659     0.00612    -2.51           1.76   0.994     
#> 3        2 Upper   0.663       0.0142      2.19           0.756  0.0142    
#> 4        2 Lower   0.162       0.161      -0.998          1.14   0.841     
#> 5        3 Upper   0.811       0.0250      2.04           0.789  0.0209    
#> 6        3 Lower   0.200       0.2        -1.00           1.12   0.842     
#> 
#> $analysis
#>   Analysis Time        N    Events       AHR     theta     info    info0
#> 1        1   10 416.6667  77.80361 0.8720599 0.1368971 16.20843 16.22923
#> 2        2   24 500.0000 246.28341 0.7164215 0.3334865 61.35217 62.08666
#> 3        3   30 500.0000 293.69568 0.6955693 0.3630247 72.91885 74.25144
#>          IF       IF0
#> 1 0.2222803 0.2185712
#> 2 0.8413760 0.8361677
#> 3 1.0000000 1.0000000
#> 
#> attr(,"class")
#> [1] "wlr"       "gs_design" "list"