# Comparing Lakatos and Schoenfeld Methods

#### 12/15/2021

This R Markdown document compares the Lakatos method for sample size calculation of survival trials as implemented in the lrstat package with the Schoenfeld method for sample size calculation of survival trials as implemented in the rpact package. First we load the two packages.

library(lrstat)
library(rpact)

Consider a fixed design with $$\pi_1=0.2$$ for the active treatment group and $$\pi_2=0.4$$ for the control group at month 12, an enrollment period lasting 12 months to enroll 200 patients, and a target number of events of 40.

First, we find the follow-up time at which 40 events will be observed. This can be accomplished by the caltime function using a large upper bound of the follow-up time for bracketed search:

caltime(nevents = 40, accrualDuration = 12, accrualIntensity = 200/12,
lambda1 = -log(1-0.2)/12, lambda2 = -log(1-0.4)/12,
followupTime = 100)
## [1] 13.63171

Therefore the followup time for the last enrolled patient is 13.63 - 12 = 1.63 months. Next we use the lrpower function to estimate the power.

lrpower(kMax = 1, criticalValues = 1.96, accrualDuration = 12,
accrualIntensity = 200/12, lambda1 = -log(1-0.2)/12,
lambda2 = -log(1-0.4)/12,  followupTime = 1.63)
##
## overallReject      0.713
## alpha              0.025
## numberOfEvents    39.992
## numberOfSubjects 200.000
## studyDuration     13.630
## accrualDuration   12.000
## followupTime       1.630
## fixedFollowup      0.000
## rho1               0.000
## rho2               0.000
## efficacyBounds     1.960
## efficacyHR         0.537
## efficacyP          0.025
## information        9.959
## logRankHR          0.450

Therefore, the power is estimated to be 71.3%. In comparison, the getPowerSurvival function from rpact reports a power of 74.5%.

getPowerSurvival(alpha = 0.025, directionUpper = FALSE, pi1 = 0.2,
pi2 = 0.4, eventTime = 12, accrualTime = c(0, 12),
maxNumberOfSubjects = 200, maxNumberOfEvents = 40)
## Design plan parameters and output for survival data:
##
## Design parameters:
##   Critical values                              : 1.96
##   Significance level                           : 0.0250
##   Test                                         : one-sided
##
## User defined parameters:
##   Direction upper                              : FALSE
##   Assumed treatment rate                       : 0.200
##   Assumed control rate                         : 0.400
##   Maximum number of subjects                   : 200
##   Number of events                             : 40
##
## Default parameters:
##   Theta H0                                     : 1
##   Type of computation                          : Schoenfeld
##   Planned allocation ratio                     : 1
##   Event time                                   : 12
##   Accrual time                                 : 12.00
##   kappa                                        : 1
##   Drop-out rate (1)                            : 0.000
##   Drop-out rate (2)                            : 0.000
##   Drop-out time                                : 12
##
## Sample size and output:
##   median(1)                                    : 37.3
##   median(2)                                    : 16.3
##   lambda(1)                                    : 0.0186
##   lambda(2)                                    : 0.0426
##   Hazard ratio                                 : 0.437
##   Accrual intensity                            : 16.7
##   Follow up time                               : 1.63
##   Expected number of events                    : 40.0
##   Overall reject                               : 0.7451
##   Analysis times                               : 13.63
##   Study duration                               : 13.63
##   Expected number of subjects                  : 200.0
##   Critical values (treatment effect scale)     : 0.538
##
## Legend:
##   (i): values of treatment arm i

To see which method yields a more accurate power estimate, we run the getSimulationSurvival function of rpact, which reports a power of 71% with 10000 replications.

getSimulationSurvival(directionUpper = FALSE, pi1 = 0.2, pi2 = 0.4,
eventTime = 12, accrualTime = 12, plannedEvents = 40,
maxNumberOfSubjects = 200,
maxNumberOfIterations = 10000, seed = 12345)
## Simulation of survival data (fixed sample size design):
##
## Design parameters:
##   Critical values                              : 1.96
##   Significance level                           : 0.0250
##   Test                                         : one-sided
##
## User defined parameters:
##   Maximum number of iterations                 : 10000
##   Seed                                         : 12345
##   Direction upper                              : FALSE
##   Planned cumulative events                    : 40
##   Assumed treatment rate                       : 0.200
##   Assumed control rate                         : 0.400
##   Maximum number of subjects                   : 200
##
## Default parameters:
##   Planned allocation ratio                     : 1
##   Conditional power                            : NA
##   Accrual time                                 : 12.00
##   Drop-out rate (1)                            : 0.000
##   Drop-out rate (2)                            : 0.000
##   Drop-out time                                : 12
##   Event time                                   : 12
##   Theta H0                                     : 1
##   Allocation 1                                 : 1
##   Allocation 2                                 : 1
##   kappa                                        : 1
##
## Results:
##   median(1)                                    : 37.3
##   median(2)                                    : 16.3
##   Accrual intensity                            : 16.7
##   lambda(1)                                    : 0.0186
##   lambda(2)                                    : 0.0426
##   Hazard ratio                                 : 0.437
##   Analysis times                               : 13.64
##   Expected study duration                      : 13.64
##   Events not achieved                          : 0.000
##   Iterations                                   : 10000
##   Overall reject                               : 0.7129
##   Reject per stage                             : 0.7129
##   Early stop                                   : 0.0000
##   Expected number of subjects                  : 199.5
##   Expected number of events                    : 40.0
##
## Legend:
##   (i): values of treatment arm i

Therefore, the Lakatos method yields a more accurate power estimate than the Schoenfeld method in this case. The reason for this discrepancy is due to the hazard ratio being 0.437, which is rather far away from the null hazard ratio of 1. It is well-known that the Schoenfeld method yields an optimistic power estimate with equal randomization in this case.