Kaplan-Meier Survival Curves in dbt
David Gasquez
February 14, 2022
Inspired by Convoys, I've tried to model conversion rates in SQL.
The following macro computes the Kaplan-Meier survival curves and conversion rates given two timestamps and the groups. You can then generate these tables at runtime and plot them in your favorite BI tool.
The usage then is as simple as:
I'm sure this can be improved and simplified. For now, is good enough and it works! If you're looking for an alternative in Looker, the folks at Montreal Analytitcs have you covered: How to Leverage Product Survival Curves in Looker.
Discussion in the ATmosphere