The merlin family
A coherent family of survival-analysis packages sharing one engine — built, validated, and actively developed by the team that publishes the methods behind them. Open source, in R and Stata.
Most survival software is a patchwork of single-purpose packages, each with its own quirks. merlin takes the opposite approach: one engine fits the models, and a small, focused family builds directly on top of it.
Joint longitudinal–survival models, full Bayesian inference, multi-state and competing risks — all sharing the same syntax, the same prediction machinery, and the same validation. Learn the framework once and the rest follow, whether you work in R or Stata and whether you need frequentist or Bayesian estimates. For health technology assessment see merlin for HTA; for regulated use, Validated.
One engine, one syntax — simulate, fit, predict and validate the same way in R and Stata.
One engine, a family of tools
merlin is the engine. morgana adds full Bayesian inference (Stata v1 today; v2 and R in development), pendragon adds multi-state and competing risks (R and Stata, in development), avalon (the successor to survsim) simulates the data to test it all, and gawain validates the predictions that come out — of a merlin model or of anything else.
merlin
Multilevel mixed-effects survival regression — ten baseline families, cure models, relative-survival decomposition, and time-dependent effects, all under one formula syntax. It is the engine the rest of the family is built on: morgana gives its fits a posterior, pendragon assembles them into state spaces, avalon generates the known-truth data they are tested against, and gawain checks the predictions that come out. The frequentist engine, in R and Stata.
Explore merlin →morgana
Full Bayesian inference over the merlin engine — every merlin model with posterior uncertainty, built for HTA extrapolation. The Stata package is available now (a bayesmh prefix to stmerlin); the R implementation, sampling via the No-U-Turn Sampler, is in development.
pendragon
Multi-state and competing-risks models on top of merlin and morgana — transition probabilities, length of stay, restricted mean time in state, and the health-economic outputs, with frequentist or Bayesian bands. The successor to multistate, in R and Stata · in development.
Explore pendragon →avalon
Flexible simulation of survival data — standard, flexible parametric, and user-defined hazards, with competing risks and multi-state structures. The methods-evaluation workhorse, succeeding survsim under one name in R and Stata · in development.
Explore avalon →gawain
Does a survival prediction model discriminate, is it calibrated, and is it useful? Twelve statistics covering all three, for single-event, competing-risks and multi-state outcomes — taking predictions as data, so it evaluates a model fitted in any software. R and Stata · in development.
Explore gawain →The same methods, in both ecosystems
Both ecosystems are actively developed and supported — pick the one your workflow lives in.
multistate (Stata) is pendragon's mature predecessor, and survsim (Stata) is avalon's — both stay available while their successors reach parity. avalon brings survsim's simulation scope to R as well as Stata, so the same API and behaviour are available in both.
Specialist commands and the full catalogue
Alongside the family, the team builds focused survival commands for specific problems — accelerated failure-time, restricted-cubic-spline, mixed-effects, and excess-hazard models in Stata; multi-state visualisation, trial simulation, and standardised contrasts in R — plus multistate, pendragon's still-maintained predecessor, and the reproducible code behind the papers. They all live, with docs and papers, in one place.
Browse the full open-source index — every package, in R and Stata →