Sitemap
Classroom

Classroom by Alchemy Publications is a Medium publication focused on actionable knowledge sharing. Learn from real experiences in creativity, technology, and design on a new writing community where every story teaches something new.

Member-only story

Survival Analysis for Data Scientists

17 min readOct 26, 2026

--

Diogo Ribeiro is a mathematician, researcher and lecturer at the Faculdade de Media Artes e Design, Universidade Técnica do Porto.

Part 1 estimated one retention curve from a customer table in which half the customers had not churned yet. Most decisions involve two curves. A product team changes the onboarding flow and wants to know whether new customers stay longer; a pricing team offers a discount and wants to know whether it buys loyalty or only delays cancellations. The evidence comes from an experiment, and the experiment has to be read long before every customer in it has left.

This part adds three ideas. The first is the hazard, the churn rate among customers who are still there, with two ways to estimate it: the Nelson-Aalen estimator of the cumulative hazard and the churn rate per customer-month. The second is the log-rank test, which compares two groups using every customer for as long as they were observed. The third is a warning about the most common summary of such a comparison, the hazard ratio, which can change over time even when nothing about any customer does. The…

--

--

Diogo Ribeiro
Diogo Ribeiro

Written by Diogo Ribeiro

Diogo Ribeiro is a Lead Data Scientist, mathematician, professor and researcher at Faculdade de Media Artes e Design, Universidade Técnica do Porto.

Classroom
Classroom

Published in Classroom

Classroom by Alchemy Publications is a Medium publication focused on actionable knowledge sharing. Learn from real experiences in creativity, technology, and design on a new writing community where every story teaches something new.