retention-analysis

Diagnose churn risk and retention gaps in subscription data.

264|45|Updated Dec 24, 2025
One-click install
npx skills add https://github.com/liangdabiao/claude-data-analysis-ultra-main --skill retention-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: retention-analysis
Source: https://github.com/liangdabiao/claude-data-analysis-ultra-main/tree/main/.claude/skills/retention-analysis
Command: npx skills add https://github.com/liangdabiao/claude-data-analysis-ultra-main --skill retention-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, numpy, lifelines, matplotlib, seaborn, scikit-learn, and includes scripts (resource) components.

What problem does it solve?

This Skill provides comprehensive retention analysis using survival and cohort analysis, churn prediction, and customer lifetime value modeling to help SaaS, membership programs, and e-commerce sustain long-term engagement.

Core Features & Use Cases

  • Survival Analysis: Kaplan-Meier curves, Cox regression, and median survival time.
  • Cohort Analysis: Cohort-based retention matrices and heatmaps.
  • Churn Prediction: ML models and risk scoring for at-risk users.
  • LTV & ROI: Customer lifetime value modeling and ROI insights.

Quick Start

Load retention data, fit Kaplan-Meier curves, perform cohort analysis, and build churn models. Quick steps:

  • Prepare user-activity data with timestamps and churn indicators
  • Compute retention and survival metrics
  • Train a churn prediction model and generate actionable recommendations

Frequently Asked Questions about retention-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze customer churn and retention in subscription data?

Churn analysis uses survival analysis techniques like Kaplan-Meier curves and Cox regression to quantify customer lifetime and identify retention patterns. Load timestamped user-activity data with churn indicators, compute survival metrics, and generate retention curves to spot at-risk cohorts and optimize engagement strategies.

What's the best way to predict which customers are likely to churn?

Churn prediction combines cohort analysis, feature engineering from user activity, and machine learning models (scikit-learn) to score churn risk. Train on historical data, identify high-risk segments, and generate actionable recommendations for intervention before customers leave.

How do I calculate customer lifetime value and ROI from retention data?

LTV modeling integrates survival curves with revenue data to estimate long-term customer value and ROI. Combine Kaplan-Meier survival estimates with cohort-based retention matrices to quantify the financial impact of retention improvements across user segments.

Can I use survival analysis and cohort analysis together for retention insights?

Yes. Cohort analysis segments users by signup date and tracks retention rates over time in heatmaps, while survival analysis (Kaplan-Meier, Cox regression) models time-to-churn. Used together, they reveal both short-term retention trends and long-term survival patterns across customer groups.

Does this work for SaaS, e-commerce, gaming, and membership programs?

Retention analysis applies to any subscription or engagement-driven business. The methodology—survival modeling, cohort analysis, churn prediction—generalizes across SaaS, membership programs, e-commerce, and gaming apps using standard event-based data with timestamps and churn indicators.

What data format and preparation do I need before running retention models?

Prepare user-activity data with columns for user ID, event timestamps, and a churn indicator (binary flag or last-activity date). pandas handles data cleaning and aggregation; numpy and matplotlib support computation and visualization. Survival analysis requires event times and status flags for Kaplan-Meier and Cox fitting.