gs_power_wlr: Group sequential design power using weighted log rank test...

View source: R/gs_power_wlr.R

gs_power_wlrR Documentation

Group sequential design power using weighted log rank test under non-proportional hazards

Description

Group sequential design power using weighted log rank test under non-proportional hazards

Usage

gs_power_wlr(
  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,
  binding = FALSE,
  upper = gs_b,
  lower = gs_b,
  upar = gsDesign(k = 3, test.type = 1, n.I = c(30, 40, 50), maxn.IPlan = 50, sfu =
    sfLDOF, sfupar = NULL)$upper$bound,
  lpar = c(qnorm(0.1), rep(-Inf, 2)),
  test_upper = TRUE,
  test_lower = TRUE,
  ratio = 1,
  weight = wlr_weight_fh,
  info_scale = c(0, 1, 2),
  approx = "asymptotic",
  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

binding

indicator of whether futility bound is binding; default of FALSE is recommended

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

ratio

Experimental:Control randomization ratio (not yet implemented)

weight

weight of weighted log rank test

  • "1"= unweighted,

  • "n"= Gehan-Breslow,

  • "sqrtN"= Tarone-Ware,

  • "FH_p[a]_q[b]"= Fleming-Harrington with p=a and q=b

info_scale

the information scale for calculation

approx

approximate estimation method for Z statistics

  • "event driven" = only work under proportional hazard model with log rank test

  • "asymptotic"

r

Integer, at least 2; default of 18 recommended by Jennison and Turnbull

tol

Tolerance parameter for boundary convergence (on Z-scale)

Specification

The contents of this section are shown in PDF user manual only.

Examples

library(tibble)
library(gsDesign)
library(gsDesign2)

# set enrollment rates
enrollRates <- tibble(Stratum = "All", duration = 12, rate = 500/12)

# set failure rates
failRates <- tibble(
  Stratum = "All",
  duration = c(4, 100),
  failRate = log(2) / 15,  # median survival 15 month
  hr = c(1, .6),
  dropoutRate = 0.001)
  
# set the targeted number of events and analysis time
target_events <- c(30, 40, 50)
target_analysisTime <- c(10, 24, 30)

# -------------------------#
#       example 1          #
# ------------------------ #
# fixed bounds and calculate the power for targeted number of events
gs_power_wlr(
  enrollRates = enrollRates,
  failRates = failRates,
  events = target_events,
  analysisTimes = NULL,
  upper = gs_b,
  upar = gsDesign(k = length(target_events), test.type = 1, n.I = target_events, maxn.IPlan = max(target_events), sfu = sfLDOF, sfupar = NULL)$upper$bound,
  lower = gs_b,
  lpar = c(qnorm(.1), rep(-Inf, 2)))
  
# -------------------------#
#       example 2          #
# ------------------------ #
# fixed bounds and calculate the power for targeted analysis time
gs_power_wlr(
  enrollRates = enrollRates,
  failRates = failRates,
  events = NULL,
  analysisTimes = target_analysisTime,
  upper = gs_b,
  upar = gsDesign(k = length(target_events), test.type = 1, n.I = target_events, maxn.IPlan = max(target_events), sfu = sfLDOF, sfupar = NULL)$upper$bound,
  lower = gs_b,
  lpar = c(qnorm(.1), rep(-Inf, 2)))

# -------------------------#
#       example 3          #
# ------------------------ #
# fixed bounds and calculate the power for targeted analysis time & number of events
gs_power_wlr(
  enrollRates = enrollRates,
  failRates = failRates,
  events = target_events,
  analysisTimes = target_analysisTime,
  upper = gs_b,
  upar = gsDesign(k = length(target_events), test.type = 1, n.I = target_events, maxn.IPlan = max(target_events), sfu = sfLDOF, sfupar = NULL)$upper$bound,
  lower = gs_b,
  lpar = c(qnorm(.1), rep(-Inf, 2)))
  
# -------------------------#
#       example 4          #
# ------------------------ #
# spending bounds and calculate the power for targeted number of events
gs_power_wlr(
  enrollRates = enrollRates,
  failRates = failRates,
  events = target_events,
  analysisTimes = NULL,
  upper = gs_spending_bound,
  upar = list(sf = gsDesign::sfLDOF, total_spend = 0.025),
  lower = gs_spending_bound,
  lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.2))
  
# -------------------------#
#       example 5          #
# ------------------------ #
# spending bounds and calculate the power for targeted analysis time
gs_power_wlr(
  enrollRates = enrollRates,
  failRates = failRates,
  events = NULL,
  analysisTimes = target_analysisTime,
  upper = gs_spending_bound,
  upar = list(sf = gsDesign::sfLDOF, total_spend = 0.025),
  lower = gs_spending_bound,
  lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.2))
  
# -------------------------#
#       example 6          #
# ------------------------ #
# spending bounds and calculate the power for targeted analysis time & number of events
gs_power_wlr(
  enrollRates = enrollRates,
  failRates = failRates,
  events = target_events,
  analysisTimes = target_analysisTime,
  upper = gs_spending_bound,
  upar = list(sf = gsDesign::sfLDOF, total_spend = 0.025),
  lower = gs_spending_bound,
  lpar = list(sf = gsDesign::sfLDOF, total_spend = 0.2))
  

keaven/gsDesign2 documentation built on Oct. 13, 2022, 8:42 p.m.