gs_design_npe.Rd
gs_design_npe()
derives group sequential design size, bounds and boundary crossing probabilities based on proportionate
information and effect size at analyses.
It allows a non-constant treatment effect over time, but also can be applied for the usual homogeneous effect size designs.
It requires treatment effect and proportionate statistical information at each analysis as well as a method of deriving bounds, such as spending.
The routine enables two things not available in the gsDesign package: 1) non-constant effect, 2) more flexibility in boundary selection.
For many applications, the non-proportional-hazards design function gs_design_nph()
will be used; it calls this function.
Initial bound types supported are 1) spending bounds, 2) fixed bounds, and 3) Haybittle-Peto-like bounds.
The requirement is to have a boundary update method that can each bound without knowledge of future bounds.
As an example, bounds based on conditional power that require knowledge of all future bounds are not supported by this routine;
a more limited conditional power method will be demonstrated.
Boundary family designs Wang-Tsiatis designs including the original (non-spending-function-based) O'Brien-Fleming and Pocock designs
are not supported by gs_power_npe()
.
gs_design_npe( theta = 0.1, theta1 = NULL, info = 1, info0 = NULL, info1 = NULL, alpha = 0.025, beta = 0.1, binding = FALSE, upper = gs_b, lower = gs_b, upar = qnorm(0.975), lpar = -Inf, test_upper = TRUE, test_lower = TRUE, r = 18, tol = 1e-06 )
theta | natural parameter for group sequential design representing expected incremental drift at all analyses; used for power calculation |
---|---|
theta1 | natural parameter used for lower bound spending; if |
info | proportionate statistical information at all analyses for input |
info0 | proportionate statistical information under null hypothesis, if different than alternative; impacts null hypothesis bound calculation |
info1 | proportionate statistical information under alternate hypothesis; impacts null hypothesis bound calculation |
alpha | One-sided Type I error |
beta | Type II error |
binding | indicator of whether futility bound is binding; default of FALSE is recommended |
upper | function to compute upper bound |
lower | function to compare lower bound |
upar | parameter to pass to function provided in |
lpar | Parameter passed to function provided in |
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 |
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 |
r | Integer, at least 2; default of 18 recommended by Jennison and Turnbull |
tol | Tolerance parameter for boundary convergence (on Z-scale) |
a tibble
with columns Analysis, Bound, Z, Probability, theta, info, info0
The inputs info
and info0
should be vectors of the same length with increasing positive numbers.
The design returned will change these by some constant scale factor to ensure the design has power 1 - beta
.
The bound specifications in upper, lower, upar, lpar
will be used to ensure Type I error and other boundary properties are as specified.
Keaven Anderson keaven\_anderson@merck.
library(gsDesign) # Single analysis # Lachin book p 71 difference of proportions example pc <- .28 # Control response rate pe <- .40 # Experimental response rate p0 <- (pc + pe) / 2 # Ave response rate under H0 # Information per increment of 1 in sample size info0 <- 1 / (p0 * (1 - p0) * 4) info1 <- 1 / (pc * (1 - pc) * 2 + pe * (1 - pe) * 2) # Result should round up to next even number = 652 # Divide information needed under H1 by information per patient added gs_design_npe(theta = pe - pc, info = info1, info0 = info0)$info[1] / info1#> [1] 650.7984# Fixed bound design <- gs_design_npe(theta = c(.1, .2, .3), info = (1:3) * 80, info0 = (1:3) * 80, info1 = (1:3) * 80, upper = gs_b, upar = gsDesign::gsDesign(k=3,sfu=gsDesign::sfLDOF)$upper$bound, lower = gs_b, lpar = c(-1, 0, 0)) design#> # A tibble: 6 x 9 #> Analysis Bound Z Probability theta theta1 info info0 info1 #> <int> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 1 Upper 3.71 0.00120 0.1 0.1 45.6 45.6 45.6 #> 2 2 Upper 2.51 0.273 0.2 0.2 91.1 91.1 91.1 #> 3 3 Upper 1.99 0.900 0.3 0.3 137. 137. 137. #> 4 1 Lower -1 0.0470 0.1 0.1 45.6 45.6 45.6 #> 5 2 Lower 0 0.0619 0.2 0.2 91.1 91.1 91.1 #> 6 3 Lower 0 0.0619 0.3 0.3 137. 137. 137.# Same fixed bounds, null hypothesis gs_power_npe(theta = rep(0,3), info = design$info0[1:3], upar = design$Z[1:3], lpar = design$Z[4:6])#> # A tibble: 6 x 9 #> Analysis Bound Z Probability theta theta1 info info0 info1 #> <int> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 1 Upper 3.71 0.000104 0 0 45.6 45.6 45.6 #> 2 2 Upper 2.51 0.00605 0 0 91.1 91.1 91.1 #> 3 3 Upper 1.99 0.0249 0 0 137. 137. 137. #> 4 1 Lower -1 0.159 0 0 45.6 45.6 45.6 #> 5 2 Lower 0 0.513 0 0 91.1 91.1 91.1 #> 6 3 Lower 0 0.606 0 0 137. 137. 137.# Same upper bound; this represents non-binding Type I error and will total 0.025 gs_power_npe(theta = rep(0,3), info = design$info0[1:3], upar = design$Z[1:3], lpar = rep(-Inf,3)) %>% filter(Bound=="Upper")#> # A tibble: 3 x 9 #> Analysis Bound Z Probability theta theta1 info info0 info1 #> <int> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 1 Upper 3.71 0.000104 0 0 45.6 45.6 45.6 #> 2 2 Upper 2.51 0.00605 0 0 91.1 91.1 91.1 #> 3 3 Upper 1.99 0.0250 0 0 137. 137. 137.# Spending bound examples # Design with futility only at analysis 1; efficacy only at analyses 2, 3 # Spending bound for efficacy; fixed bound for futility # NOTE: test_upper and test_lower DO NOT WORK with gs_b; must explicitly make bounds infinite # test_upper and test_lower DO WORK with gs_spending_bound design <- gs_design_npe(theta = c(.1, .2, .3), info = (1:3) * 40, info0 = (1:3) * 40, upper = gs_spending_bound, upar = list(sf = gsDesign::sfLDOF, total_spend = 0.025, param = NULL, timing = NULL), lower = gs_b, lpar = c(-1, -Inf, -Inf), test_upper = c(FALSE, TRUE, TRUE)) design#> # A tibble: 6 x 9 #> Analysis Bound Z Probability theta theta1 info info0 info1 #> <int> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 1 Upper Inf 0 0.1 0.1 44.6 44.6 44.6 #> 2 2 Upper 2.51 0.267 0.2 0.2 89.1 89.1 89.1 #> 3 3 Upper 1.99 0.900 0.3 0.3 134. 134. 134. #> 4 1 Lower -1 0.0477 0.1 0.1 44.6 44.6 44.6 #> 5 2 Lower -Inf 0.0477 0.2 0.2 89.1 89.1 89.1 #> 6 3 Lower -Inf 0.0477 0.3 0.3 134. 134. 134.# Spending function bounds # 2-sided asymmetric bounds # Lower spending based on non-zero effect gs_design_npe(theta = c(.1, .2, .3), info = (1:3) * 40, 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::sfHSD, total_spend = 0.1, param = -1, timing = NULL))#> # A tibble: 6 x 9 #> Analysis Bound Z Probability theta theta1 info info0 info1 #> <int> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 1 Upper 3.71 0.00114 0.1 0.1 43.3 43.3 43.3 #> 2 2 Upper 2.51 0.258 0.2 0.2 86.7 86.7 86.7 #> 3 3 Upper 1.99 0.900 0.3 0.3 130. 130. 130. #> 4 1 Lower -1.34 0.0230 0.1 0.1 43.3 43.3 43.3 #> 5 2 Lower 0.146 0.0552 0.2 0.2 86.7 86.7 86.7 #> 6 3 Lower 1.99 0.100 0.3 0.3 130. 130. 130.# Two-sided symmetric spend, O'Brien-Fleming spending # Typically, 2-sided bounds are binding xx <- gs_design_npe(theta = c(.1, .2, .3), theta1 = rep(0, 3), info = (1:3) * 40, binding = TRUE, upper = gs_spending_bound, upar = list(sf = gsDesign::sfLDOF, total_spend = 0.025, param = NULL, timing = NULL, theta=0), lower = gs_spending_bound, lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.025, param = NULL, timing = NULL, theta=0)) xx#> # A tibble: 6 x 9 #> Analysis Bound Z Probability theta theta1 info info0 info1 #> <int> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 1 Upper 3.71 0.00104 0.1 0 39.8 39.8 39.8 #> 2 2 Upper 2.51 0.233 0.2 0 79.5 79.5 79.5 #> 3 3 Upper 1.99 0.900 0.3 0 119. 119. 119. #> 4 1 Lower -3.71 0.00000710 0.1 0 39.8 39.8 39.8 #> 5 2 Lower -2.51 0.0000154 0.2 0 79.5 79.5 79.5 #> 6 3 Lower -1.99 0.0000154 0.3 0 119. 119. 119.# Re-use these bounds under alternate hypothesis # Always use binding = TRUE for power calculations upar <- (xx %>% filter(Bound=="Upper"))$Z gs_power_npe(theta = c(.1, .2, .3), info = (1:3) * 40, binding = TRUE, upar = upar, lpar = -upar)#> # A tibble: 6 x 9 #> Analysis Bound Z Probability theta theta1 info info0 info1 #> <int> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 1 Upper 3.71 0.00104 0.1 0.1 40 40 40 #> 2 2 Upper 2.51 0.235 0.2 0.2 80 80 80 #> 3 3 Upper 1.99 0.902 0.3 0.3 120 120 120 #> 4 1 Lower -3.71 0.00000704 0.1 0.1 40 40 40 #> 5 2 Lower -2.51 0.0000151 0.2 0.2 80 80 80 #> 6 3 Lower -1.99 0.0000151 0.3 0.3 120 120 120