We attempt to provide a big picture view of what is involved in a clinical trial simulation with individual time-to-event data generated for each patient. Primary interest is in group sequential trials, usually with a single endpoint. However extensions could be made.

At the time of simulation planning an analysis plan for the trial is needed. For a group sequential design, a data table to store results is generated. Generally, the dimensions and variables planned for storage would be planned up front. As a simple example, if there is a group sequential design with 3 analyses planned, 15 data items for each analysis and 10,000 simulations planned, a data table with 30,000 rows and 15 columns has been used to store summary results. As each trial simulation proceeds, a row is updated with results for each analysis.

For each simulated trial, an initial table is generated with information at a patient level. If trials are generated sequentially, the space needed for this data table could be re-used, never requiring allocation of more space. Each row contains data for a single patient. As an example, we could simulate a trial with 500 patients and 10 data items per patients. The data items would be in columns, the patients in rows.

Simulated trial data need to be manipulated to do any individual analysis (interim or final) for a clinical trial. The following operations are needed:

- Ordering data
- Selecting a subset for analysis
- Calculating individual patient results for the subset at the time of analysis.
- Performing statistical tests and computing treatment effect
estimates as well as other summaries that will included in the results
summary dataset described above. Types of computations needed are
- Number of subjects by treatment group
- Number of events by treatment group
- Kaplan-Meier estimation of survival curves
- Observed minus expected computations as well as weighting for logrank, weighted logrank calculations.
- Using the survival package to compute hazard ratio estimates.

Group sequential design simulation flow:

- Generate a trial.
- Analyze repeatedly.
- Summarize across simulated trials.