Returns the aggregated simulation data.
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:
iterationNumber
: The number of the simulation iteration.stageNumber
: The stage.pi1
: The assumed or derived event rate in the treatment group.pi2
: The assumed or derived event rate in the control group.hazardRatio
: The hazard ratio under consideration (if available).analysisTime
: The analysis time.numberOfSubjects
: The number of subjects under consideration when the (interim) analysis takes place.eventsPerStage1
: The observed number of events per stage in treatment group 1.eventsPerStage2
: The observed number of events per stage in treatment group 2.eventsPerStage
: The observed number of events per stage in both treatment groups.rejectPerStage
: 1 if null hypothesis can be rejected, 0 otherwise.eventsNotAchieved
: 1 if number of events could not be reached with observed number of subjects, 0 otherwise.futilityPerStage
: 1 if study should be stopped for futility, 0 otherwise.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)'logRankStatistic
: Z-score statistic which corresponds to a one-sided log-rank test at considered stage.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 withthetaH1
orpi1H1
andpi2H1
.trialStop
:TRUE
if study should be stopped for efficacy or futility or final stage,FALSE
otherwise.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