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?

A plain-language primer on survival analysis — the statistical methods used to analyse the time until an event of interest occurs.

Open resource →
PRIMERCensoring

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

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

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

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

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

What is landmark analysis?

A way of comparing groups defined by something that happens after baseline, without giving one group a period in which it could not have the outcome.

Open resource →
PRIMERCompeting risks

Why you cannot censor a competing event

Censoring assumes the patient could still have had your event. When they died of something else, they could not — and one minus the Kaplan–Meier stops meaning what you want it to mean.

Open resource →
PRIMERHazard ratios

What a hazard ratio means when hazards are not proportional

It still estimates something. It just is not what most people assume, and it depends on how long the trial happened to follow people.

Open resource →
PRIMERNon-collapsibility

What is non-collapsibility?

Adjusting for a covariate that predicts the outcome changes a hazard ratio even when that covariate is not a confounder. This is not bias — it is a property of the measure.

Open resource →
PRIMEREstimands

RMST or a hazard ratio?

Restricted mean survival time answers in units of time, needs no proportional-hazards assumption, and is collapsible. It also makes you name a horizon.

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

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

Relative survival analysis

Relative survival models, used predominantly in population-based cancer epidemiology to quantify excess mortality against a matched reference population.

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 introductory guide to joint models linking repeatedly measured outcomes with time-to-event data through shared random effects, or functions of them.

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