RDA survsim
Flexible simulation of survival data — standard, flexible parametric, and user-defined hazards, with competing risks and multi-state structures. In Stata; the mature predecessor of avalon.
What survsim does
survsim simulates survival data from a wide range of hazard specifications — standard parametric distributions, flexible parametric (spline) models, fitted models, and fully user-defined hazard or log-hazard functions.
It supports time-dependent effects, competing risks, multi-state structures, and left truncation — the workhorse behind the team's methods-evaluation simulation studies, and behind much of the published survival-methods literature.
survsim is now being carried into both ecosystems as avalon (R + Stata), which succeeds it under one cross-ecosystem name. survsim remains available on SSC and fully supported.
Simulate almost any survival process
Standard & flexible parametric
Exponential, Weibull, Gompertz, and Royston-Parmar / log-hazard spline baselines — or simulate from a fitted model.
Custom hazards
Simulate from any user-supplied hazard or log-hazard function — no closed form required.
Competing risks & multi-state
Competing-risks and multi-state data, with time-dependent effects and left truncation.
Study design & evaluation
The standard tool for designing studies and evaluating new survival methods under known truth.
Get started
Install from the package repository or from the SSC archive. For new cross-ecosystem work, see its successor avalon (R + Stata, in development).
* the current build, from the package repository
net install survsim, from(https://raw.githubusercontent.com/RedDoorAnalytics/survsim/main/)
* or from the SSC archive
ssc install survsimThe repository carries the newer build. The SSC copy is updated less often than the repository, so where the two differ the repository is ahead. net install and ssc install put the same package on your adopath; if you have installed from one and want the other, ado uninstall survsim first.
The predecessor of avalon
Worked examples and tutorials for the family are in our Resources.
Try it in your browser: the survival DGM explorer — pick a data-generating mechanism and watch the hazard and survival update live before you simulate.
Citing survsim
Cite the 2022 survsim paper for the current package; the 2013 paper introduced the original simulation approach.
@article{crowther2022,
author = {Crowther, M. J.},
title = {{Simulating time-to-event data from parametric distributions, custom distributions, competing-risks models, and general multistate models}},
journal = {The Stata Journal: Promoting communications on statistics and Stata},
year = {2022},
volume = {22},
number = {1},
pages = {3--24},
doi = {10.1177/1536867x221083853}
}
RIS and the full library are on the publications page.
The original 2013 methods paper:
@article{crowther2013b,
author = {Crowther, M. J. and Lambert, P. C.},
title = {{Simulating biologically plausible complex survival data}},
journal = {Statistics in Medicine},
year = {2013},
volume = {32},
number = {23},
pages = {4118--4134},
doi = {10.1002/sim.5823}
}
RIS and the full library are on the publications page.