Free examples and use-cases:   rpact vignettes
rpact: Confirmatory Adaptive Clinical Trial Design and Analysis

Summary

This R Markdown document provides many different examples that illustrate the usage of so-called R generic functions (short: R generics) with rpact, e.g., as.data.frame or summary.

1 Working with objects

First, load the rpact package

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

1.1 Create an example of all available rpact objects

design <- getDesignGroupSequential(alpha = 0.05, kMax = 4, 
    sided = 1, typeOfDesign = "WT", deltaWT = 0.1)

designFisher <- getDesignFisher(kMax = 4, alpha = 0.025, 
    informationRates = c(0.2, 0.5, 0.8, 1), alpha0Vec = rep(0.4, 3))

designConditionalDunnett <- getDesignConditionalDunnett(secondStageConditioning = TRUE)

designCharacteristics <- getDesignCharacteristics(design)

powerAndASN <- getPowerAndAverageSampleNumber(design, theta = 1, nMax = 100)

designSet <- getDesignSet(design = design, deltaWT = c(0.3, 0.4))

dataset <- getDataset(
    n1 = c(22, 11, 22, 11),
    n2 = c(22, 13, 22, 13),
    means1 = c(1, 1.1, 1, 1),
    means2 = c(1.4, 1.5, 3, 2.5),
    stDevs1 = c(1, 2, 2, 1.3),
    stDevs2 = c(1, 2, 2, 1.3)
)

stageResults <- getStageResults(design, dataset)

analysisResults <- getAnalysisResults(design, dataset)
## Warning: Observed sample sizes (44, 68, 112, 136) not according to specified
## information rates (0.25, 0.5, 0.75, 1) in group sequential design. Test
## procedure might not control Type I error rate
designPlan <- getSampleSizeMeans(design)

simulationResults <- getSimulationSurvival(design, 
    maxNumberOfSubjects = 100, plannedEvents = c(50, 100, 150, 200), seed = 12345)
## Warning: Presumably due to drop-outs, required number of events were not
## achieved for at least one situation. Increase the maximum number of subjects
## (100) to avoid this situation
piecewiseSurvivalTime <- getPiecewiseSurvivalTime(list(
    "0 - <6" = 0.025, 
    "6 - <9" = 0.04, 
    "9 - <15" = 0.015, 
    "15 - <21" = 0.01, 
    ">= 21" = 0.007), hazardRatio = 0.8)

accrualTime <- getAccrualTime(list(
    "0  - <12" = 15,
    "12 - <13" = 21,
    "13 - <14" = 27,
    "14 - <15" = 33,
    "15 - <16" = 39,
    ">= 16" = 45), maxNumberOfSubjects = 1400)

2 How to use R generic functions with rpact objects

2.1 Get field names of the object

names(design)
##  [1] "kMax"                  "alpha"                 "stages"               
##  [4] "informationRates"      "userAlphaSpending"     "criticalValues"       
##  [7] "stageLevels"           "alphaSpent"            "bindingFutility"      
## [10] "tolerance"             "typeOfDesign"          "beta"                 
## [13] "deltaWT"               "deltaPT1"              "deltaPT0"             
## [16] "futilityBounds"        "gammaA"                "gammaB"               
## [19] "optimizationCriterion" "sided"                 "betaSpent"            
## [22] "typeBetaSpending"      "userBetaSpending"      "power"                
## [25] "twoSidedPower"         "constantBoundsHP"
names(designFisher)
##  [1] "kMax"                     "alpha"                   
##  [3] "stages"                   "informationRates"        
##  [5] "userAlphaSpending"        "criticalValues"          
##  [7] "stageLevels"              "alphaSpent"              
##  [9] "bindingFutility"          "tolerance"               
## [11] "method"                   "alpha0Vec"               
## [13] "scale"                    "nonStochasticCurtailment"
## [15] "sided"                    "simAlpha"                
## [17] "iterations"               "seed"
names(designCharacteristics)
##  [1] "nFixed"                 "shift"                  "inflationFactor"       
##  [4] "stages"                 "information"            "power"                 
##  [7] "rejectionProbabilities" "futilityProbabilities"  "averageSampleNumber1"  
## [10] "averageSampleNumber01"  "averageSampleNumber0"
names(powerAndASN)
##  [1] "nMax"                "theta"               "averageSampleNumber"
##  [4] "calculatedPower"     "overallEarlyStop"    "earlyStop"          
##  [7] "overallReject"       "rejectPerStage"      "overallFutility"    
## [10] "futilityPerStage"
names(designSet)
## [1] "designs"          "variedParameters"
names(dataset)
## [1] "stages"             "groups"             "subsets"           
## [4] "sampleSizes"        "means"              "stDevs"            
## [7] "overallSampleSizes" "overallMeans"       "overallStDevs"
names(stageResults)
##  [1] "stages"                "overallTestStatistics" "overallPValues"       
##  [4] "overallMeans1"         "overallMeans2"         "overallStDevs1"       
##  [7] "overallStDevs2"        "overallSampleSizes1"   "overallSampleSizes2"  
## [10] "testStatistics"        "pValues"               "effectSizes"          
## [13] "thetaH0"               "direction"             "normalApproximation"  
## [16] "equalVariances"
names(analysisResults)
##  [1] ".design"                              
##  [2] ".dataInput"                           
##  [3] ".stageResults"                        
##  [4] ".conditionalPowerResults"             
##  [5] "normalApproximation"                  
##  [6] "directionUpper"                       
##  [7] "thetaH0"                              
##  [8] "pi1"                                  
##  [9] "pi2"                                  
## [10] "nPlanned"                             
## [11] "allocationRatioPlanned"               
## [12] "thetaH1"                              
## [13] "assumedStDev"                         
## [14] "equalVariances"                       
## [15] "testActions"                          
## [16] "conditionalRejectionProbabilities"    
## [17] "conditionalPower"                     
## [18] "repeatedConfidenceIntervalLowerBounds"
## [19] "repeatedConfidenceIntervalUpperBounds"
## [20] "repeatedPValues"                      
## [21] "finalStage"                           
## [22] "finalPValues"                         
## [23] "finalConfidenceIntervalLowerBounds"   
## [24] "finalConfidenceIntervalUpperBounds"   
## [25] "medianUnbiasedEstimates"              
## [26] "maxInformation"                       
## [27] "informationEpsilon"
names(designPlan)
##  [1] "meanRatio"                      "thetaH0"                       
##  [3] "normalApproximation"            "alternative"                   
##  [5] "stDev"                          "groups"                        
##  [7] "allocationRatioPlanned"         "optimumAllocationRatio"        
##  [9] "directionUpper"                 "effect"                        
## [11] "overallReject"                  "rejectPerStage"                
## [13] "futilityStop"                   "futilityPerStage"              
## [15] "earlyStop"                      "expectedNumberOfSubjects"      
## [17] "nFixed"                         "nFixed1"                       
## [19] "nFixed2"                        "informationRates"              
## [21] "maxNumberOfSubjects"            "maxNumberOfSubjects1"          
## [23] "maxNumberOfSubjects2"           "numberOfSubjects"              
## [25] "numberOfSubjects1"              "numberOfSubjects2"             
## [27] "expectedNumberOfSubjectsH0"     "expectedNumberOfSubjectsH01"   
## [29] "expectedNumberOfSubjectsH1"     "criticalValuesEffectScale"     
## [31] "criticalValuesEffectScaleLower" "criticalValuesEffectScaleUpper"
## [33] "criticalValuesPValueScale"      "futilityBoundsEffectScale"     
## [35] "futilityBoundsEffectScaleLower" "futilityBoundsEffectScaleUpper"
## [37] "futilityBoundsPValueScale"
names(simulationResults)
##  [1] ".design"                   ".data"                    
##  [3] ".rawData"                  ".piecewiseSurvivalTime"   
##  [5] ".accrualTime"              "maxNumberOfIterations"    
##  [7] "seed"                      "allocationRatioPlanned"   
##  [9] "conditionalPower"          "iterations"               
## [11] "futilityPerStage"          "futilityStop"             
## [13] "directionUpper"            "plannedEvents"            
## [15] "minNumberOfEventsPerStage" "maxNumberOfEventsPerStage"
## [17] "thetaH1"                   "calcEventsFunction"       
## [19] "expectedNumberOfEvents"    "pi1"                      
## [21] "pi2"                       "median1"                  
## [23] "median2"                   "maxNumberOfSubjects"      
## [25] "accrualTime"               "accrualIntensity"         
## [27] "dropoutRate1"              "dropoutRate2"             
## [29] "dropoutTime"               "eventTime"                
## [31] "thetaH0"                   "allocation1"              
## [33] "allocation2"               "kappa"                    
## [35] "piecewiseSurvivalTime"     "lambda1"                  
## [37] "lambda2"                   "earlyStop"                
## [39] "hazardRatio"               "analysisTime"             
## [41] "studyDuration"             "eventsNotAchieved"        
## [43] "numberOfSubjects"          "numberOfSubjects1"        
## [45] "numberOfSubjects2"         "eventsPerStage"           
## [47] "expectedNumberOfSubjects"  "rejectPerStage"           
## [49] "overallReject"             "conditionalPowerAchieved"
names(piecewiseSurvivalTime)
##  [1] "piecewiseSurvivalTime"    "lambda1"                 
##  [3] "lambda2"                  "hazardRatio"             
##  [5] "pi1"                      "pi2"                     
##  [7] "median1"                  "median2"                 
##  [9] "eventTime"                "kappa"                   
## [11] "piecewiseSurvivalEnabled" "delayedResponseAllowed"  
## [13] "delayedResponseEnabled"
names(accrualTime)
##  [1] "endOfAccrualIsUserDefined"                 
##  [2] "followUpTimeMustBeUserDefined"             
##  [3] "maxNumberOfSubjectsIsUserDefined"          
##  [4] "maxNumberOfSubjectsCanBeCalculatedDirectly"
##  [5] "absoluteAccrualIntensityEnabled"           
##  [6] "accrualTime"                               
##  [7] "accrualIntensity"                          
##  [8] "accrualIntensityRelative"                  
##  [9] "maxNumberOfSubjects"                       
## [10] "remainingTime"                             
## [11] "piecewiseAccrualEnabled"

2.1.1 Access data of a field

design$criticalValues
## [1] 3.069028 2.325888 1.977663 1.762694
design[["criticalValues"]]
## [1] 3.069028 2.325888 1.977663 1.762694

2.3 Show a summary of the object

summary(design)
## Sequential analysis with a maximum of 4 looks (group sequential design)
## 
## Wang & Tsiatis Delta class design (deltaWT = 0.1), one-sided overall 
## significance level 5%, power 80%, undefined endpoint.
## 
## Stage                                  1      2      3      4 
## Information rate                     25%    50%    75%   100% 
## Efficacy boundary (z-value scale)  3.069  2.326  1.978  1.763 
## Cumulative alpha spent            0.0011 0.0105 0.0282 0.0500 
## Overall power                     0.0362 0.3026 0.6034 0.8000
summary(designFisher)
## Sequential analysis with a maximum of 4 looks (Fisher's combination test design)
## 
## Fisher's combination test design, binding futility, one-sided overall 
## significance level 2.5%, undefined endpoint.
## 
## Stage                                               1          2          3          4 
## Information rate                                  20%        50%        80%       100% 
## Efficacy boundary (p product scale)        0.01366638 0.00089215 0.00009643 0.00002151 
## Futility boundary (separate p-value scale)      0.400      0.400      0.400 
## Cumulative alpha spent                         0.0137     0.0206     0.0237     0.0250
summary(designCharacteristics)
## Sequential analysis with a maximum of 4 looks (group sequential design)
## 
## Wang & Tsiatis Delta class design (deltaWT = 0.1), one-sided overall 
## significance level 5%, power 80%, undefined endpoint.
## 
## Stage                                  1      2      3      4 
## Information rate                     25%    50%    75%   100% 
## Efficacy boundary (z-value scale)  3.069  2.326  1.978  1.763 
## Cumulative alpha spent            0.0011 0.0105 0.0282 0.0500 
## Overall power                     0.0362 0.3026 0.6034 0.8000
summary(powerAndASN)
## Technical developer summary of the power and average sample size (ASN) object ("PowerAndAverageSampleNumberResult"):
## 
##   [d] N_max                                    : 100.0 
##   [u] Effect                                   : 1 
##   [g] Average sample sizes (ASN)               : 25.669 
##   [g] Power                                    : 1.0000 
##   [g] Early stop                               : 1.0000 
##   [g] Early stop [1]                           : 0.973256728 
##   [g] Early stop [2]                           : 0.026742247 
##   [g] Early stop [3]                           : 0.000001025 
##   [g] Early stop [4]                           : NA 
##   [g] Overall reject                           : 1.0000 
##   [g] Reject per stage [1]                     : 0.973256727 
##   [g] Reject per stage [2]                     : 0.026742246 
##   [g] Reject per stage [3]                     : 0.000001024 
##   [g] Reject per stage [4]                     : 0.000000000 
##   [g] Overall futility                         : 0.0000 
##   [g] Futility stop per stage [1]              : 0.0000 
##   [g] Futility stop per stage [2]              : 0.0000 
##   [g] Futility stop per stage [3]              : 0.0000 
## 
## Legend:
##   u: user defined
##   >: derived value
##   d: default value
##   g: generated/calculated value
##   .: not applicable or hidden
## 
## Power and average sample size (ASN) table:
##      Stage     Early stop Reject per stage Futility stop per stage
## [1,]     1 0.973256727989   0.973256727002      0.0000000009865876
## [2,]     2 0.026742246997   0.026742246022      0.0000000009755040
## [3,]     3 0.000001025014   0.000001024395      0.0000000006188329
## [4,]     4             NA   0.000000000000                      NA
summary(designSet)
## [[1]]
## Sequential analysis with a maximum of 4 looks (group sequential design)
## 
## Wang & Tsiatis Delta class design (deltaWT = 0.1), one-sided overall 
## significance level 5%, power 80%, undefined endpoint.
## 
## Stage                                  1      2      3      4 
## Information rate                     25%    50%    75%   100% 
## Efficacy boundary (z-value scale)  3.069  2.326  1.978  1.763 
## Cumulative alpha spent            0.0011 0.0105 0.0282 0.0500 
## Overall power                     0.0362 0.3026 0.6034 0.8000 
## 
## [[2]]
## Sequential analysis with a maximum of 4 looks (group sequential design)
## 
## Wang & Tsiatis Delta class design (deltaWT = 0.3), one-sided overall 
## significance level 5%, power 80%, undefined endpoint.
## 
## Stage                                  1      2      3      4 
## Information rate                     25%    50%    75%   100% 
## Efficacy boundary (z-value scale)  2.462  2.143  1.976  1.866 
## Cumulative alpha spent            0.0069 0.0202 0.0351 0.0500 
## Overall power                     0.1238 0.3990 0.6401 0.8000 
## 
## [[3]]
## Sequential analysis with a maximum of 4 looks (group sequential design)
## 
## Wang & Tsiatis Delta class design (deltaWT = 0.4), one-sided overall 
## significance level 5%, power 80%, undefined endpoint.
## 
## Stage                                  1      2      3      4 
## Information rate                     25%    50%    75%   100% 
## Efficacy boundary (z-value scale)  2.241  2.091  2.008  1.951 
## Cumulative alpha spent            0.0125 0.0263 0.0388 0.0500 
## Overall power                     0.1823 0.4455 0.6576 0.8000
summary(dataset)
## Dataset of means
## 
## The dataset contains the sample sizes, means, and standard deviations of 
## one treatment and one control group.
## The total number of looks is four; stage-wise and cumulative data are included.
## 
## Stage                             1     1     2     2     3     3     4     4 
## Group                             1     2     1     2     1     2     1     2 
## Stage-wise sample size           22    22    11    13    22    22    11    13 
## Cumulative sample size           22    22    33    35    55    57    66    70 
## Stage-wise mean               1.000 1.400 1.100 1.500 1.000 3.000 1.000 2.500 
## Cumulative mean               1.000 1.400 1.033 1.437 1.020 2.040 1.017 2.126 
## Stage-wise standard deviation 1.000 1.000 2.000 2.000 2.000 2.000 1.300 1.300 
## Cumulative standard deviation 1.000 1.000 1.381 1.425 1.639 1.823 1.579 1.739
summary(stageResults)
## Technical developer summary of the stage results of means object ("StageResultsMeans"):
## 
##   [u] Stages                                   : 1, 2, 3, 4 
##   [g] Overall test statistics                  : -1.327, -1.185, -3.111, -3.887 
##   [g] Overall p-values                         : 0.9041, 0.8799, 0.9988, 0.9999 
##   [g] Cumulative means (1)                     : 1.000, 1.033, 1.020, 1.017 
##   [g] Cumulative means (2)                     : 1.400, 1.437, 2.040, 2.126 
##   [g] Cumulative standard deviations (1)       : 1.000, 1.381, 1.639, 1.579 
##   [g] Cumulative standard deviations (2)       : 1.000, 1.425, 1.823, 1.739 
##   [g] Cumulative sample sizes (1)              : 22, 33, 55, 66 
##   [g] Cumulative sample sizes (2)              : 22, 35, 57, 70 
##   [g] Stage-wise test statistics               : -1.327, -0.488, -3.317, -2.817 
##   [g] Stage-wise p-values                      : 0.9041, 0.6849, 0.9991, 0.9950 
##   [g] Cumulative effect sizes                  : -0.4000, -0.4038, -1.0204, -1.1090 
##   [d] Theta H0                                 : 0 
##   [d] Direction                                : upper 
##   [d] Normal approximation                     : FALSE 
##   [d] Equal variances                          : TRUE 
##   [.] %stage%                                  : 4 
##   [.] Fixed weights                            : 1.000, 1.000, 1.000, 1.000 
##   [.] Fixed weights                            : 0.500, 0.500, 0.500, 0.500 
##   [.] Combination test statistics              : -1.305, -1.263, -2.826, -3.734 
##   [.] Combination test statistics              : 0.9041, 0.6192, 0.6186, 0.6155 
##   [?] Cumulative means                         :  
##   [?] Cumulative (pooled) standard deviations  : 1.000, 1.404, 1.735, 1.663 
##   [?] Cumulative sample sizes                  :  
## 
## Legend:
##   u: user defined
##   >: derived value
##   d: default value
##   g: generated/calculated value
##   .: not applicable or hidden
## 
## Stage results of means table:
##      Stage Overall test statistic Overall p-value Cumulative mean (1)
## [1,]     1              -1.326650       0.9041035            1.000000
## [2,]     2              -1.185099       0.8798860            1.033333
## [3,]     3              -3.111238       0.9988132            1.020000
## [4,]     4              -3.886959       0.9999205            1.016667
##      Cumulative mean (2) Cumulative standard deviation (1)
## [1,]            1.400000                          1.000000
## [2,]            1.437143                          1.381500
## [3,]            2.040351                          1.639151
## [4,]            2.125714                          1.578664
##      Cumulative standard deviation (2) Cumulative sample size (1)
## [1,]                          1.000000                         22
## [2,]                          1.425418                         33
## [3,]                          1.822857                         55
## [4,]                          1.738706                         66
##      Cumulative sample size (2) Stage-wise test statistic   p-value
## [1,]                         22                 -1.326650 0.9041035
## [2,]                         35                 -0.488194 0.6848785
## [3,]                         57                 -3.316625 0.9990567
## [4,]                         70                 -2.816504 0.9949743
##      Overall effect size
## [1,]          -0.4000000
## [2,]          -0.4038095
## [3,]          -1.0203509
## [4,]          -1.1090476
summary(analysisResults)
## Analysis results for a continuous endpoint
## 
## Sequential analysis with 4 looks (group sequential design).
## The results were calculated using a two-sample t-test (one-sided), 
## equal variances option.
## H0: mu(1) - mu(2) = 0 against H1: mu(1) - mu(2) > 0.
## 
## Stage                                                 1                2                3                4 
## Fixed weight                                       0.25              0.5             0.75                1 
## Efficacy boundary (z-value scale)                 3.069            2.326            1.978            1.763 
## Cumulative alpha spent                           0.0011           0.0105           0.0282           0.0500 
## Stage level                                      0.0011           0.0100           0.0240           0.0390 
## Cumulative effect size                           -0.400           -0.404           -1.020           -1.109 
## Cumulative (pooled) standard deviation            1.000            1.404            1.735            1.663 
## Overall test statistic                           -1.327           -1.185           -3.111           -3.887 
## Overall p-value                                  0.9041           0.8799           0.9988           0.9999 
## Test action                                    continue         continue         continue           accept 
## Conditional rejection probability                0.0028           0.0001                0                  
## 90% repeated confidence interval        [-1.386; 0.586 ] [-1.216; 0.408 ] [-1.676; -0.364] [-1.616; -0.602]
## Repeated p-value                                   >0.5             >0.5             >0.5             >0.5 
## Final p-value                                                                                       0.9999 
## Final confidence interval                                                                  [-1.547; -0.608]
## Median unbiased estimate                                                                            -1.078
summary(designPlan)
## Sample size calculation for a continuous endpoint
## 
## Sequential analysis with a maximum of 4 looks (group sequential design), overall 
## significance level 5% (one-sided).
## The sample size was calculated for a two-sample t-test, H0: mu(1) - mu(2) = 0, 
## H1: effect as specified, standard deviation = 1, power 80%.
## 
## Stage                                         1      2      3      4 
## Information rate                            25%    50%    75%   100% 
## Efficacy boundary (z-value scale)         3.069  2.326  1.978  1.763 
## Overall power                            0.0362 0.3026 0.6034 0.8000 
## Expected number of subjects, alt. = 0.2   496.6 
## Expected number of subjects, alt. = 0.4   125.0 
## Expected number of subjects, alt. = 0.6    56.2 
## Expected number of subjects, alt. = 0.8    32.1 
## Expected number of subjects, alt. = 1      21.0 
## Number of subjects, alt. = 0.2            162.4  324.8  487.2  649.6 
## Number of subjects, alt. = 0.4             40.9   81.7  122.6  163.5 
## Number of subjects, alt. = 0.6             18.4   36.7   55.1   73.5 
## Number of subjects, alt. = 0.8             10.5   21.0   31.5   42.0 
## Number of subjects, alt. = 1                6.9   13.7   20.6   27.5 
## Cumulative alpha spent                   0.0011 0.0105 0.0282 0.0500 
## One-sided local significance level       0.0011 0.0100 0.0240 0.0390 
## Efficacy boundary (t), alt. = 0.2         0.490  0.259  0.180  0.139 
## Efficacy boundary (t), alt. = 0.4         1.029  0.525  0.361  0.277 
## Efficacy boundary (t), alt. = 0.6         1.697  0.804  0.545  0.417 
## Efficacy boundary (t), alt. = 0.8         2.678  1.108  0.735  0.558 
## Efficacy boundary (t), alt. = 1           4.519  1.452  0.933  0.701 
## Exit probability for efficacy (under H0) 0.0011 0.0095 0.0177 
## Exit probability for efficacy (under H1) 0.0362 0.2664 0.3007 
## 
## Legend:
##   alt.: alternative
##   (t): treatment effect scale
summary(simulationResults)
## Simulation of a survival endpoint
## 
## Sequential analysis with a maximum of 4 looks (group sequential design), overall 
## significance level 5% (one-sided).
## The results were simulated for a two-sample logrank test, 
## H0: hazard ratio = 1, power directed towards larger values, 
## H1: treatment pi(1) as specified, control pi(2) = 0.2, 
## planned cumulative events = c(50, 100, 150, 200), maximum number of subjects = 100, 
## event time = 12, accrual time = 12, accrual intensity = 8.3, simulation runs = 1000, 
## seed = 12345.
## 
## Stage                                           1      2      3      4 
## Fixed weight                                 0.25    0.5   0.75      1 
## Efficacy boundary (z-value scale)           3.069  2.326  1.978  1.763 
## Overall power, pi(1) = 0.2                 0.0020 0.0020 0.0020 0.0020 
## Overall power, pi(1) = 0.3                 0.0740 0.0740 0.0740 0.0740 
## Overall power, pi(1) = 0.4                 0.4040 0.4040 0.4040 0.4040 
## Overall power, pi(1) = 0.5                 0.7870 0.7870 0.7870 0.7870 
## Expected number of subjects, pi(1) = 0.2      0.2 
## Expected number of subjects, pi(1) = 0.3      7.4 
## Expected number of subjects, pi(1) = 0.4     40.4 
## Expected number of subjects, pi(1) = 0.5     78.7 
## Number of subjects, pi(1) = 0.2             100.0                      
## Number of subjects, pi(1) = 0.3             100.0                      
## Number of subjects, pi(1) = 0.4             100.0                      
## Number of subjects, pi(1) = 0.5             100.0                      
## Expected number of events, pi(1) = 0.2       50.0 
## Expected number of events, pi(1) = 0.3       50.0 
## Expected number of events, pi(1) = 0.4       50.0 
## Expected number of events, pi(1) = 0.5       50.0 
## Cumulative number of events, pi(1) = 0.2     50.0   50.0   50.0   50.0 
## Cumulative number of events, pi(1) = 0.3     50.0   50.0   50.0   50.0 
## Cumulative number of events, pi(1) = 0.4     50.0   50.0   50.0   50.0 
## Cumulative number of events, pi(1) = 0.5     50.0   50.0   50.0   50.0 
## Analysis time, pi(1) = 0.2                   43.2                      
## Analysis time, pi(1) = 0.3                   35.4                      
## Analysis time, pi(1) = 0.4                   30.1                      
## Analysis time, pi(1) = 0.5                   26.3                      
## Expected study duration, pi(1) = 0.2         <0.1 
## Expected study duration, pi(1) = 0.3          2.6 
## Expected study duration, pi(1) = 0.4         12.3 
## Expected study duration, pi(1) = 0.5         20.8 
## Conditional power (achieved), pi(1) = 0.2         
## Conditional power (achieved), pi(1) = 0.3         
## Conditional power (achieved), pi(1) = 0.4         
## Conditional power (achieved), pi(1) = 0.5         
## Exit probability for efficacy, pi(1) = 0.2 0.0020      0      0      0 
## Exit probability for efficacy, pi(1) = 0.3 0.0740      0      0      0 
## Exit probability for efficacy, pi(1) = 0.4 0.4040      0      0      0 
## Exit probability for efficacy, pi(1) = 0.5 0.7870      0      0      0
summary(piecewiseSurvivalTime)
## Technical developer summary of the piecewise survival time object ("PiecewiseSurvivalTime"):
## 
##   [u] Piecewise survival times                 : 0, 6, 9, 15, 21 
##   [g] lambda(1)                                : 0.0200, 0.0320, 0.0120, 0.0080, 0.0056 
##   [u] lambda(2)                                : 0.025, 0.040, 0.015, 0.010, 0.007 
##   [u] Hazard ratio                             : 0.800 
##   [.] Assumed treatment rate                   : NA 
##   [.] Assumed control rate                     : NA 
##   [.] median(1)                                : NA 
##   [.] median(2)                                : NA 
##   [.] Event time                               : NA 
##   [d] kappa                                    : 1 
##   [g] Piecewise exponential survival enabled   : TRUE 
##   [d] Delayed response allowed                 : FALSE 
##   [.] Delayed response enabled                 : FALSE 
## 
## Legend:
##   u: user defined
##   >: derived value
##   d: default value
##   g: generated/calculated value
##   .: not applicable or hidden
## 
## Piecewise survival time table:
##      Piecewise survival times lambda(1) lambda(2)
## [1,]                        0    0.0200     0.025
## [2,]                        6    0.0320     0.040
## [3,]                        9    0.0120     0.015
## [4,]                       15    0.0080     0.010
## [5,]                       21    0.0056     0.007
summary(accrualTime)
## Technical developer summary of the accrual time object ("AccrualTime"):
## 
##   [g] End of accrual is user defined           : FALSE 
##   [g] Follow-up time must be user defined      : FALSE 
##   [g] Max number of subjects is user defined   : TRUE 
##   [g] Max number of subjects can be calculated directly : TRUE 
##   [g] Absolute accrual intensity is enabled    : TRUE 
##   [u] Accrual time                             : 0.00, 12.00, 13.00, 14.00, 15.00, 16.00, 40.44 
##   [u] Accrua