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 →Concepts, explained
Short, plain-language explanations of the core ideas behind survival analysis and time-to-event methods.
What is survival analysis?
What survival analysis is, why censoring needs its own methods, the survival and hazard functions, a worked Kaplan–Meier example, main methods and pitfalls.
Open resource →What is censoring?
What censoring means in survival analysis: right, left and interval censoring, independent censoring, and how Kaplan–Meier and other methods handle it.
Open resource →What is the Cox model?
What the Cox proportional hazards model estimates, how to read a hazard ratio, how it is fitted, its assumptions, and when a parametric model is better.
Open resource →What is the proportional hazards assumption?
What the proportional hazards assumption means, how to check it with log–log plots and Schoenfeld residuals, what to do when it fails, and what to report.
Open resource →What are competing risks?
What competing risks are, why one minus Kaplan–Meier overstates the risk, cause-specific hazards versus cumulative incidence, the methods, and what to report.
Open resource →What is immortal time bias?
What immortal time bias is, how it gets into an analysis, classic examples, and how to avoid it: align time zero, use time-varying exposure or a landmark.
Open resource →What is landmark analysis?
How landmark analysis avoids immortal time bias, how to choose the landmark, what it costs, its use for dynamic prediction, and what to report.
Open resource →Censoring a competing event: right for the hazard, wrong for the risk
Why censoring a competing event is right for the cause-specific hazard but overstates the risk, with a worked example, the Fine–Gray model and what to report.
Open resource →What a hazard ratio means when hazards are not proportional
What a Cox hazard ratio estimates when the effect changes over time, why it depends on follow-up, and what to report with it or instead.
Open resource →What is non-collapsibility?
Why adjusting for a prognostic factor changes an odds ratio or hazard ratio without confounding, which measures are collapsible, and what to report instead.
Open resource →RMST or a hazard ratio?
What restricted mean survival time is, how to estimate it and choose the horizon, how it compares with a hazard ratio and the median, and what to report.
Open resource →What is a multi-state model?
What a multi-state model is: transition hazards, the illness–death model, state probabilities, length of stay, clock forward or reset, and the data set-up.
Open resource →What is real-world evidence?
What real-world data and evidence are, where the data come from, what RWE is used for, the main biases, and what makes a study credible.
Open resource →Worked examples and methods notes
Reproducible worked examples on the methods we teach — survival, joint, multistate, competing-risks, and frailty modelling.
Semi-parametric multi-state modelling
Multi-state models with a Cox model for every transition: fitted with merlin, and turned into exact transition probabilities, length of stay and contrasts with pendragon.
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 avalon and merlin commands.
Open resource →Survival analysis with interval censoring
Interval censoring in survival analysis: how to analyse events that are only detected at visits, with a worked example and code.
Open resource →Relative survival analysis
What relative survival measures, how excess mortality is estimated against general-population life tables, and a worked analysis with code.
Open resource →Flexible parametric survival analysis with frailty
Incorporating frailty (random intercepts) into flexible parametric survival models, fitted with Stata's merlin command.
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 introduction to joint models: when you need one, and how shared random effects link a repeatedly measured biomarker to survival, with worked code.
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, which govern how a process moves between its possible states, for pendragon.
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 →