Survival Analysis
This skill teaches statistical methods for analyzing when events occur, accounting for incomplete observations where some subjects haven't experienced the event yet. You'll learn Kaplan-Meier estimation for survival curves, Cox regression for modeling risk factors, and log-rank tests for comparing groups—with practical Python implementations using lifelines.
Survival Analysis lets you model time-to-event data with censoring using Kaplan-Meier curves and Cox proportional hazards regression.
AI-generated summary based on this skill's SKILL.md
Install
aj-geddes/useful-ai-prompts/survival-analysis · repository language: Shell
git clone https://github.com/aj-geddes/useful-ai-prompts
cp -r useful-ai-prompts/skills/survival-analysis ~/.claude/skills/survival-analysisFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What is Survival Analysis time to event modeling?
Survival Analysis is a statistical skill for analyzing when events occur while accounting for censoring—incomplete observations where some subjects haven't experienced the event yet. It teaches Kaplan-Meier estimation for survival curves, Cox regression for modeling risk factors, and log-rank tests for comparing groups, with practical Python implementations using lifelines. Applications span clinical trials, customer churn, and equipment reliability.
How do you build kaplan meier curves in Python?
Survival Analysis covers Kaplan-Meier curve construction using the lifelines package. You estimate survival probabilities at each event time, accounting for censored observations. The skill teaches how to plot these curves to visualize survival over time, compare multiple groups visually, and extract key statistics like median survival time and confidence intervals for clinical trials and reliability studies.
What does the cox proportional hazards model do?
Survival Analysis teaches Cox regression as a semi-parametric method to model how risk factors affect event timing. It estimates hazard ratios showing how covariates influence the instantaneous event rate, handles censored data naturally, and doesn't require assuming a specific survival distribution. The skill includes assessing proportional hazards assumptions and interpreting model diagnostics for valid inference.
How do you compare survival curves between treatment groups?
Survival Analysis covers log-rank tests for statistically comparing survival curves between groups. The skill teaches hypothesis testing to determine if treatment groups have significantly different survival experiences, calculates test statistics and p-values, and interprets results in context of clinical or business decisions. It also covers visualization techniques for presenting group comparisons clearly.
Can Survival Analysis predict outcomes for new patients?
Yes. Survival Analysis teaches survival probability estimation and risk stratification methods to predict outcomes for new patients or subjects. You learn to build predictive models using Cox regression or parametric approaches, generate personalized survival curves, and classify patients into risk groups. The skill enables clinical decision-making and resource allocation based on predicted survival probabilities.
What parametric models does Survival Analysis cover?
Survival Analysis teaches parametric survival models including Weibull and exponential distributions for reliability and churn prediction. These models assume a specific survival distribution, enabling extrapolation beyond observed data and direct probability calculations. The skill covers when to use parametric versus semi-parametric approaches, model fitting, and applications in equipment reliability and customer lifetime value analysis.
SKILL.md
rendered from the published skill — quoted content, verbatim
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
```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
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 3 files
skills/survival-analysis/SKILL.md
skills/survival-analysis/scripts/scaffold-analysis.sh
skills/survival-analysis/templates/notebook-template.py