| gs_power_ahr | R Documentation |
Group sequential design power using average hazard ratio under non-proportional hazards
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
)
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 |
lower |
Function to compute lower bound |
lpar |
Parameter passed to |
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 |
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 |
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) |
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.
a tibble with columns Analysis, Bound, Z, Probability, theta, Time, AHR, Events.
Contains a row for each analysis and each bound.
The contents of this section are shown in PDF user manual only.
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()
# -------------------------#
# 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))
# -------------------------#
# 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))
# -------------------------#
# 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.