0/70 completed
Statistical Models Interactive

Survival Analysis

Model time-to-event data. How long until a customer churns? When will an injured player return? Handle censored observations properly.

๐Ÿ“Š Key Concepts

Survival Function S(t)

P(T > t)

Probability of surviving past time t

Hazard Function h(t)

P(event at t | survived to t)

Instantaneous risk of event

Censoring

Event hasn't happened yetโ€”but we know they survived at least this long

Parameters

Base Hazard Rate 0.05
0.01 0.15
Treatment HR 0.6
0.3 1
Censoring Rate (%) 20
0 50

๐Ÿ“Š Results

Hazard Ratio 0.60
40% lower risk
12-mo Survival (Control) 54%
12-mo Survival (Treatment) 69%
Median (Control) 14 mo
Median (Treatment) 23 mo

Kaplan-Meier Survival Curves

Control group (no intervention)
Treatment group (with intervention)

Cox Proportional Hazards

The Model

h(t|X) = hโ‚€(t) ร— exp(ฮฒX)

Hazard depends on baseline and covariates

Interpretation

HR = exp(ฮฒ)

  • โ€ข HR < 1: Treatment reduces risk
  • โ€ข HR = 1: No effect
  • โ€ข HR > 1: Treatment increases risk

๐ŸŽฐ Betting Applications

Churn

Time until customer stops betting

Metric: Retention rate

First Deposit

Time from signup to first bet

Metric: Conversion time

VIP Upgrade

Time until tier promotion

Metric: Upgrade rate

Injury Recovery

Time until player returns

Metric: Games missed

R Code Equivalent

# Survival analysis
library(survival)
library(survminer)

# Create survival object
surv_obj <- Surv(time = df$time, event = df$churned)

# Kaplan-Meier curves
km_fit <- survfit(surv_obj ~ treatment, data = df)
ggsurvplot(km_fit, data = df, 
           pval = TRUE, 
           risk.table = TRUE)

# Cox proportional hazards model
cox_model <- coxph(surv_obj ~ treatment + age + deposit_amount, data = df)
summary(cox_model)

# Hazard ratios
exp(coef(cox_model))

# Check proportional hazards assumption
cox.zph(cox_model)

โœ… Key Takeaways

  • โ€ข Survival analysis models time-to-event
  • โ€ข Handles censoring (incomplete observation)
  • โ€ข Kaplan-Meier for curves, Cox for covariates
  • โ€ข Hazard Ratio = relative risk
  • โ€ข Use for churn, conversion, injury recovery
  • โ€ข Check proportional hazards assumption

Pricing Models & Frameworks Tutorial

Built for mastery ยท Interactive learning