Survival analysis studies the time until an event: a customer cancelling, a machine failing, a lead converting, an employee leaving.
The Censoring Problem
At any moment, many customers haven't churned yet. Ignoring them, or treating them as never churning, biases results. Survival methods handle these censored observations correctly.
The Survival Curve
The Kaplan–Meier estimator shows the share of customers still active at each point in time since they started. It's a clear way to compare groups — customers acquired through different channels, or on different plans.
The Hazard
The hazard is the rate of the event at a given time among those still at risk. It shows when risk is highest: for example, churn risk may peak just after the first renewal.
Modelling With Covariates
The Cox proportional hazards model estimates how factors (plan type, usage, support contacts) affect the hazard, while handling censoring. Check the proportional-hazards assumption; alternatives exist when it fails.
Business Uses
- Customer lifetime and retention analysis.
- Time to repeat purchase.
- Equipment reliability and warranty planning.
- Time to hire or time to resolution.
Tools
The lifelines library in Python and the survival package in R.
from lifelines import KaplanMeierFitter
kmf = KaplanMeierFitter().fit(durations=df["days_active"], event_observed=df["churned"])
kmf.plot_survival_function()