← Back to all sparks
S

simtrial

ANALYTICS
Velocity0.0

Clinical trial simulation for time-to-event endpoints

A fixed-design trial simulator grew a pluggable test framework, then spent a year proving the numbers

clinical-trialsgroup-sequentialsurvival-analysissimulationpharmaverseperformance
Current state
simtrial simulates time-to-event clinical trials and applies the tests used to analyse them — logrank, weighted logrank, MaxCombo, RMST, milestone. The 0.4.0 release turned it from a fixed-sample simulator into a group sequential one and standardised every test behind a common output contract, and the releases since have been about making that machinery correct and fast enough to run at scale. Version 1.0.0 arrived in June 2025 with the API settled and three vignettes explaining both the one-call and build-it-yourself paths.
Where it's heading
Post-1.0 the work is almost entirely statistical correctness and speed, and it is concentrated in sim_gs_n(): one-sided efficacy bounds, stratified targeted-event cut dates, a helper that derives cuttings straight from the design object. Performance moves in one direction throughout — dplyr replaced by data.table, foreach combination replaced by manual assembly, parallelisation added to sim_fixed_n() — because simulation-based operating characteristics are only useful if you can afford enough replications.
Prediction
The recent fixes cluster on stratified and group sequential paths, so the next release most likely continues there rather than adding a new test type. The cut_from_design() helper suggests tighter coupling to gsDesign2 design objects is the direction of travel.

Recent moves

  1. 8mo ago

    One-sided efficacy bound and stratified cut date corrected

    Corrects the efficacy bound sim_gs_n() reports for one-sided designs and fixes the cut date derived from stratified targeted events in get_analysis_date(). Both change numbers that feed into design decisions, which puts them above routine bug fixing. An internal cut_from_design() helper now derives cuttings from the design object directly.

    View source ↗
  2. 11mo ago

    sim_gs_n moved to data.table; stratified design example added

    Replaces dplyr with data.table inside sim_gs_n() for speed and adds a worked stratified group sequential example. The dplyr-to-data.table conversion is the same move made in summary() a year earlier — this codebase steadily trades ergonomics for throughput in its hot paths.

    View source ↗
  3. 1y ago

    1.0.0 settles the wlr interface and documents both simulation paths

    The 1.0.0 release consolidates rather than expands: wlr() accepts a formula and becomes an S3 method across both tte_data and counting_process, sim_pw_surv() carries the randomization ratio as an attribute, and parallel simulation gets faster by dropping foreach's rbind combination. Three new vignettes cover simulating fixed and group sequential designs from a single call or from the ground up.

    View source ↗
  4. 1y ago

    Milestone Z-score denominator corrected; parallel sim_fixed_n arrives

    Corrects the denominator of the milestone test Z-score and unifies Z-score signs to positive — changes that alter results produced by the previous release. Alongside them, sim_gs_n() gains a summary method and statistical information output, sim_fixed_n() gains parallel execution, and summary() is rewritten on data.table to avoid temporary copies.

    View source ↗
  5. 2y ago

    Checks pass without Suggests dependencies

    Makes examples, tests and vignettes run conditionally so the package passes checks without its Suggests dependencies installed. Packaging hygiene with no effect on simulation results.

    View source ↗
  6. 2y ago

    RMST and milestone tests, plus a user-definable cut and test framework

    ⚡ SPARK

    Adds the RMST and milestone tests, an experimental sim_gs_n() for group sequential simulation, and the create_cut() / create_test() / multitest() trio that lets users define their own interim analyses and testing strategies. Every test — logrank, weighted logrank, RMST, milestone, MaxCombo — is unified behind one output structure. This is where the package stops being a fixed-design simulator with built-in tests and becomes a framework.

    View source ↗