Red Door Analytics
Interactive tools

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.

Specify

Turn the decision into code you can run.

Deliver

Produce something you can put in a submission.

All 8 tools →

Software documentation

Docs and worked examples

Start here for hands-on material — installation, function reference, and runnable examples.

MERLIN

merlin for R

The R package: source, the function reference that ships with it, and the issue tracker. View on GitHub →

MERLIN

merlin for Stata

The Stata package: source, the issue tracker, and the development roadmap. View on GitHub →

SOFTWARE

Software hub

An overview of merlin, multistate, and survsim, and guidance on which to use. Browse the software →

Statistical primers

Concepts, explained

Short, plain-language explanations of the core ideas behind survival analysis and time-to-event methods.

PRIMERSurvival

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 →
PRIMERCensoring

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 →
PRIMERCox model

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 →
PRIMERAssumptions

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 →
PRIMERCompeting risks

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 →
PRIMERBias

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 →
PRIMERLandmarking

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 →
PRIMERCompeting risks

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 →
PRIMERHazard ratios

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 →
PRIMERNon-collapsibility

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 →
PRIMEREstimands

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 →
PRIMERMulti-state models

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 →
PRIMERReal-world evidence

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 →
Tutorials

Worked examples and methods notes

Reproducible worked examples on the methods we teach — survival, joint, multistate, competing-risks, and frailty modelling.

TUTORIALMultistate

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 →
TUTORIALSimulation

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 →
TUTORIALInterval censoring

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 →
TUTORIALRelative survival

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 →
TUTORIALFrailty

Flexible parametric survival analysis with frailty

Incorporating frailty (random intercepts) into flexible parametric survival models, fitted with Stata's merlin command.

Open resource →
TUTORIALCustom hazard

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 →
TUTORIALJoint models

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 →
TUTORIALJoint models

Multivariate joint longitudinal-survival models

Extending joint models to handle multiple continuous longitudinal outcomes modelled jointly with a survival outcome.

Open resource →
TUTORIALJoint models

Joint longitudinal-survival models with time-dependent effects

Modelling time-dependent (non-proportional hazards) effects within a joint longitudinal-survival framework.

Open resource →
TUTORIALCompeting risks

Joint longitudinal and competing risks models

Extending joint longitudinal-survival models to incorporate competing risks — simulation, estimation, and prediction.

Open resource →
TUTORIALRecurrent events

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 →
TUTORIALNon-linear effects

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 →
TUTORIALMeta-analysis

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 →
TUTORIALSensitivity analysis

Probabilistic sensitivity analysis and survival models

Implementing probabilistic sensitivity analysis in survival-analysis contexts — relevant for health-economic modelling.

Open resource →
TUTORIALMultistate

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 →
TUTORIALFirst model

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 →
TUTORIALCompeting risks

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 →

Need a worked example for your problem?

We keep reproducible code for most of the methods we teach. Tell us what you're modelling and we'll point you to the closest example — or build one.

Get in touch Start a project