Survival Analysis
Python survival analysis with Kaplan-Meier curves, log-rank tests, and Cox proportional hazards models on censored data.
- CCM score
- 40 of 100
- skills.sh installs
- 454
- GitHub stars
- 396
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers time-to-event workflows: Kaplan-Meier estimates, group comparisons, Cox regression, and survival prediction for new subjects
- Includes runnable
lifelinescode that simulates censored data and plots survival curves by group and risk quartile - Reports hazard ratios, concordance index, and a proportional hazards assumption test alongside model fits
- Designed for analysts who need survival probabilities at fixed horizons and a check on the Cox model's assumptions
Install
$ npx -y skills add aj-geddes/useful-ai-prompts --skill 'Survival Analysis' -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Survival Analysis
Overview
Survival analysis studies time until an event occurs, handling censored data where events haven't happened for some subjects, enabling prediction of lifetimes and risk assessment.
Key Concepts
- Survival Time: Time until event
- Censoring: Event not observed (subject dropped out)
- Hazard: Instantaneous risk at time t
- Survival Curve: Probability of surviving past time t
- Hazard Ratio: Relative risk between groups
Common Models
- Kaplan-Meier: Non-parametric survival curves
- Cox Proportional Hazards: Semi-parametric regression
- Weibull/Exponential: Parametric models
- Log-rank Test: Comparing survival curves
- Competing Risks: Multiple event types
Implementation with Python
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from lifelines import KaplanMeierFitter, CoxPHFitter, WeibullAFTFitter
from lifelines.statistics import logrank_test
import warnings
warnings.filterwarnings('ignore')
# Generate sample survival data
np.random.seed(42)
n_patients = 200
Details
- Repository
- github.com/aj-geddes/useful-ai-prompts
- Categories
- Data Science & Analytics, Research & Academic
- First seen
- Jun 3, 2026
Questions
What does the Survival Analysis skill do?
Survival Analysis analyzes time-to-event data, calculates survival probabilities, and compares groups using Kaplan-Meier and Cox proportional hazards models. It handles censored data, where the event was not observed for some subjects, and supports prediction of lifetimes and risk assessment.
How do I install the Survival Analysis skill?
Run npx -y skills add aj-geddes/useful-ai-prompts --skill 'Survival Analysis' -y in your project. Once installed, the Survival Analysis skill lets your agent fit Kaplan-Meier curves, run log-rank tests and fit Cox proportional hazards models.
Which models does the Survival Analysis skill cover?
The Survival Analysis skill covers Kaplan-Meier survival curves, Cox proportional hazards regression, Weibull and exponential parametric models, the log-rank test for comparing curves, and competing risks. Its Python examples use the lifelines library.
Which other skills sit in the same category as Survival Analysis?
Survival Analysis is listed in the Data Science and Analytics category on Claude Marketplaces, alongside azure-kusto, analyze-project, run-train, explore-run and add-analytics-instrumentation. This skill focuses on time-to-event modeling with Kaplan-Meier and Cox methods.
More from aj-geddes/useful-ai-prompts
All 258- Git Hooks Setup453
- Monorepo Management453
- Secrets Management453
- Api Filtering Sorting452
- Cloud Migration Planning452
- Cloud Storage Optimization452
- Configuration Management452
- Correlation Analysis452
- Design Handoff452
- Performance Regression Debugging452
- Alert Management450
- Cloud Cost Management450
- Network Security Groups450
- Troubleshooting Guide450
- Vue Application Structure450
- Azure App Service449
- Capacity Planning449
- Database Sharding449
- Feature Flag System448
- Infrastructure Cost Optimization448
- Container Registry Management447
- Third Party Integration445
- Continuous Testing444
- Disaster Recovery Testing443
Similar to Survival Analysis
More Data Science & Analyticsscikit-survivaldavila7/claude-code-templates329 installsComprehensive survival analysis toolkit for censored time-to-event data using scikit-survival in Python.
Cohort Analysisaj-geddes/useful-ai-prompts438 installsPython-based cohort analysis that builds retention matrices, churn rates, and revenue and LTV views by signup month.
Time Series Analysisaj-geddes/useful-ai-prompts620 installsWalk through time series decomposition, stationarity testing, ARIMA, and exponential smoothing forecasts in Python code.
tooluniverse-statistical-modelingmims-harvard/tooluniverse420 installsStatistical modeling skill for regression, nonparametric tests, survival, and clinical-trial adverse-event analysis on SDTM data.
pkpd-modelingK-Dense-AI/scientific-agent-skills1.1K installsPharmacokinetic and pharmacodynamic modelling toolkit covering NCA, compartmental and population PK, exposure-response, and dosing simulation.
statistical-powerK-Dense-AI/scientific-agent-skills1.7K installsPower analysis and sample-size planning for studies, with closed-form and simulation-based methods.