Group sequential design using average hazard ratio under non-proportional hazards
Source:R/gs_design_ahr.R
gs_design_ahr.Rd
Group sequential design using average hazard ratio under non-proportional hazards
Usage
gs_design_ahr(
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)),
ratio = 1,
alpha = 0.025,
beta = 0.1,
IF = NULL,
analysisTimes = 36,
binding = FALSE,
upper = gs_b,
upar = gsDesign::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,
info_scale = c(0, 1, 2),
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- info_scale
the information scale for calculation
- r
Integer, at least 2; default of 18 recommended by Jennison and Turnbull
- tol
Tolerance parameter for boundary convergence (on Z-scale)
Examples
library(gsDesign)
#> Loading required package: ggplot2
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 × 7
#> Analysis Bound Probability Probability0 Z `~HR at bound` `Nominal p`
#> <dbl> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 Upper 0.9 0.025 1.96 0.795 0.0250
#>
#> $analysis
#> # A tibble: 1 × 9
#> Analysis Time N Events AHR theta info info0 IF
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 36 476. 292. 0.683 0.381 71.7 73.0 1
#>
#> attr(,"class")
#> [1] "ahr" "gs_design" "list"
# 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 × 7
#> Analysis Bound Probability Probability0 Z `~HR at bound` `Nominal p`
#> <dbl> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 Upper 0.9 0.025 1.96 0.791 0.0250
#>
#> $analysis
#> # A tibble: 1 × 9
#> Analysis Time N Events AHR theta info info0 IF
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 40 428. 280. 0.678 0.389 68.8 69.9 1
#>
#> attr(,"class")
#> [1] "ahr" "gs_design" "list"
# 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 × 7
#> Analysis Bound Probability Probability0 Z `~HR at bound` `Nominal p`
#> <int> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 Upper 0.000507 0.00000848 4.33 0.411 0.00000737
#> 2 1 Lower 0.0111 0.102 -1.28 1.30 0.9
#> 3 2 Upper 0.566 0.00965 2.34 0.734 0.00965
#> 4 2 Lower 0.0111 0.102 -Inf Inf 1
#> 5 3 Upper 0.900 0.0251 2.01 0.795 0.0221
#> 6 3 Lower 0.0111 0.102 -Inf Inf 1
#>
#> $analysis
#> # A tibble: 3 × 9
#> Analysis Time N Events AHR theta info info0 IF
#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 12 419. 95.0 0.811 0.210 23.4 23.8 0.309
#> 2 2 24 503. 228. 0.715 0.335 55.9 57.1 0.738
#> 3 3 36 503. 308. 0.683 0.381 75.8 77.1 1
#>
#> attr(,"class")
#> [1] "ahr" "gs_design" "list"
# 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 × 7
#> Analysis Bound Probability Probability0 Z `~HR at bound` `Nominal p`
#> <int> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 Upper 0.000282 0.00000836 4.33 0.376 0.00000737
#> 2 1 Lower 0.0166 0.101 -1.28 1.34 0.9
#> 3 2 Upper 0.585 0.00965 2.34 0.737 0.00965
#> 4 2 Lower 0.0166 0.101 -Inf Inf 1
#> 5 3 Upper 0.900 0.0250 2.01 0.797 0.0221
#> 6 3 Lower 0.0166 0.101 -Inf Inf 1
#>
#> $analysis
#> # A tibble: 3 × 9
#> Analysis Time N Events AHR theta info info0 IF
#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 10.7 371. 78.3 0.823 0.195 19.3 19.6 0.251
#> 2 2 24.4 510. 235. 0.714 0.337 57.4 58.7 0.747
#> 3 3 36 510. 313. 0.683 0.381 76.9 78.3 1
#>
#> attr(,"class")
#> [1] "ahr" "gs_design" "list"
# 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 × 7
#> Analysis Bound Probability Probability0 Z `~HR at bound` `Nominal p`
#> <int> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 Upper 0.000507 0.00000848 4.33 0.411 0.00000737
#> 2 1 Lower 0.0111 0.102 -1.28 1.30 0.9
#> 3 2 Upper 0.600 0.00965 2.34 0.738 0.00965
#> 4 2 Lower 0.0111 0.102 -Inf Inf 1
#> 5 3 Upper 0.900 0.0248 2.01 0.795 0.0221
#> 6 3 Lower 0.0111 0.102 -Inf Inf 1
#>
#> $analysis
#> # A tibble: 3 × 9
#> Analysis Time N Events AHR theta info info0 IF
#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 12 419. 95.0 0.811 0.210 23.4 23.7 0.309
#> 2 2 25 503. 236. 0.711 0.341 57.8 59.1 0.763
#> 3 3 36 503. 308. 0.683 0.381 75.7 77.1 1
#>
#> attr(,"class")
#> [1] "ahr" "gs_design" "list"
# 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 × 7
#> Analysis Bound Probability Probability0 Z `~HR at bound` `Nominal p`
#> <int> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 Upper 0.000645 0.00000852 4.33 0.425 0.00000737
#> 2 1 Lower 0.00928 0.102 -1.28 1.29 0.9
#> 3 2 Upper 0.640 0.00965 2.34 0.742 0.00965
#> 4 2 Lower 0.00928 0.102 -Inf Inf 1
#> 5 3 Upper 0.900 0.0244 2.01 0.795 0.0221
#> 6 3 Lower 0.00928 0.102 -Inf Inf 1
#>
#> $analysis
#> # A tibble: 3 × 9
#> Analysis Time N Events AHR theta info info0 IF
#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 12.5 439. 102. 0.806 0.216 25.2 25.6 0.334
#> 2 2 26.4 501. 246. 0.706 0.348 60.1 61.4 0.797
#> 3 3 36 501. 307. 0.683 0.381 75.4 76.8 1
#>
#> attr(,"class")
#> [1] "ahr" "gs_design" "list"
# 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 × 7
#> Analysis Bound Probability Probability0 Z `~HR at bound` `Nominal p`
#> <int> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 Upper 0.00226 0.0000603 3.87 0.449 0.0000538
#> 2 1 Lower 0.000000613 0.0000603 -3.87 2.23 1.00
#> 3 2 Upper 0.550 0.00922 2.36 0.730 0.00919
#> 4 2 Lower 0.00000125 0.00922 -2.36 1.37 0.991
#> 5 3 Upper 0.900 0.0250 2.01 0.794 0.0222
#> 6 3 Lower 0.00000128 0.0250 -2.01 1.26 0.978
#>
#> $analysis
#> # A tibble: 3 × 9
#> Analysis Time N Events AHR theta info info0 IF
#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 12 412. 93.4 0.811 0.210 23.0 23.3 0.309
#> 2 2 24 494. 224. 0.715 0.335 54.9 56.1 0.738
#> 3 3 36 494. 303. 0.683 0.381 74.4 75.8 1
#>
#> attr(,"class")
#> [1] "ahr" "gs_design" "list"
# 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 32.9
#> 3 All 10 49.4
#>
#> $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 × 7
#> Analysis Bound Probability Probability0 Z `~HR at bound` `Nominal p`
#> <int> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 Upper 0.00305 0.0000603 3.87 0.481 0.0000538
#> 2 1 Lower 0.0430 0.269 -0.619 1.12 0.732
#> 3 2 Upper 0.638 0.00922 2.36 0.750 0.00920
#> 4 2 Lower 0.0823 0.875 1.13 0.871 0.129
#> 5 3 Upper 0.900 0.0250 1.98 0.813 0.0240
#> 6 3 Lower 0.100 0.976 1.97 0.813 0.0243
#>
#> $analysis
#> # A tibble: 3 × 9
#> Analysis Time N Events AHR theta info info0 IF
#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 12 494. 112. 0.811 0.210 27.6 28.0 0.309
#> 2 2 24 593. 269. 0.715 0.335 65.9 67.3 0.738
#> 3 3 36 593. 364. 0.683 0.381 89.3 90.9 1
#>
#> attr(,"class")
#> [1] "ahr" "gs_design" "list"