Skip to contents

Returns the aggregated simulation data.

Usage

getData(x)

getData.SimulationResults(x)

Value

Returns a data.frame.

Details

This function can be used to get the aggregated simulated data from an simulation results object, for example, obtained by getSimulationSurvival(). In this case, the data frame contains the following columns:

  1. iterationNumber: The number of the simulation iteration.

  2. stageNumber: The stage.

  3. pi1: The assumed or derived event rate in the treatment group.

  4. pi2: The assumed or derived event rate in the control group.

  5. hazardRatio: The hazard ratio under consideration (if available).

  6. analysisTime: The analysis time.

  7. numberOfSubjects: The number of subjects under consideration when the (interim) analysis takes place.

  8. eventsPerStage1: The observed number of events per stage in treatment group 1.

  9. eventsPerStage2: The observed number of events per stage in treatment group 2.

  10. eventsPerStage: The observed number of events per stage in both treatment groups.

  11. rejectPerStage: 1 if null hypothesis can be rejected, 0 otherwise.

  12. eventsNotAchieved: 1 if number of events could not be reached with observed number of subjects, 0 otherwise.

  13. futilityPerStage: 1 if study should be stopped for futility, 0 otherwise.

  14. testStatistic: The test statistic that is used for the test decision, depends on which design was chosen (group sequential, inverse normal, or Fisher combination test)'

  15. logRankStatistic: Z-score statistic which corresponds to a one-sided log-rank test at considered stage.

  16. conditionalPowerAchieved: The conditional power for the subsequent stage of the trial for selected sample size and effect. The effect is either estimated from the data or can be user defined with thetaH1 or pi1H1 and pi2H1.

  17. trialStop: TRUE if study should be stopped for efficacy or futility or final stage, FALSE otherwise.

  18. hazardRatioEstimateLR: The estimated hazard ratio, derived from the log-rank statistic.

A subset of variables is provided for getSimulationMeans(), getSimulationRates(), getSimulationMultiArmMeans(),
getSimulationMultiArmRates(), or getSimulationMultiArmSurvival().

Examples

results <- getSimulationSurvival(
    pi1 = seq(0.3, 0.6, 0.1), pi2 = 0.3, eventTime = 12,
    accrualTime = 24, plannedEvents = 40, maxNumberOfSubjects = 200,
    maxNumberOfIterations = 50
)
data <- getData(results)
head(data)
#>   iterationNumber stageNumber pi1 pi2 hazardRatio analysisTime numberOfSubjects
#> 1               1           1 0.3 0.3           1     18.67276              155
#> 2               2           1 0.3 0.3           1     20.69466              172
#> 3               3           1 0.3 0.3           1     19.06769              158
#> 4               4           1 0.3 0.3           1     17.30359              144
#> 5               5           1 0.3 0.3           1     19.40094              161
#> 6               6           1 0.3 0.3           1     19.18667              159
#>   overallEvents1 overallEvents2 eventsPerStage rejectPerStage eventsNotAchieved
#> 1             19             21             40              0                 0
#> 2             17             23             40              0                 0
#> 3             17             23             40              0                 0
#> 4             24             16             40              0                 0
#> 5             17             23             40              0                 0
#> 6             22             18             40              0                 0
#>   futilityPerStage testStatistic logRankStatistic conditionalPowerAchieved
#> 1                0    -0.4347597       -0.4347597                       NA
#> 2                0    -1.1501956       -1.1501956                       NA
#> 3                0    -1.2549837       -1.2549837                       NA
#> 4                0     1.4876487        1.4876487                       NA
#> 5                0    -1.2459485       -1.2459485                       NA
#> 6                0     1.0268010        1.0268010                       NA
#>   pValuesSeparate trialStop hazardRatioEstimateLR
#> 1      0.66813157      TRUE             0.8715491
#> 2      0.87496833      TRUE             0.6950832
#> 3      0.89525766      TRUE             0.6724277
#> 4      0.06842178      TRUE             1.6006917
#> 5      0.89360835      TRUE             0.6743517
#> 6      0.15225708      TRUE             1.3836196
dim(data)
#> [1] 200  19