gs_power_npe {gsDesign2} | R Documentation |
Group sequential bound computation with non-constant effect
Description
Derives group sequential bounds and boundary crossing probabilities for a design. 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 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:
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,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()
.
Usage
gs_power_npe(
theta = 0.1,
theta0 = NULL,
theta1 = NULL,
info = 1,
info0 = NULL,
info1 = NULL,
info_scale = c("h0_h1_info", "h0_info", "h1_info"),
upper = gs_b,
upar = qnorm(0.975),
lower = gs_b,
lpar = -Inf,
test_upper = TRUE,
test_lower = TRUE,
binding = FALSE,
r = 18,
tol = 1e-06
)
Arguments
theta |
Natural parameter for group sequential design representing expected incremental drift at all analyses; used for power calculation. |
theta0 |
Natural parameter for null hypothesis, if needed for upper bound computation. |
theta1 |
Natural parameter for alternate hypothesis, if needed for lower bound computation. |
info |
Statistical information at all analyses for input |
info0 |
Statistical information under null hypothesis,
if different than |
info1 |
Statistical information under hypothesis used for
futility bound calculation if different from
|
info_scale |
Information scale for calculation. Options are:
|
upper |
Function to compute upper bound. |
upar |
Parameters passed to |
lower |
Function to compare lower bound. |
lpar |
parameters passed to |
test_upper |
Indicator of which analyses should include
an upper (efficacy) bound;
single value of |
test_lower |
Indicator of which analyses should include a lower bound;
single value of |
binding |
Indicator of whether futility bound is binding;
default of |
r |
Integer value controlling grid for numerical integration as in
Jennison and Turnbull (2000); default is 18, range is 1 to 80.
Larger values provide larger number of grid points and greater accuracy.
Normally, |
tol |
Tolerance parameter for boundary convergence (on Z-scale). |
Value
A tibble with columns as analysis index, bounds, z, crossing probability, theta (standardized treatment effect), theta1 (standardized treatment effect under alternative hypothesis), information fraction, and statistical information.
Specification
The contents of this section are shown in PDF user manual only.
Examples
library(gsDesign)
library(gsDesign2)
library(dplyr)
# Default (single analysis; Type I error controlled)
gs_power_npe(theta = 0) %>% filter(bound == "upper")
# Fixed bound
gs_power_npe(
theta = c(.1, .2, .3),
info = (1:3) * 40,
upper = gs_b,
upar = gsDesign::gsDesign(k = 3, sfu = gsDesign::sfLDOF)$upper$bound,
lower = gs_b,
lpar = c(-1, 0, 0)
)
# Same fixed efficacy bounds, no futility bound (i.e., non-binding bound), null hypothesis
gs_power_npe(
theta = rep(0, 3),
info = (1:3) * 40,
upar = gsDesign::gsDesign(k = 3, sfu = gsDesign::sfLDOF)$upper$bound,
lpar = rep(-Inf, 3)
) %>%
filter(bound == "upper")
# Fixed bound with futility only at analysis 1; efficacy only at analyses 2, 3
gs_power_npe(
theta = c(.1, .2, .3),
info = (1:3) * 40,
upper = gs_b,
upar = c(Inf, 3, 2),
lower = gs_b,
lpar = c(qnorm(.1), -Inf, -Inf)
)
# Spending function bounds
# Lower spending based on non-zero effect
gs_power_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)
)
# Same bounds, but power under different theta
gs_power_npe(
theta = c(.15, .25, .35),
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)
)
# Two-sided symmetric spend, O'Brien-Fleming spending
# Typically, 2-sided bounds are binding
x <- gs_power_npe(
theta = 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),
lower = gs_spending_bound,
lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.025, param = NULL, timing = NULL)
)
# Re-use these bounds under alternate hypothesis
# Always use binding = TRUE for power calculations
gs_power_npe(
theta = c(.1, .2, .3),
info = (1:3) * 40,
binding = TRUE,
upar = (x %>% filter(bound == "upper"))$z,
lpar = -(x %>% filter(bound == "upper"))$z
)
# Different values of `r` and `tol` lead to different numerical accuracy
# Larger `r` and smaller `tol` give better accuracy, but leads to slow computation
n_analysis <- 5
gs_power_npe(
theta = rep(0.1, n_analysis),
theta0 = NULL,
theta1 = NULL,
info = 1:n_analysis,
info0 = 1:n_analysis,
info1 = NULL,
info_scale = "h0_info",
upper = gs_spending_bound,
upar = list(sf = gsDesign::sfLDOF, total_spend = 0.025, param = NULL, timing = NULL),
lower = gs_b,
lpar = -rep(Inf, n_analysis),
test_upper = TRUE,
test_lower = FALSE,
binding = FALSE,
# Try different combinations of (r, tol) with
# r in 6, 18, 24, 30, 35, 40, 50, 60, 70, 80, 90, 100
# tol in 1e-6, 1e-12
r = 6,
tol = 1e-6
)