Tutorials and worked examples
From package documentation and runnable vignettes to plain-language primers and recorded tutorials — a growing library covering the methods we develop, teach, and consult on, grouped by type so you can go straight to what you need.
Every resource links to the full write-up with reproducible code, most in parallel R and Stata. Terms you do not recognise link to the glossary wherever they appear.
Eight tools, four jobs
Free, fully client-side tools that run in your browser and export to R and Stata. They divide by what you need to do — the full index gives each one a card.
Understand
Move something and watch what it does.
Plan
Work out what the study needs, before you have data.
Deliver
Produce something you can put in a submission.
Docs and worked examples
Start here for hands-on material — installation, function reference, and runnable examples.
merlin for R
The R package: source, the function reference that ships with it, and the issue tracker. View on GitHub →
merlin for Stata
The Stata package: source, the issue tracker, and the development roadmap. View on GitHub →
Software hub
An overview of merlin, multistate, and survsim, and guidance on which to use. Browse the software →
Our areas of expertise
The areas we specialise in — from clinical-trial biostatistics and methods development to haematology and real-world evidence.
Clinical Trial Services
Biostatistics as the cornerstone of clinical trial design, execution, and interpretation — ensuring studies are scientifically sound and appropriately powered for regulatory approval.
Open resource →Methods Development
Guidance on selecting appropriate statistical approaches, and the development of novel methodology when existing techniques fall short for a specific research problem.
Open resource →Applied Biostatistics
Biostatistics expertise across clinical trials, epidemiological studies, and pre-clinical research, with a specialism in survival analysis and multi-state modelling.
Open resource →Haematology
Extensive experience with haematological malignancies — demonstrated across 18 publications spanning epidemiological and clinical-trial work with Nordic registry data.
Open resource →Real-World Evidence (RWE)
How real-world evidence — data from everyday clinical practice, patient registers, and other sources outside the trial setting — complements clinical-trial data.
Open resource →Concepts, explained
Short, plain-language explanations of the core ideas behind survival analysis and time-to-event methods.
What is survival analysis?
A plain-language primer on survival analysis — the statistical methods used to analyse the time until an event of interest occurs.
Open resource →What is censoring?
Why the event of interest is not observed for some individuals under study, and what that means for time-to-event analysis.
Open resource →What is the Cox model?
An introduction to the Cox proportional hazards model, the most widely used statistical tool for analysing survival data.
Open resource →What is the proportional hazards assumption?
What it means for the event rate of two or more groups to stay proportional over time — and why the assumption matters.
Open resource →What are competing risks?
When an individual is at risk of an event that precludes the event under study — common in cause-specific mortality analyses.
Open resource →What is immortal time bias?
A type of bias in observational research where the study design allows a period during which the outcome of interest cannot occur.
Open resource →Worked examples and methods notes
Reproducible worked examples on the methods we teach — survival, joint, multistate, competing-risks, and frailty modelling.
multistate v4.4.0: semi-parametric multi-state modelling
predictms now supports the Cox model as a transition model via merlin or stmerlin, with predictions from a multi-state Cox model implemented through a simulation approach.
Open resource →Simulating survival data with a continuous time-varying covariate…the right way
How to simulate survival data with a continuous, time-varying covariate for evaluating joint longitudinal-survival models, using the survsim and merlin commands.
Open resource →Survival analysis with interval censoring
Handling time-to-event data where only the interval containing the event is known — as in ophthalmology and dentistry, where events are detected at scheduled appointments.
Open resource →Relative survival analysis
Relative survival models, used predominantly in population-based cancer epidemiology to quantify excess mortality against a matched reference population.
Open resource →Flexible parametric survival analysis with frailty
Incorporating frailty (random intercepts) into flexible parametric survival models using Stata's merlin command and the stmixed wrapper.
Open resource →A user-defined / custom hazard model
Showcasing merlin's capability to fit survival models with a general user-specified hazard function via numerical integration.
Open resource →An introduction to joint modelling of longitudinal and survival data
An introductory guide to joint models linking repeatedly measured outcomes with time-to-event data through shared random effects, or functions of them.
Open resource →Multivariate joint longitudinal-survival models
Extending joint models to handle multiple continuous longitudinal outcomes modelled jointly with a survival outcome.
Open resource →Joint longitudinal-survival models with time-dependent effects
Modelling time-dependent (non-proportional hazards) effects within a joint longitudinal-survival framework.
Open resource →Joint longitudinal and competing risks models
Extending joint longitudinal-survival models to incorporate competing risks — simulation, estimation, and prediction.
Open resource →Joint frailty models for recurrent and terminal events
Joint frailty models for analysing recurrent events alongside a terminal event, with interpretation guidance using merlin.
Open resource →Simulation, modelling and prediction with a non-linear covariate effect
Simulating, fitting, and predicting survival outcomes when a covariate has a non-linear effect on survival.
Open resource →Three-level survival models: IPD meta-analysis of recurrent events
Simulation and estimation of three-level survival models for clustered, recurrent-event data in an individual patient data meta-analysis.
Open resource →Probabilistic sensitivity analysis and survival models
Implementing probabilistic sensitivity analysis in survival-analysis contexts — relevant for health-economic modelling.
Open resource →Defining a transition matrix for multi-state modelling
Building custom transition matrices for the multistate package, which govern how a process moves between its possible states.
Open resource →Fitting your first model in merlin
The same Weibull model fitted twice, in streg and in merlin, so you can see which parts of the output are identical, which are only presented differently, and why the two log-likelihoods are not the same number.
Open resource →Competing risks in merlin
Two cause-specific models in one command — the second set of brackets — and the arithmetic that shows they are the same two models you would have fitted separately.
Open resource →Watch and learn
Recorded talks and lectures introducing study designs, HTA modelling, and multilevel survival analysis.
Introduction to Epidemiological Study Designs
A video introduction to epidemiological study designs — their classification, key definitions, strengths, limitations, and practical applications, with real-world case studies.
Open resource →State-of-the-art statistical models for modern HTA
Advanced methods for health technology assessment — biomarker modelling measured repeatedly over time alongside survival, and general non-Markov multi-state survival analysis.
Open resource →Multilevel (hierarchical) survival models
Estimating, predicting, and interpreting hierarchical time-to-event data where individuals are nested within organisational units such as hospitals or regions.
Open resource →