getRawData: Get Simulation Raw Data for Survival

View source: R/class_simulation_results.R

getRawDataR Documentation

Get Simulation Raw Data for Survival

Description

Returns the raw survival data which was generated for simulation.

Usage

getRawData(x, aggregate = FALSE)

Arguments

x

A SimulationResults object created by getSimulationSurvival().

aggregate

Logical. If TRUE the raw data will be aggregated similar to the result of getData(), default is FALSE.

Details

This function works only if getSimulationSurvival() was called with a
maxNumberOfRawDatasetsPerStage > 0 (default is 0).

This function can be used to get the simulated raw data from a simulation results object obtained by getSimulationSurvival(). Note that getSimulationSurvival() must called before with maxNumberOfRawDatasetsPerStage > 0. The data frame contains the following columns:

  1. iterationNumber: The number of the simulation iteration.

  2. stopStage: The stage of stopping.

  3. subjectId: The subject id (increasing number 1, 2, 3, ...)

  4. accrualTime: The accrual time, i.e., the time when the subject entered the trial.

  5. treatmentGroup: The treatment group number (1 or 2).

  6. survivalTime: The survival time of the subject.

  7. dropoutTime: The dropout time of the subject (may be NA).

  8. observationTime: The specific observation time.

  9. timeUnderObservation: The time under observation is defined as follows:
    if (event == TRUE)
    timeUnderObservation <- survivalTime;
    else if (dropoutEvent == TRUE)
    timeUnderObservation <- dropoutTime;
    else
    timeUnderObservation <- observationTime - accrualTime;

  10. event: TRUE if an event occurred; FALSE otherwise.

  11. dropoutEvent: TRUE if an dropout event occurred; FALSE otherwise.

Value

Returns a data.frame.

Examples

## Not run: 
results <- getSimulationSurvival(
    pi1 = seq(0.3, 0.6, 0.1), pi2 = 0.3, eventTime = 12,
    accrualTime = 24, plannedEvents = 40, maxNumberOfSubjects = 200,
    maxNumberOfIterations = 50, maxNumberOfRawDatasetsPerStage = 5
)
rawData <- getRawData(results)
head(rawData)
dim(rawData)

## End(Not run)


rpact documentation built on July 9, 2023, 6:30 p.m.