rpact: Confirmatory Adaptive Clinical Trial Design and Analysis

Summary

This R Markdown document describes how to simulate design characterics for survival design under complex settings (incl.  non-proportional hazards) in rpact.

1 Introduction

rpact provides the function getSimulationSurvival() for simulation of group-sequential trials with a time-to-event endpoint. For a given scenario, getSimulationSurvival() simulates many hypothetical group-sequential trials and calculates the test results. Based on this Monte Carlo simulation, estimates of key quantities such as overall study power, stopping probabilities at each interim analysis, timing of analyses etc. can be obtained.

getSimulationSurvival() complements the analytical calculations from the function getSampleSizeSurvival() in multiple ways:

  • Simulations can be used to assess the accuracy of the analytical formulas.
  • Simulations allow to answer questions such as the following:
    • How variable is the timing of interim analysis (even if all assumptions are correct)?
    • How could a dataset of a trial that is stopped early for efficacy at an interim analysis look like?
  • Simulation is also possible for scenarios that are analytically intractable such as scenarios with delayed treatment effects.

The syntax of function getSimulationSurvival() is very similar to the function getSampleSizeSurvival(). Hence, this document only provides some examples and expects that the reader is familiar with the R Markdown document Designing group-sequential trials with two groups and a survival endpoint with rpact which describes standard designs of a trial with a survival endpoint.

getSimulationSurvival() also supports the usage of adaptive sample size recalculation but this is not covered here. For more details, please also consult the help ?getSimulationSurvival.

First, load the rpact package

library(rpact)
packageVersion("rpact") # version should be version 2.0.5 or later
## [1] '2.0.5'

For this R Markdown document, some additional R packages are loaded which will be used to examine simulated datasets.

# Load ggplot2 for plotting
library(ggplot2)   # general plotting 
library(survminer) # plotting of KM curves with ggplot2
## Loading required package: ggpubr
## Loading required package: magrittr
## 
## Attaching package: 'magrittr'
## The following objects are masked from 'package:testthat':
## 
##     equals, is_less_than, not
library(survival)  # survival analysis routines

2 Standard analytical calculation

For comparison with the simulation-based analysis, a standard example is first calculated under the following assumptions:

  • Group-sequential design with one interim analysis after 66% of information using an O’Brien&Fleming type \(\alpha\)-spending function, one-sided Type I error 2.5%, power 80%:
design <- getDesignGroupSequential(informationRates = c(0.66,1),
   typeOfDesign = "asOF", sided=1, alpha=0.025, beta=0.2)
  • Exponential PFS with a median PFS of 60 months in control (lambda2=log(2)/60) and a target hazard ratio of 0.74 (hazardRatio=0.74).
  • Annual drop-out of 2.5% in both arms (dropoutRate1 = 0.025, dropoutRate2 = 0.025, dropoutTime = 12).
  • Recruitment is 42 patients/month from month 6 onwards after linear ramp up. (accrualTime = c(0,1,2,3,4,5,6), accrualIntensity=c(6,12,18,24,30,36,42))
  • Randomization ratio 1:1 (allocation1=1 and allocation2=1; this is how subjects are randomized in treatment groups 1 and 2 in a subsequent way). 1:1 allocation is the default and is thus not explicitly set in the function call below.
  • A fixed total sample size of 1200 (maxNumberOfSubjects = 1200).

As described in the R Markdown document which describes standard designs of a trial with a survival endpoint, sample size calculations for this design can be performed as per the code below:

sampleSizeResult <- getSampleSizeSurvival(design,
    lambda2=log(2)/60,hazardRatio=0.74,
    dropoutRate1 = 0.025, dropoutRate2 = 0.025, dropoutTime = 12,
    accrualTime = c(0,1,2,3,4,5,6), 
    accrualIntensity=c(6,12,18,24,30,36,42),
    maxNumberOfSubjects = 1200)
# Standard rpact display of results
sampleSizeResult
## Design plan parameters and output for survival data:
## 
## Design parameters:
##   Significance level                           : 0.0250 
##   Type II error rate                           : 0.2 
##   Test                                         : one-sided 
## 
## User defined parameters:
##   lambda (2)                                   : 0.0116 
##   Hazard ratio                                 : 0.740 
##   Maximum number of subjects                   : 1200.0 
##   Accrual intensity                            : 6.0, 12.0, 18.0, 24.0, 30.0, 36.0, 42.0 
##   Drop-out rate (1)                            : 0.025 
##   Drop-out rate (2)                            : 0.025 
## 
## Default parameters:
##   Type of computation                          : Schoenfeld 
##   Theta H0                                     : 1 
##   Planned allocation ratio                     : 1 
##   Event time                                   : 12 
##   kappa                                        : 1 
##   Piecewise survival times                     : 0.00 
##   Drop-out time                                : 12.00 
## 
## Sample size and output:
##   Direction upper                              : FALSE 
##   pi (1)                                       : 0.0975 
##   pi (2)                                       : 0.129 
##   median (1)                                   : 81.1 
##   median (2)                                   : 60.0 
##   lambda (1)                                   : 0.00855 
##   Maximum number of subjects (1)               : 600.0 
##   Maximum number of subjects (2)               : 600.0 
##   Maximum number of events                     : 350.5 
##   Accrual time                                 : 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 31.57 
##   Total accrual time                           : 31.57 
##   Follow up time                               : 22.08 
##   Calculate follow up time                     : TRUE 
##   Information rates [1]                        : 0.660 
##   Information rates [2]                        : 1.000 
##   Analysis times [1]                           : 39.54 
##   Analysis times [2]                           : 53.65 
##   Expected study duration under H1             : 47.91 
##   Maximal study duration                       : 53.65 
##   Number of events by stage [1]                : 231.3 
##   Number of events by stage [2]                : 350.5 
##   Expected number of events under H0           : 349.8 
##   Expected number of events under H0/H1        : 340.5 
##   Expected number of events under H1           : 302.0 
##   Number of subjects [1]                       : 1200.0 
##   Number of subjects [2]                       : 1200.0 
##   Expected number of subjects under H1         : 1200.0 
##   Reject per stage [1]                         : 0.407 
##   Reject per stage [2]                         : 0.393 
##   Early stop                                   : 0.407 
##   Critical values (effect scale) [1]           : 0.718 
##   Critical values (effect scale) [2]           : 0.808 
##   Local one-sided significance levels [1]      : 0.005798 
##   Local one-sided significance levels [2]      : 0.023210 
## 
## Legend:
##   (i): values of treatment arm i
##   [k]: values at stage k
# Summary of results
summary(sampleSizeResult)
## Sample size calculation for a survival endpoint
## 
## Sequential analysis with a maximum of 2 looks (group sequential design).
## The sample size was calculated for a two-sample logrank test (one-sided),
## hazard ratio 0.74, control lambda (2) = 0.012, allocation ratio = 1, and power 80%.
## 
## Stage                                          1       2  
## Information rate                             66%    100%  
## Efficacy boundary (z-value scale)          2.524   1.992  
## Number of subjects                          1200    1200  
## Cumulative number of events                231.3   350.5  
## Analysis time                               39.5    53.7  
## Cumulative alpha spent                    0.0058  0.0250  
## Cumulative power                          0.4074  0.8000  
## One-sided local significance level        0.0058  0.0232  
## Efficacy boundary (t)                      0.718   0.808  
## Exit probability for efficacy (under H0)  0.0058  
## Exit probability for efficacy (under H1)  0.4074  
## 
## Legend:
##   (t): approximate treatment effect scale

By design, the power of the trial is 80%. The interim analysis is after 232 events which is expected to occur after 39.54 months, and the final analysis is after 351 events which is expected to occur after 53.65 months. These numbers will now be compared to simulations.

3 Simulation under proportional hazards

The call getSimulationSurvival() uses the same arguments as getSampleSizeSurvival() with the following changes:

  • The maximum number of patients (maxNumberOfSubjects = 1200) is always provided to allow the simulation.
  • The number of events at each analysis is specified as per the analytical calculation above (plannedEvents=c(232,351)).
  • For one-sided tests, the direction of the alternative is specified. Here, the alternative is towards hazard ratios <1 which is specified as directionUpper = FALSE.
  • The number of simulated trials is specified (maxNumberOfIterations = 10000 in the example below).
  • By default, raw datasets from simulation runs are not extracted. However, in this example, it is specifies that one raw dataset that led to stopping after each stage, respectively, will be stored: maxNumberOfRawDatasetsPerStage=1.
  • For reproducibility, it is useful to set the random seed which is set to seed=2 in the example.
  • For simulation of trials with unequal randomization, integer arguments allocation1 and allocation2 must be provided to the function getSimulationSurvival (instead of argument allocationRatioPlanned in the function getSampleSizeSurvival). allocation1 and allocation2 specify the number of consecutively enrolled subjects in the intervention and control groups, respectively, before another subject from the opposite group is recruited. For example, allocation1 = 2, allocation1=1 refers to 2 (intervention) : 1 (control) randomization and allocation1 = 1, allocation1 = 2 to 1 (intervention) : 2 (control) randomization.
simulationResult <- getSimulationSurvival(design,
    lambda2=log(2)/60,hazardRatio=0.74,
    dropoutRate1 = 0.025, dropoutRate2 = 0.025, 
    dropoutTime = 12,
    accrualTime = c(0,1,2,3,4,5,6), 
    accrualIntensity=c(6,12,18,24,30,36,42),
    plannedEvents=c(232,351),
    directionUpper = FALSE,
    maxNumberOfSubjects = 1200,
    maxNumberOfIterations = 10000,
    maxNumberOfRawDatasetsPerStage = 1,
    seed = 12345)

# print the simulation result
simulationResult
## Simulation of survival data (group sequential design):
## 
## User defined parameters:
##   Maximum number of subjects                   : 1200.0 
##   Accrual intensity                            : 6.0, 12.0, 18.0, 24.0, 30.0, 36.0, 42.0 
##   Planned events                               : 232, 351 
##   Direction upper                              : FALSE 
##   Drop-out rate (1)                            : 0.025 
##   Drop-out rate (2)                            : 0.025 
##   Maximum number of iterations                 : 10000 
##   lambda (2)                                   : 0.0116 
##   Hazard ratio                                 : 0.740 
##   Seed                                         : 12345 
## 
## Default parameters:
##   Planned allocation ratio                     : 1 
##   Drop-out time                                : 12.00 
##   Event time                                   : 12 
##   Theta H0                                     : 1 
##   Allocation 1                                 : 1 
##   Allocation 2                                 : 1 
##   Conditional power                            : NA 
##   kappa                                        : 1 
## 
## Results:
##   Accrual time                                 : 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 31.57 
##   pi (1)                                       : 0.0975 
##   pi (2)                                       : 0.129 
##   median (1)                                   : 81.1 
##   median (2)                                   : 60.0 
##   lambda (1)                                   : 0.00855 
##   Iterations [1]                               : 10000 
##   Iterations [2]                               : 5983 
##   Analysis times [1]                           : 39.61 
##   Analysis times [2]                           : 53.69 
##   Expected study duration                      : 48.04 
##   Number of events by stage [1]                : 232.0 
##   Number of events by stage [2]                : 351.0 
##   Expected number of events                    : 303.2 
##   Events not achieved [1]                      : 0 
##   Events not achieved [2]                      : 0 
##   Number of subjects [1]                       : 1200.0 
##   Number of subjects [2]                       : 1200.0 
##   Expected number of subjects                  : 1200.0 
##   Reject per stage [1]                         : 0.402 
##   Reject per stage [2]                         : 0.393 
##   Overall reject                               : 0.795 
##   Futility stop per stage                      : 0 
##   Futility stop                                : 0 
##   Early stop                                   : 0.402 
##   Cond. power (achieved) [1]                   : NA 
##   Cond. power (achieved) [2]                   : 0.5402 
## 
## Simulated data:
##   Analysis times [1]                           : median [range]: 39.577 [34.874 - 45.294]; mean +/-sd: 39.61 +/-1.447 
##   Analysis times [2]                           : median [range]: 53.665 [46.815 - 60.99]; mean +/-sd: 53.692 +/-2.019 
##   Number of subjects [1]                       : median [range]: 1200 [1200 - 1200]; mean +/-sd: 1200 +/-0 
##   Number of subjects [2]                       : median [range]: 1200 [1200 - 1200]; mean +/-sd: 1200 +/-0 
##   Observed # events by stage (1) [1]           : median [range]: 101 [76 - 123]; mean +/-sd: 100.826 +/-6.654 
##   Observed # events by stage (1) [2]           : median [range]: 158 [136 - 180]; mean +/-sd: 157.666 +/-6.302 
##   Observed # events by stage (2) [1]           : median [range]: 131 [109 - 156]; mean +/-sd: 131.174 +/-6.654 
##   Observed # events by stage (2) [2]           : median [range]: 193 [171 - 215]; mean +/-sd: 193.334 +/-6.302 
##   Number of events by stage [1]                : median [range]: 232 [232 - 232]; mean +/-sd: 232 +/-0 
##   Number of events by stage [2]                : median [range]: 351 [351 - 351]; mean +/-sd: 351 +/-0 
##   Test statistic [1]                           : median [range]: 2.269 [-1.163 - 5.855]; mean +/-sd: 2.269 +/-0.987 
##   Test statistic [2]                           : median [range]: 2.3 [-0.579 - 4.746]; mean +/-sd: 2.277 +/-0.773 
##   Log-rank statistic [1]                       : median [range]: 2.269 [-1.163 - 5.855]; mean +/-sd: 2.269 +/-0.987 
##   Log-rank statistic [2]                       : median [range]: 2.3 [-0.579 - 4.746]; mean +/-sd: 2.277 +/-0.773 
##   Hazard ratio estimate LR [1]                 : median [range]: 0.742 [0.464 - 1.165]; mean +/-sd: 0.749 +/-0.097 
##   Hazard ratio estimate LR [2]                 : median [range]: 0.782 [0.603 - 1.064]; mean +/-sd: 0.787 +/-0.066 
##   Cond. power (achieved) [2]                   : median [range]: 0.614 [0 - 0.972]; mean +/-sd: 0.54 +/-0.339 
## 
## Legend:
##   (i): values of treatment arm i
##   [k]: values at stage k
# Summary of simulation results
summary(simulationResult)
## Simulation of a survival endpoint
## 
## Sequential analysis with a maximum of 2 looks (group sequential design).
## The results were simulated for a two-sample logrank test (one-sided),
## hazard ratio 0.74, control lambda (2) = 0.012, allocation ratio = 1.
## 
## Stage                                   1       2  
## Information rate                      66%    100%  
## Efficacy boundary (z-value scale)   2.524   1.992  
## Number of subjects                   1200    1200  
## Cumulative number of events         232.0   351.0  
## Analysis time                        39.6    53.7  
## Simulated cumulative power         0.4017  0.7949

According to the output, the simulated overall power is 79.5% and the probability to cross the efficacy boundary at the interim analysis is 40.2%. These are both within 1% of the analytical power.

The mean simulated analysis times are after 39.61 months for the interim analysis and after 53.69 for the final analysis. Both timings differ by <0.1 months from the analytical calculation (Difference analysis times = 0.07, 0.04).

The summary of the simulations above also provide median [range] and mean+/-sd of the trial results across the simulated datasets. Summary results for each trial can be obtained from the simulation object using the function getData(). Similarly, raw data from individual trials that were stopped at each stage can be obtained using function getRawData() (if maxNumberOfRawDatasetsPerStage was set > 0). The format of these datasets is described in the help ?getSimulationSurvival and illustrated below.

3.1 Accessing trial summaries per stage for each simulation

# get aggregate datasets from all simulation runs
aggregateSimulationData <- getData(simulationResult)
# show the first 6 records of the dataset
head(aggregateSimulationData)
##   iterationNumber stageNumber        pi1       pi2 hazardRatio
## 1               1           1 0.09749927 0.1294494        0.74
## 2               2           1 0.09749927 0.1294494        0.74
## 3               2           2 0.09749927 0.1294494        0.74
## 4               3           1 0.09749927 0.1294494        0.74
## 5               3           2 0.09749927 0.1294494        0.74
## 6               4           1 0.09749927 0.1294494        0.74
##   analysisTime numberOfSubjects eventsPerStage1 eventsPerStage2
## 1     40.64430             1200              99             133
## 2     39.98191             1200             104             128
## 3     52.27530             1200             160             191
## 4     41.02950             1200             100             132
## 5     55.05094             1200             154             197
## 6     40.19759             1200             107             125
##   eventsPerStage rejectPerStage eventsNotAchieved futilityPerStage
## 1            232              1                 0                0
## 2            232              0                 0                0
## 3            351              1                 0                0
## 4            232              0                 0                0
## 5            351              1                 0                0
## 6            232              0                 0                0
##   testStatistic logRankStatistic conditionalPowerAchieved trialStop
## 1      2.580807         2.580807                       NA      TRUE
## 2      1.873088         1.873088                       NA     FALSE
## 3      2.148403         2.148403                0.7039150      TRUE
## 4      2.253289         2.253289                       NA     FALSE
## 5      2.644996         2.644996                0.9095044      TRUE
## 6      1.416149         1.416149                       NA     FALSE
##   hazardRatioEstimateLR
## 1             0.7125704
## 2             0.7819625
## 3             0.7950530
## 4             0.7438831
## 5             0.7540030
## 6             0.8303156
# The aggregated dataset contains one record for each of the 10'000 simulated 
# interim datasets (stageNumber=1), and one additional record for the final 
# analysis (stageNumber=2) for all simulated trials which were not stopped at 
# the interim analysis 
table(aggregateSimulationData$stageNumber)
## 
##     1     2 
## 10000  5983
# One possible analysis which uses the aggregate dataset:
# display the distribution of the timing of the analyses (by stage) 
# across simulation runs
p <- ggplot(aggregateSimulationData, aes(factor(stageNumber),analysisTime))
p + geom_boxplot() + labs(x = "Analysis stage",
  y = "Timing of analysis (months \nfrom first patient randomized)")

3.2 Accessing trial summaries per stage for each simulation

# get all stored raw datasets 
rawSimulationDataData <- getRawData(simulationResult)
# chose one dataset which corresponds to a simulated (hypothetical) trial 
# which was stopped at the efficacy interim analysis 
# (only 1 such dataset exists here, because maxNumberOfRawDatasetsPerStage 
# was set to 1 above)
stage1rawData <- subset(rawSimulationDataData,stopStage==1)

# Perform a Cox regression analysis of the simulated trial 
# (treatmentGroup==1 is the intervention arm)
# Note that the $p$-value from the Cox regression is two-sided whereas
# the group-sequential is one-sided. 

summary(coxph(Surv(timeUnderObservation,event)~I(treatmentGroup==1),data=stage1rawData))
## Call:
## coxph(formula = Surv(timeUnderObservation, event) ~ I(treatmentGroup == 
##     1), data = stage1rawData)
## 
##   n= 1200, number of events= 232 
## 
##                               coef exp(coef) se(coef)      z Pr(>|z|)  
## I(treatmentGroup == 1)TRUE -0.3410    0.7111   0.1328 -2.568   0.0102 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                            exp(coef) exp(-coef) lower .95 upper .95
## I(treatmentGroup == 1)TRUE    0.7111      1.406    0.5482    0.9224
## 
## Concordance= 0.546  (se = 0.017 )
## Likelihood ratio test= 6.68  on 1 df,   p=0.01
## Wald test            = 6.6  on 1 df,   p=0.01
## Score (logrank) test = 6.66  on 1 df,   p=0.01
# Show Kaplan-Meier curves of the simulated trial
ggsurvplot(survfit(Surv(timeUnderObservation, event) ~ treatmentGroup, 
    data = stage1rawData), risk.table = TRUE, break.time.by = 12, 
    censor.size = 1, risk.table.fontsize = 4, risk.table.pos = "in",
    title = paste0("Kaplan-Meier curve of one simulated trial\n which ", 
        "was stopped at the interim analysis"),
    xlab = "Time (months)", data = stage1rawData)

4 Simulation under non-proportional hazards

For the sake of illustration, assume that the treatment effect in the example above is delayed by 6 months, i.e., that the active treatment does not affect the hazard in the first 6 months but still reduces it by 0.74-fold from month 6 onwards. The code below determines the power of the design in this situation via simulation.

The code to specify a delayed treatment effect is similar to the simulation under proportional hazards except that now the survival function in each arm is specified via a piecewise constant exponential distribution: piecewiseSurvivalTime=c(0,6), lambda2=c(log(2)/60,log(2)/60), lambda1=c(log(2)/60,0.74*log(2)/60) (as always for rpact, “2” refers to the control arm which still has a constant hazard rate, i.e., an exponential distribution).

# Simulation assuming a delayed treatment effect
simulationResultNPH <- getSimulationSurvival(design,
    piecewiseSurvivalTime=c(0,6),
    lambda2=c(log(2)/60,log(2)/60),
    lambda1=c(log(2)/60,0.74*log(2)/60),
    dropoutRate1 = 0.025, dropoutRate2 = 0.025, dropoutTime = 12,
    accrualTime = c(0,1,2,3,4,5,6), 
    accrualIntensity=c(6,12,18,24,30,36,42),
    plannedEvents=c(232,351),
    directionUpper = FALSE,
    maxNumberOfSubjects = 1200,
    maxNumberOfIterations = 10000,
    maxNumberOfRawDatasetsPerStage = 1,
    seed = 23456)
simulationResultNPH
## Simulation of survival data (group sequential design):
## 
## User defined parameters:
##   Maximum number of subjects                   : 1200.0 
##   Accrual intensity                            : 6.0, 12.0, 18.0, 24.0, 30.0, 36.0, 42.0 
##   Planned events                               : 232, 351 
##   Direction upper                              : FALSE 
##   Drop-out rate (1)                            : 0.025 
##   Drop-out rate (2)                            : 0.025 
##   Maximum number of iterations                 : 10000 
##   Piecewise survival times                     : 0.00, 6.00 
##   lambda (1)                                   : 0.01155, 0.00855 
##   lambda (2)                                   : 0.0116, 0.0116 
##   Hazard ratio                                 : 1.000, 0.740 
##   Seed                                         : 23456 
## 
## Default parameters:
##   Planned allocation ratio                     : 1 
##   Drop-out time                                : 12.00 
##   Event time                                   : 12 
##   Theta H0                                     : 1 
##   Allocation 1                                 : 1 
##   Allocation 2                                 : 1 
##   Conditional power                            : NA 
##   kappa                                        : 1 
## 
## Results:
##   Accrual time                                 : 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 31.57 
##   Iterations [1]                               : 10000 
##   Iterations [2]                               : 8470 
##   Analysis times [1]                           : 38.62 
##   Analysis times [2]                           : 52.64 
##   Expected study duration                      : 50.51 
##   Number of events by stage [1]                : 232.0 
##   Number of events by stage [2]                : 351.0 
##   Expected number of events                    : 332.8 
##   Events not achieved [1]                      : 0 
##   Events not achieved [2]                      : 0 
##   Number of subjects [1]                       : 1200.0 
##   Number of subjects [2]                       : 1200.0 
##   Expected number of subjects                  : 1200.0 
##   Reject per stage [1]                         : 0.153 
##   Reject per stage [2]                         : 0.426 
##   Overall reject                               : 0.579 
##   Futility stop per stage                      : 0 
##   Futility stop                                : 0 
##   Early stop                                   : 0.153 
##   Cond. power (achieved) [1]                   : NA 
##   Cond. power (achieved) [2]                   : 0.3555 
## 
## Simulated data:
##   Analysis times [1]                           : median [range]: 38.562 [33.964 - 45.662]; mean +/-sd: 38.624 +/-1.454 
##   Analysis times [2]                           : median [range]: 52.551 [45.331 - 60.899]; mean +/-sd: 52.639 +/-2.008 
##   Number of subjects [1]                       : median [range]: 1200 [1200 - 1200]; mean +/-sd: 1200 +/-0 
##   Number of subjects [2]                       : median [range]: 1200 [1200 - 1200]; mean +/-sd: 1200 +/-0 
##   Observed # events by stage (1) [1]           : median [range]: 106 [84 - 133]; mean +/-sd: 105.756 +/-6.719 
##   Observed # events by stage (1) [2]           : median [range]: 159 [136 - 187]; mean +/-sd: 159.82 +/-6.888 
##   Observed # events by stage (2) [1]           : median [range]: 126 [99 - 148]; mean +/-sd: 126.244 +/-6.719 
##   Observed # events by stage (2) [2]           : median [range]: 192 [164 - 215]; mean +/-sd: 191.18 +/-6.888 
##   Number of events by stage [1]                : median [range]: 232 [232 - 233]; mean +/-sd: 232 +/-0.01 
##   Number of events by stage [2]                : median [range]: 351 [350 - 351]; mean +/-sd: 351 +/-0.011 
##   Test statistic [1]                           : median [range]: 1.478 [-2.644 - 4.827]; mean +/-sd: 1.493 +/-0.997 
##   Test statistic [2]                           : median [range]: 1.998 [-1.659 - 4.796]; mean +/-sd: 1.944 +/-0.863 
##   Log-rank statistic [1]                       : median [range]: 1.478 [-2.644 - 4.827]; mean +/-sd: 1.493 +/-0.997 
##   Log-rank statistic [2]                       : median [range]: 1.998 [-1.659 - 4.796]; mean +/-sd: 1.944 +/-0.863 
##   Hazard ratio estimate LR [1]                 : median [range]: 0.824 [0.531 - 1.415]; mean +/-sd: 0.829 +/-0.109 
##   Hazard ratio estimate LR [2]                 : median [range]: 0.808 [0.599 - 1.194]; mean +/-sd: 0.816 +/-0.076 
##   Cond. power (achieved) [2]                   : median [range]: 0.245 [0 - 0.972]; mean +/-sd: 0.355 +/-0.339 
## 
## Legend:
##   (i): values of treatment arm i
##   [k]: values at stage k

As can be seen from the output above, power drops substantially to 57.9%.

If one wants the trial to maintain a power of 80% despite the delayed treatment effect, the maximal number of events would need to be increased and some experimentation shows that one would need 498 events in this case as demonstrated in the simulation below. Note further that in this non-proportional hazards scenario, power does not only depend on the number of events but also on other assumptions, in particular on assumptions regarding the speed of recruitment.

# Simulation assuming a delayed treatment effect
plannedEventsMax <- 498

simulationResultNPH2 <- getSimulationSurvival(design,
    piecewiseSurvivalTime=c(0,6),
    lambda2=c(log(2)/60,log(2)/60),
    lambda1=c(log(2)/60,0.74*log(2)/60),
    dropoutRate1 = 0.025, dropoutRate2 = 0.025, dropoutTime = 12,
    accrualTime = c(0,1,2,3,4,5,6), 
    accrualIntensity=c(6,12,18,24,30,36,42),
    plannedEvents=c(ceiling(0.66*plannedEventsMax),plannedEventsMax),
    directionUpper = FALSE,
    maxNumberOfSubjects = 1200,
    maxNumberOfIterations = 10000,
    maxNumberOfRawDatasetsPerStage = 1,
    seed = 34567)
simulationResultNPH2
## Simulation of survival data (group sequential design):
## 
## User defined parameters:
##   Maximum number of subjects                   : 1200.0 
##   Accrual intensity                            : 6.0, 12.0, 18.0, 24.0, 30.0, 36.0, 42.0 
##   Planned events                               : 329, 498 
##   Direction upper                              : FALSE 
##   Drop-out rate (1)                            : 0.025 
##   Drop-out rate (2)                            : 0.025 
##   Maximum number of iterations                 : 10000 
##   Piecewise survival times                     : 0.00, 6.00 
##   lambda (1)                                   : 0.01155, 0.00855 
##   lambda (2)                                   : 0.0116, 0.0116 
##   Hazard ratio                                 : 1.000, 0.740 
##   Seed                                         : 34567 
## 
## Default parameters:
##   Planned allocation ratio                     : 1 
##   Drop-out time                                : 12.00 
##   Event time                                   : 12 
##   Theta H0                                     : 1 
##   Allocation 1                                 : 1 
##   Allocation 2                                 : 1 
##   Conditional power                            : NA 
##   kappa                                        : 1 
## 
## Results:
##   Accrual time                                 : 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 31.57 
##   Iterations [1]                               : 10000 
##   Iterations [2]                               : 6788 
##   Analysis times [1]                           : 49.93 
##   Analysis times [2]                           : 74.12 
##   Expected study duration                      : 66.39 
##   Number of events by stage [1]                : 329.0 
##   Number of events by stage [2]                : 498.0 
##   Expected number of events                    : 443.7 
##   Events not achieved [1]                      : 0 
##   Events not achieved [2]                      : 0 
##   Number of subjects [1]                       : 1200.0 
##   Number of subjects [2]                       : 1200.0 
##   Expected number of subjects                  : 1200.0 
##   Reject per stage [1]                         : 0.321 
##   Reject per stage [2]                         : 0.472 
##   Overall reject                               : 0.793 
##   Futility stop per stage                      : 0 
##   Futility stop                                : 0 
##   Early stop                                   : 0.321 
##   Cond. power (achieved) [1]                   : NA 
##   Cond. power (achieved) [2]                   : 0.4867 
## 
## Simulated data:
##   Analysis times [1]                           : median [range]: 49.882 [43.163 - 57.345]; mean +/-sd: 49.925 +/-1.902 
##   Analysis times [2]                           : median [range]: 74.065 [65.228 - 84.961]; mean +/-sd: 74.124 +/-2.81 
##   Number of subjects [1]                       : median [range]: 1200 [1200 - 1200]; mean +/-sd: 1200 +/-0 
##   Number of subjects [2]                       : median [range]: 1200 [1200 - 1200]; mean +/-sd: 1200 +/-0 
##   Observed # events by stage (1) [1]           : median [range]: 148 [122 - 181]; mean +/-sd: 148.463 +/-7.715 
##   Observed # events by stage (1) [2]           : median [range]: 228 [203 - 261]; mean +/-sd: 228.14 +/-7.337 
##   Observed # events by stage (2) [1]           : median [range]: 181 [148 - 207]; mean +/-sd: 180.537 +/-7.715 
##   Observed # events by stage (2) [2]           : median [range]: 270 [237 - 295]; mean +/-sd: 269.86 +/-7.337 
##   Number of events by stage [1]                : median [range]: 329 [329 - 330]; mean +/-sd: 329 +/-0.01 
##   Number of events by stage [2]                : median [range]: 498 [498 - 498]; mean +/-sd: 498 +/-0 
##   Test statistic [1]                           : median [range]: 2.043 [-2.049 - 5.666]; mean +/-sd: 2.05 +/-1.008 
##   Test statistic [2]                           : median [range]: 2.413 [-1.414 - 5.043]; mean +/-sd: 2.38 +/-0.812 
##   Log-rank statistic [1]                       : median [range]: 2.043 [-2.049 - 5.666]; mean +/-sd: 2.05 +/-1.008 
##   Log-rank statistic [2]                       : median [range]: 2.413 [-1.414 - 5.043]; mean +/-sd: 2.38 +/-0.812 
##   Hazard ratio estimate LR [1]                 : median [range]: 0.798 [0.535 - 1.254]; mean +/-sd: 0.803 +/-0.089 
##   Hazard ratio estimate LR [2]                 : median [range]: 0.806 [0.636 - 1.135]; mean +/-sd: 0.81 +/-0.06 
##   Cond. power (achieved) [2]                   : median [range]: 0.508 [0 - 0.972]; mean +/-sd: 0.487 +/-0.346 
## 
## Legend:
##   (i): values of treatment arm i
##   [k]: values at stage k

System: rpact 2.0.5, R version 3.6.1 (2019-07-05), platform: x86_64-w64-mingw32

To cite R in publications use:

R Core Team (2019). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL https://www.R-project.org/.

To cite package ‘rpact’ in publications use:

Gernot Wassmer and Friedrich Pahlke (2019). rpact: Confirmatory Adaptive Clinical Trial Design and Analysis. R package version 2.0.5. https://CRAN.R-project.org/package=rpact

 

Creative Commons License
This work by Marcel Wolbers, Gernot Wassmer and Friedrich Pahlke is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.