GitHub

R-CMD-check Codecov test coverage CRAN status CRAN Downloads

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. Comments on usability and features are encouraged as this is still a young package.

Installation

Install the released version of gsDesign2 from CRAN:

install.packages("gsDesign2")

Or install the development version from GitHub with:

remotes::install_github("Merck/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 enroll_rate specification indicates an expected enrollment duration of 12 months with exponential inter-arrival times.

library(gsDesign2)
# Basic example
# Constant enrollment over 12 months
# Rate will be adjusted later by gsDesign2 NPH to get sample size
enroll_rate <- define_enroll_rate(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
median_surv <- 12
fail_rate <- define_fail_rate(
  duration = c(4, Inf),
  fail_rate = log(2) / median_surv,
  hr = c(1, .6),
  dropout_rate = .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.

fail_rate |> gt::gt()
stratum duration fail_rate dropout_rate hr
All 4 0.05776227 0.001 1.0
All Inf 0.05776227 0.001 0.6

Step 2: derive a fixed design with no interim analyses

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 analysis_time. Enrollment duration is the sum of enroll_rate$duration. We used fixed_design() since there is a single analysis:

fd <- fixed_design_ahr(
  enroll_rate = enroll_rate,
  fail_rate = fail_rate,
  alpha = 0.025,
  power = 0.9,
  study_duration = 36,
  ratio = 1 # Experimental/control randomization ratio
)

The input enrollment rates have now been scaled to achieve power:

fd$enroll_rate |> gt::gt()
stratum duration rate
All 12 35.05288

The failure and dropout rates remain unchanged from what was input. The summary is obtained below. The columns are:

  • Design: sample size derivation method.
  • N: sample size; generally you will round up to an even number.
  • Event: generally you will round up.
  • Bound: Z value for efficacy; this is the inverse normal from 1 - alpha.
  • alpha: 1-sided alpha level for testing.
  • Power: power corresponding to enrollment, failure rate, and trial targeted events.
fd |>
  summary() |>
  as_gt()
Fixed Design under AHR Method1
Design N Events Time Bound alpha Power
Average hazard ratio 420.6346 311.0028 36 1.959964 0.025 0.9
1 Power computed with average hazard ratio method.

Step 3: group sequential design

We provide a simple example for a group sequential design that demonstrates a couple of features not available in the gsDesign package. The first is specifying analysis times by calendar time rather than information fraction. The second is not having an efficacy and futility bound at each analysis. This is in addition to having methods for non-proportional hazards as demonstrated in the fixed design above and again here.

We use an O’Brien-Fleming spending function to derive our efficacy bounds at 24 and 36 months. For futility, we simply require a nominally significant trend in the wrong direction (

Read the original on github.com ↗