survival analysischurn predictionkaplan-meiercox regressionsaas metrics

Survival Analysis for SaaS Churn: Kaplan-Meier and Cox Models, Explained

Cohort curves and health scores both throw away your newest customers. Here's how Kaplan-Meier and Cox proportional hazards actually fix that, with real numbers.

XY
17 November 2026 · 9 min read

Every churn dashboard has the same blind spot: it can't see the future of its own newest customers. A subscriber who signed up eleven days ago hasn't churned — but they also haven't proven they won't. Drop them from your churn math and you've thrown away real information. Count them as "retained" and you've quietly assumed something you can't know yet. Most SaaS analytics just picks one of those two wrong answers and moves on. Survival analysis is the field of statistics built specifically to avoid making that choice.

Key stat
42.7% vs 2.8%
Churn rate for month-to-month vs. two-year contract customers in IBM's public Telco Customer Churn dataset — a 15x gap a single blended churn number can never show you
Source: IBM Telco Customer Churn dataset (7,043 customers), widely replicated in independent analyses

The problem a blended churn rate and even a cohort curve can't fully solve

Our cohort retention curve guide already covers why a single trailing churn percentage hides the shape of your retention problem — a curve that flattens early looks nothing like one that bleeds steadily forever, even if both average out to the same monthly number. A cohort curve is, in fact, a crude form of survival analysis: at each month offset, it's counting what fraction of the original group is "still alive." But most teams build it the simple way — percentage still active at month N, full stop — and that simple version has a quiet flaw: it can only use customers who've actually reached month N. A customer who joined three weeks ago contributes nothing to your month-6 or month-12 curve, even though their early behavior might be exactly the signal you need.

Survival analysis keeps that customer in the dataset. It just records them honestly: known to have survived at least 21 days, true churn date unknown. That single idea — using partial information instead of discarding it or faking it — is the entire reason the field exists, and it's what separates a proper survival model from a cohort curve built in a spreadsheet.

The Kaplan-Meier estimator, without the notation

The Kaplan-Meier estimator is the workhorse tool for building a retention curve that correctly accounts for censoring. Mechanically, it works like this: start at 100% survival on day zero. At every day (or week, or month) where at least one customer churns, multiply the running survival estimate by the fraction of at-risk customers who made it through that period. "At risk" means everyone who was still active going into that period — including customers who'll later get censored, since they were still at risk right up until the point your data runs out on them.

The output is a step function: a line that drops a little every time a churn event happens, and never moves on days when nobody churns. Plot it and you get something that looks a lot like the cohort curves from our earlier guide — but every point on a Kaplan-Meier curve is a maximum-likelihood estimate that used every customer's data up to the moment they either churned or dropped out of observation, not just the customers old enough to have a full, completed tenure.

MethodWhat it answersWhat it needsWhere it breaks
Blended churn rate"How many left this month?"Count of cancellations, total activeHides whether loss is front-loaded or constant
Cohort retention curve"What shape does retention take over time?"Signup month, active/canceled status per offsetUsually drops still-young customers from later points
Kaplan-Meier curve"What's the true survival curve, using every customer?"Duration + event flag per customer, including censored onesOne curve per group — can't isolate a single variable's effect
Cox proportional hazards"How much does each factor change churn risk, holding others constant?"Duration, event flag, and covariates per customerAssumes hazard ratios stay constant over time — needs checking
Weighted health score"Is this specific account at risk right now?"Hand-picked leading indicators and manual weightsWeights are guessed, not estimated from outcomes

Our churn health score guide covers that bottom row in depth — most health scores fail because their weights are hand-tuned guesses rather than numbers estimated from what actually happened to past customers. A Cox model fixes that specific failure mode: the weights aren't guessed, they're fit against your real churn history.

Hazard rate: the piece that makes Cox regression possible

The hazard rate at a given tenure is the instantaneous risk of churning right now, given that a customer has survived this long. It's a conditional, moment-by-moment version of churn risk, not a cumulative one — a 24-month-old account with a low hazard rate isn't "unlikely to ever churn," it's "unlikely to churn in the next instant, conditional on having made it to month 24." Hazard rates typically aren't flat over tenure. Early-lifecycle hazard tends to be high (the customers who were never going to activate wash out fast — the exact mechanism behind the steep early drop we cover in our early-lifecycle churn guide), then settles lower once a customer has built real workflow dependence, then sometimes ticks back up again around annual renewal dates.

Cox proportional hazards: adding covariates

Kaplan-Meier gives you one curve per group you define manually — split by plan tier, say, and you get two curves to eyeball side by side. Cox proportional hazards regression does something more useful: it estimates a hazard ratio for every covariate you include, simultaneously, controlling for the others. A hazard ratio of 0.4 on "annual billing" means annual customers churn at 40% of the rate of the reference group, all else held equal. A hazard ratio of 2.1 on "no payment method on file after trial" means that group churns at a bit over twice the baseline rate.

This is where contract length earns its place as the textbook example. It's the single most consistently documented covariate in published churn studies, and the IBM Telco dataset — a public, 7,043-row dataset that's become a standard benchmark for exactly this kind of analysis — shows why.

Churn rate by contract length
Month-to-month42.7%
One-year contract11.3%
Two-year contract2.8%

Source: IBM Telco Customer Churn dataset. Overall churn across the full 7,043-customer sample is 26.5%.

That gap is exactly what we touched on from the billing-cadence side in our annual vs monthly billing piece — longer commitment terms remove opportunities to leave, independent of whether the product itself got better or worse. A Cox model turns that observation into a number you can act on: fit it against your own subscriber base and you get a hazard ratio for contract length specifically, net of plan tier, acquisition channel, or whatever else you include, instead of a rough directional hunch.

The assumption you have to check, not just trust

"Proportional hazards" means the model assumes a covariate's effect on risk stays constant over the whole observation period — if annual billing cuts hazard in half at month 2, the model assumes it still cuts hazard in half at month 20. That assumption is often approximately true and sometimes badly wrong. A payment-method covariate, for instance, might matter enormously in the first billing cycle (a card that fails immediately) and barely at all a year in (by then, most bad cards have already been caught by dunning). Fit a Cox model without checking this and you can get a hazard ratio that's technically correct on average but misleading about when in the lifecycle the effect actually bites. The standard fix is to test the assumption directly — Python's lifelines has a built-in check_assumptions call — and to stratify the model on any covariate that clearly violates it, which keeps that variable's effect from being forced into a constant-ratio shape it doesn't actually have.

Building it against your own Stripe data

You don't need a new data warehouse to get a first version running. The inputs are three columns per subscription:

  • Duration — days (or months) from subscription.created to either canceled_at or today, whichever applies.
  • Event flag — 1 if the subscription has a canceled_at timestamp, 0 if it's still active. The 0 rows are your censored observations, and they belong in the dataset, not out of it.
  • Covariates — whatever you want hazard ratios for: billing interval, plan tier, payment method type, acquisition channel, company size if you capture it, whether a card failed in the first 30 days.

Pull that into a dataframe, feed it to lifelines.KaplanMeierFitter for the overall curve and lifelines.CoxPHFitter for the covariate hazard ratios, and you have both outputs: a true survival curve that doesn't misrepresent your newest signups, and a ranked list of which factors actually move churn risk once you control for the others. That second output is the part worth sitting with — it's common for a factor that looks important in a simple group-by (say, acquisition channel) to shrink toward a hazard ratio near 1.0 once you control for plan tier, because the real driver was which channel tends to bring in which plan, not the channel itself.

Where this actually earns its keep

The output of a Cox model isn't a replacement for a cancellation flow — it's upstream of one. A hazard ratio tells you which segment to watch, not which individual account is about to leave this week; for that you still want a scored, per-account system like the one in our health score guide, ideally with weights informed by the hazard ratios you just estimated instead of guessed from a whiteboard session. And none of this changes what happens at the moment someone actually clicks cancel — a subscriber flagged as high-hazard by contract type or payment method still needs the right retention offer shown at the right moment, which is the problem CancelFlow is built to handle. What survival analysis gives you is the ability to say, with actual statistical grounding, which of your segments deserves that attention before the cancel page ever loads — instead of waiting for a cohort to finish aging before you're allowed to notice the pattern.

Frequently asked questions

What is survival analysis in the context of SaaS churn?+

Survival analysis is a set of statistical methods, originally built for medical studies of time-to-death, that model how long an event takes to happen and whether it happens at all. Applied to SaaS, the "event" is cancellation and the "time" is subscription tenure. Its defining strength over a simple churn rate is that it correctly handles customers who haven't churned yet — it doesn't need to pretend they're either "retained forever" or exclude them from the dataset.

What is censoring and why does it matter for churn models?+

A customer is "censored" when your observation window ends before they churn — they're still active on the day you pull the data, so you don't know their eventual tenure. A naive churn rate either drops censored customers (which biases the sample toward people who churned fast) or counts them as full successes (which overstates retention, since some of them will churn tomorrow). Survival methods use the partial information censored customers do provide — "still alive through at least day N" — without guessing at what you don't know.

What's the difference between Kaplan-Meier and Cox proportional hazards?+

Kaplan-Meier produces a single retention curve for a group — it tells you the overall shape of survival over time, correctly accounting for censoring, but it can't isolate the effect of any one variable. Cox proportional hazards is a regression model: it estimates a hazard ratio for each covariate you feed it (plan tier, payment method, contract length, company size) while holding the others constant, so you can say "annual contracts cut churn hazard by X%, controlling for everything else in the model" instead of just describing the curve.

Do I need R to do this, or can I use Stripe data directly in Python?+

Python's lifelines library (or R's survival package) both work directly against a flat table you can build from the Stripe API: one row per subscription, a duration column, an event column (1 if canceled, 0 if still active), and whatever covariates you want to test. You don't need a data science team to get a first Kaplan-Meier curve running — the harder part is usually assembling clean duration and covariate columns from Stripe's subscription and invoice objects, not the modeling itself.

Try CancelFlow

Stop losing subscribers today

One script tag. One function call. A live cancellation flow in under 10 minutes.

Start free trial →
← All postsHome