The simtte package simulates time-to-event (survival) datasets for clinical trial design and analysis. It supports:
Event times are generated using inverse transform sampling from the cumulative hazard function, computed via the mrgsolve ODE solver backend.
The Weibull hazard function is:
\[h(t) = \lambda \cdot \gamma \cdot t^{\gamma - 1}\]
where \(\lambda = \exp(\mu + \mathbf{x}'\boldsymbol{\beta})\) is the scale and \(\gamma\) is the shape parameter.
For the flexible model, the baseline hazard is represented as a linear combination of M-spline basis functions, allowing complex hazard shapes.
Given a survival function \(S(t)\), we draw \(U \sim \text{Uniform}(0, 1)\) and find the time \(t^*\) such that \(S(t^*) = U\). The package solves the Kolmogorov forward equation numerically via mrgsolve and then applies this sampling scheme.
The output is a data frame with columns:
| Column | Description |
|---|---|
sim_time |
Simulated event or censoring time |
sim_status |
Event indicator (1 = event, 0 = censored) |
ID |
Subject identifier |
lp |
Linear predictor (log hazard ratio) |