Group sequential design power using average hazard ratio under non-proportional hazards
Source:R/gs_power_ahr.R
gs_power_ahr.RdGroup sequential design power using average hazard ratio under non-proportional hazards
Usage
gs_power_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)),
events = c(30, 40, 50),
analysisTimes = NULL,
upper = gs_b,
upar = gsDesign(k = length(events), test.type = 1, n.I = events, maxn.IPlan =
max(events), sfu = sfLDOF, sfupar = NULL)$upper$bound,
lower = gs_b,
lpar = c(qnorm(0.1), rep(-Inf, 2)),
test_lower = TRUE,
test_upper = TRUE,
ratio = 1,
binding = FALSE,
info_scale = c(0, 1, 2),
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
- upper
Function to compute upper bound
- upar
Parameter passed to
upper()- lower
Function to compute lower bound
- lpar
Parameter passed to
lower()- 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
infoshould indicate which analyses will have a 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
infoshould indicate which analyses will have an efficacy bound- ratio
Experimental:Control randomization ratio (not yet implemented)
- binding
indicator of whether futility bound is binding; default of FALSE is recommended
- 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)
Value
a tibble with columns Analysis, Bound, Z, Probability, theta, Time, AHR, Events.
Contains a row for each analysis and each bound.
Details
Bound satisfy input upper bound specification in upper, upar and lower bound specification in lower, lpar.
The AHR() function computes statistical information at targeted event times.
The tEvents() function is used to get events and average HR at targeted analysisTimes.
Examples
library(gsDesign2)
library(dplyr)
# -------------------------#
# example 1 #
# ------------------------ #
# The default output of \code{gs_power_ahr} is driven by events, i.e.,
# \code{events = c(30, 40, 50), analysisTimes = NULL}
gs_power_ahr()
#> $enrollRates
#> # A tibble: 3 × 3
#> Stratum duration rate
#> <chr> <dbl> <dbl>
#> 1 All 2 3
#> 2 All 2 6
#> 3 All 10 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.0231 0.00381 2.67 0.374 0.00381
#> 2 1 Lower 0.0273 0.100 -1.28 1.60 0.9
#> 3 2 Upper 0.0897 0.0122 2.29 0.481 0.0110
#> 4 2 Lower 0.0273 0.100 -Inf Inf 1
#> 5 3 Upper 0.207 0.0250 2.03 0.559 0.0211
#> 6 3 Lower 0.0273 0.100 -Inf Inf 1
#>
#> $analysis
#> # A tibble: 3 × 10
#> Analysis Time N Events AHR theta info info0 IF IF0
#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 14.9 108 30.0 0.787 0.240 7.37 7.50 0.603 0.600
#> 2 2 19.2 108 40.0 0.744 0.295 9.79 10.0 0.801 0.800
#> 3 3 24.5 108 50.0 0.713 0.339 12.2 12.5 1 1
#>
#> attr(,"class")
#> [1] "ahr" "gs_design" "list"
# -------------------------#
# example 2 #
# -------------------------#
# 2-sided symmetric O'Brien-Fleming spending bound,
# driven by analysis time, i.e., \code{events = NULL, analysisTimes = c(12, 24, 36)}
gs_power_ahr(
analysisTimes = c(12, 24, 36),
events = NULL,
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))
#> $enrollRates
#> # A tibble: 3 × 3
#> Stratum duration rate
#> <chr> <dbl> <dbl>
#> 1 All 2 3
#> 2 All 2 6
#> 3 All 10 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.000370 0.0000538 3.87 0.178 0.0000538
#> 2 1 Lower 0.0000612 0.0000538 -3.40 4.55 1.00
#> 3 2 Upper 0.116 0.00921 2.36 0.506 0.00919
#> 4 2 Lower 0.00907 0.00921 -1.20 1.42 0.885
#> 5 3 Upper 0.324 0.0250 2.01 0.608 0.0222
#> 6 3 Lower 0.0250 0.0250 -0.473 1.12 0.682
#>
#> $analysis
#> # A tibble: 3 × 10
#> Analysis Time N Events AHR theta info info0 IF IF0
#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 12 90 20.4 0.811 0.210 5.03 5.10 0.309 0.308
#> 2 2 24 108 49.1 0.715 0.335 12.0 12.3 0.738 0.741
#> 3 3 36 108 66.2 0.683 0.381 16.3 16.6 1 1
#>
#> attr(,"class")
#> [1] "ahr" "gs_design" "list"
# -------------------------#
# example 3 #
# -------------------------#
# 2-sided symmetric O'Brien-Fleming spending bound,
# driven by events, i.e., \code{events = c(20, 50, 70), analysisTimes = NULL}
gs_power_ahr(
analysisTimes = NULL,
events = c(20, 50, 70),
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))
#> $enrollRates
#> # A tibble: 3 × 3
#> Stratum duration rate
#> <chr> <dbl> <dbl>
#> 1 All 2 3
#> 2 All 2 6
#> 3 All 10 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.000198 0.0000275 4.03 0.163 0.0000275
#> 2 1 Lower 0.0000312 0.0000275 -3.57 4.98 1.00
#> 3 2 Upper 0.110 0.00800 2.41 0.502 0.00799
#> 4 2 Lower 0.00782 0.00800 -1.23 1.42 0.891
#> 5 3 Upper 0.352 0.0250 2.00 0.617 0.0226
#> 6 3 Lower 0.0250 0.0250 -0.393 1.10 0.653
#>
#> $analysis
#> # A tibble: 3 × 10
#> Analysis Time N Events AHR theta info info0 IF IF0
#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 11.9 88.8 20.0 0.812 0.208 4.93 5.00 0.286 0.286
#> 2 2 24.5 108 50.0 0.713 0.339 12.2 12.5 0.710 0.714
#> 3 3 39.4 108 70.0 0.679 0.388 17.2 17.5 1 1
#>
#> attr(,"class")
#> [1] "ahr" "gs_design" "list"
# -------------------------#
# example 4 #
# -------------------------#
# 2-sided symmetric O'Brien-Fleming spending bound,
# driven by both `events` and `analysisTimes`, i.e.,
# both `events` and `analysisTimes` are not `NULL`,
# then the analysis will driven by the maximal one, i.e.,
# Time = max(analysisTime, calculated Time for targeted events)
# Events = max(events, calculated events for targeted analysisTime)
gs_power_ahr(
analysisTimes = c(12, 24, 36),
events = c(30, 40, 50),
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))
#> $enrollRates
#> # A tibble: 3 × 3
#> Stratum duration rate
#> <chr> <dbl> <dbl>
#> 1 All 2 3
#> 2 All 2 6
#> 3 All 10 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.00706 0.000867 3.13 0.316 0.000867
#> 2 1 Lower 0.000935 0.000867 -2.48 2.49 0.993
#> 3 2 Upper 0.115 0.00921 2.37 0.505 0.00892
#> 4 2 Lower 0.00912 0.00921 -1.21 1.42 0.888
#> 5 3 Upper 0.324 0.0250 2.01 0.607 0.0222
#> 6 3 Lower 0.0251 0.0250 -0.474 1.12 0.682
#>
#> $analysis
#> # A tibble: 3 × 10
#> Analysis Time N Events AHR theta info info0 IF IF0
#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 14.9 108 30.0 0.787 0.240 7.37 7.50 0.453 0.453
#> 2 2 24 108 49.1 0.715 0.335 12.0 12.3 0.738 0.741
#> 3 3 36 108 66.2 0.683 0.381 16.3 16.6 1 1
#>
#> attr(,"class")
#> [1] "ahr" "gs_design" "list"