Skip to contents

This repo is no longer under maintain, please re-direct to its latest version at https://github.com/Merck/gsDesign2.

Objective

The goal of gsDesign2 is to enable fixed or group sequential design under non-proportional hazards. Piecewise constant enrollment, failure rates and dropout rates for a stratified population are available to enable highly flexible enrollment, time-to-event and time-to-dropout assumptions. Substantial flexibility on top of what is in the gsDesign package is intended for selecting boundaries. While this work is in progress, substantial capabilities have been enabled. Comments on usability and features are encouraged as this is a development version of the package.

The goal of gsDesign2 is to enable group sequential trial design for time-to-event endpoints under non-proportional hazards assumptions. The package is still maturing; as the package functions become more stable, they will likely be included in the gsDesign2 package.

Installation

You can install gsDesign2 with:

remotes::install_github("LittleBeannie/gsDesign2")

Use cases

Step 1: specifying enrollment and failure rates

This is a basic example which shows you how to solve a common problem. We assume there is a 4 month delay in treatment effect. Specifically, we assume a hazard ratio of 1 for 4 months and 0.6 thereafter. For this example we assume an exponential failure rate and low exponential dropout rate. The enrollRates specification indicates an expected enrollment duration of 12 months with exponential inter-arrival times.

library(gsDesign)
library(gsDesign2)
library(dplyr)
library(gt)

# Basic example

# Constant enrollment over 12 months
# Rate will be adjusted later by gsDesignNPH to get sample size
enrollRates <- tibble::tibble(Stratum = "All", duration = 12, rate = 1)

# 12 month median exponential failure rate in control
# 4 month delay in effect with HR=0.6 after
# Low exponential dropout rate
medianSurv <- 12
failRates <- tibble::tibble(
  Stratum = "All",
  duration = c(4, Inf),
  failRate = log(2) / medianSurv,
  hr = c(1, .6),
  dropoutRate = .001
)

The resulting failure rate specification is the following table. As many rows and strata as needed can be specified to approximate whatever patterns you wish.

failRates %>%
  gt() %>%
  as_raw_html(inline_css = FALSE)
Stratum duration failRate hr dropoutRate
All 4 0.05776227 1.0 0.001
All Inf 0.05776227 0.6 0.001

Step 2: compute the design

Computing a fixed sample size design with 2.5% one-sided Type I error and 90% power. We specify a trial duration of 36 months with analysisTimes. Since there is a single analysis, we specify an upper p-value bound of 0.025 with upar = qnorm(0.975). There is no lower bound which is specified with lpar = -Inf.

x <- gs_design_ahr(
  enrollRates, failRates,
  upper = gs_b, upar = qnorm(.975),
  lower = gs_b, lpar = -Inf,
  IF = 1, analysisTimes = 36
)

The input enrollment rates are scaled to achieve power:

x$enrollRates %>%
  gt() %>%
  as_raw_html(inline_css = FALSE)
Stratum duration rate
All 12 35.05288

The failure and dropout rates remain unchanged from what was input:

x$failRates %>%
  gt() %>%
  as_raw_html(inline_css = FALSE)
Stratum duration failRate hr dropoutRate
All 4 0.05776227 1.0 0.001
All Inf 0.05776227 0.6 0.001

Additionally, the summary of bounds and crossing probability is available at

x$bounds %>%
  gt() %>%
  as_raw_html(inline_css = FALSE)
Analysis Bound Probability Probability0 Z ~HR at bound Nominal p
1 Upper 0.9 0.025 1.959964 0.800693 0.025

Finally, the expected analysis time is in Time, sample size N, events required Events and average hazard ratio AHR are in x$analysis. Note that AHR is the average hazard ratio used to calculate the targeted event counts. The natural parameter (log(AHR)) is in theta and corresponding statistical information under the alternate hypothesis are in info and under the null hypothesis in info0.

x$analysis %>%
  gt() %>%
  as_raw_html(inline_css = FALSE)
Analysis Time N Events AHR theta info info0 IF
1 36 420.6346 311.0028 0.6917244 0.3685676 76.74383 77.75069 1

Step 3: summarize the design

x %>%
  summary() %>%
  as_gt() %>%
  as_raw_html(inline_css = FALSE)
Bound summary for AHR design
AHR approximations of ~HR at bound
Bound Nominal p1 ~HR at bound2 Cumulative boundary crossing probability
Alternate hypothesis Null hypothesis
Analysis: 1 Time: 36 N: 420.6 Events: 311 AHR: 0.69 IF: 1
Efficacy 0.025 0.8007 0.9 0.025
1 One-sided p-value for experimental vs control treatment. Values < 0.5 favor experimental, > 0.5 favor control.
2 Approximate hazard ratio to cross bound.