Group sequential design using average hazard ratio under non-proportional hazards
Source:R/gs_design_rd.R
gs_design_rd.Rd
Group sequential design using average hazard ratio under non-proportional hazards
Usage
gs_design_rd(
p_c = tibble(Stratum = "All", Rate = 0.2),
p_e = tibble(Stratum = "All", Rate = 0.15),
IF = 1:3/3,
rd0 = 0,
alpha = 0.025,
beta = 0.1,
ratio = 1,
stratum_prev = NULL,
weight = c("un-stratified", "ss", "invar"),
upper = gs_b,
lower = gs_b,
upar = gsDesign(k = 3, test.type = 1, sfu = sfLDOF, sfupar = NULL)$upper$bound,
lpar = c(qnorm(0.1), rep(-Inf, 2)),
test_upper = TRUE,
test_lower = TRUE,
info_scale = c(0, 1, 2),
binding = FALSE,
r = 18,
tol = 1e-06,
h1_spending = FALSE
)
Arguments
- p_c
rate at the control group
- p_e
rate at the experimental group
- IF
statistical information fraction
- rd0
treatment effect under super-superiority designs, the default is 0
- alpha
One-sided Type I error
- beta
Type II error
- ratio
Experimental:Control randomization ratio (not yet implemented)
- stratum_prev
randomization ratio of different stratum. If it is un-stratified design then
NULL
. Otherwise it is a tibble containing two columns (Stratum and prevalence).- weight
the weighting scheme for stratified population
- 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- info_scale
the information scale for calculation
- binding
indicator of whether futility bound is binding; default of FALSE is recommended
- r
Integer, at least 2; default of 18 recommended by Jennison and Turnbull
- tol
Tolerance parameter for boundary convergence (on Z-scale)
- h1_spending
Indicator that lower bound to be set by spending under alternate hypothesis (input
failRates
) if spending is used for lower bound
Examples
library(tibble)
library(gsDesign)
# ----------------- #
# example 1 #
#------------------ #
# un-stratified group sequential design
gs_design_rd(
p_c = tibble(Stratum = "All", Rate = .2),
p_e = tibble(Stratum = "All", Rate = .15),
IF = c(0.7, 1),
rd0 = 0,
alpha = .025,
beta = .1,
ratio = 1,
stratum_prev = NULL,
weight = "un-stratified",
upper = gs_b,
lower = gs_b,
upar = gsDesign(k = 3, test.type = 1, sfu = sfLDOF, sfupar = NULL)$upper$bound,
lpar = c(qnorm(.1), rep(-Inf, 2))
)
#> $bounds
#> # A tibble: 4 × 7
#> Analysis Bound Probability Probability0 Z ~Risk difference at …¹ Nomin…²
#> <int> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 Upper 0.297 0.000100 3.71 0.0582 1.04e-4
#> 2 1 Lower 0.00000389 0.0995 -1.28 -0.0201 9 e-1
#> 3 2 Upper 0.900 0.00602 2.51 0.0330 6.01e-3
#> 4 2 Lower 0.00000389 0.0995 -Inf -Inf 1 e+0
#> # … with abbreviated variable names ¹`~Risk difference at bound`, ²`Nominal p`
#>
#> $analysis
#> # A tibble: 2 × 8
#> Analysis N rd rd0 info info0 IF IF0
#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 2336. 0.05 0 4062. 4044. 0.7 0.7
#> 2 2 3337. 0.05 0 5803. 5778. 1 1
#>
#> attr(,"class")
#> [1] "rd" "gs_design" "list"
# ----------------- #
# example 2 #
# ----------------- #
# stratified group sequential design
gs_design_rd(
p_c = tibble(Stratum = c("biomarker positive", "biomarker negative"), Rate = c(.2, .25)),
p_e = tibble(Stratum = c("biomarker positive", "biomarker negative"), Rate = c(.15,.22)),
IF = c(0.7, 1),
rd0 = 0,
alpha = .025,
beta = .1,
ratio = 1,
stratum_prev = tibble(Stratum = c("biomarker positive", "biomarker negative"), prevalence = c(.4, .6)),
weight = "ss",
upper = gs_spending_bound,lower = gs_b,
upar = list(sf = gsDesign::sfLDOF, total_spend = 0.025, param = NULL, timing = NULL),
lpar = rep(-Inf, 2)
)
#> $bounds
#> # A tibble: 4 × 7
#> Analysis Bound Probability Probability0 Z ~Risk difference at …¹ Nomin…²
#> <int> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 Upper 0.616 0.00733 2.44 0.0339 0.00738
#> 2 1 Lower 0 0 -Inf -Inf 1
#> 3 2 Upper 0.900 0.0249 2.00 0.0232 0.0228
#> 4 2 Lower 0 0 -Inf -Inf 1
#> # … with abbreviated variable names ¹`~Risk difference at bound`, ²`Nominal p`
#>
#> $analysis
#> # A tibble: 2 × 8
#> Analysis N rd rd0 info info0 IF IF0
#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 3426. 0.038 0 5184. 5172. 0.7 0.7
#> 2 2 4894. 0.038 0 7406. 7388. 1 1
#>
#> attr(,"class")
#> [1] "rd" "gs_design" "list"