Sample Size Calculation Under Non-Proportional Hazards

Kaifeng Lu

12/15/2021

This R Markdown document illustrates the sample size calculation for a delayed effect model using the lrsamplesize function from lrstat and verifies the result using the simulation tool.

Suppose that the survival distribution of the control group is exponential with a median survival time of 13 months. The survival distribution of the active treatment group is piecewise exponential with the same hazard rate as the control group for the first 6 months and with a hazard ratio of 0.58 afterwards. The accrual has a ramp-up period of 9 months to reach 26 patients per months thereafter, and the total duration of the enrollment is 22 months. In addition, the annual drop rate is 5% for each treatment group.

We would like to know the total number of events needed to achieve 80% power for a two-stage group sequential trial with O’Brien-Fleming spending function and with the interim analysis to be conducted after observing 80% of the target total number of events. First we load the lrstat package:

library(lrstat)

We use the lrsamplesize function to obtain the follow-up time and the target number of events.

lrsamplesize(beta = 0.2, kMax = 2, informationRates = c(0.8, 1),
             alpha = 0.025, typeAlphaSpending = "sfOF", 
             accrualTime = seq(0, 9),
             accrualIntensity = c(26/9*seq(1, 9), 26),
             piecewiseSurvivalTime = c(0, 6),
             lambda2 = rep(log(2)/13, 2),
             lambda1 = c(log(2)/13, 0.58*log(2)/13),
             gamma1 = -log(1-0.05)/12, gamma2 = -log(1-0.05)/12,
             accrualDuration = 22, followupTime = NA)
##                          stage 1 stage 2
## informationRates           0.800   1.000
## efficacyBounds             2.250   2.025
## futilityBounds            -6.000   2.025
## cumulativeRejection        0.450   0.800
## cumulativeFutility         0.000   0.200
## cumulativeAlphaSpent       0.012   0.025
## numberOfEvents           252.184 315.231
## numberOfDropouts          23.137  29.849
## numberOfSubjects         468.000 468.000
## analysisTime              31.391  41.519
## efficacyHR                 0.752   0.795
## futilityHR                 2.139   0.795
## efficacyP                  0.012   0.021
## futilityP                  1.000   0.021
## information               62.807  78.025
## HR                         0.765   0.723
## overallReject              0.800        
## alpha                      0.025        
## numberOfEvents           315.231        
## expectedNumberOfEvents   286.848        
## numberOfDropouts          29.849        
## expectedNumberOfDropouts  26.827        
## numberOfSubjects         468.000        
## expectedNumberOfSubjects 468.000        
## studyDuration             41.519        
## expectedStudyDuration     36.959        
## accrualDuration           22.000        
## followupTime              19.519        
## fixedFollowup              0.000        
## rho1                       0.000        
## rho2                       0.000

Thus we need to observe 315 events with 468 subjects, and the maximum study duration is 41.5 months with an expected study duration of 37 months.

To verify this requirement, we resort to the lrsim function.

lrsim(kMax = 2, criticalValues = c(2.250, 2.025), 
      accrualTime = seq(0, 9),
      accrualIntensity = c(26/9*seq(1, 9), 26),
      piecewiseSurvivalTime = c(0, 6),
      lambda2 = rep(log(2)/13, 2),
      lambda1 = c(log(2)/13, 0.58*log(2)/13),
      gamma1 = -log(1-0.05)/12, gamma2 = -log(1-0.05)/12,
      accrualDuration = 22,
      plannedEvents = c(252, 315), 
      maxNumberOfIterations = 10000, seed = 314159)
##                          stage 1 stage 2
## cumulativeRejection        0.450   0.797
## cumulativeFutility         0.000   0.203
## numberOfEvents           252.000 315.000
## numberOfDropouts          23.049  29.778
## numberOfSubjects         468.000 468.000
## analysisTime              31.338  41.435
## overallReject              0.797        
## expectedNumberOfEvents   286.618        
## expectedNumberOfDropouts  26.701        
## expectedNumberOfSubjects 468.000        
## expectedStudyDuration     36.810

The simulation results confirm the analytic calculations.