
Survival Analysis
A solid primer on survival analysis that covers the essentials: censored data, hazard functions, survival curves, and the standard models you'd actually use. It's structured as a reference for when you're working with time-to-event data and need to quickly recall what a hazard ratio means or which model fits your problem. The skill breaks down key concepts cleanly, though it looks like the common models section got cut off in the preview. This is one of those statistical techniques that shows up more often than you'd think, especially in healthcare, reliability engineering, and customer churn analysis. Good to have on hand if you're not a biostatistician but occasionally need to work with survival data.
- GitHub stars
- 317
- last updated
- Aug 21, 2026
Install
$ npx -y skills add aj-geddes/useful-ai-prompts --skill 'Survival Analysis' --agent claude-codeInstalls into .claude/skills of the current project.
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
Sponsors
Details
- Repository
- github.com/aj-geddes/useful-ai-prompts
- Category
- AI & Agent Building
- First seen
- Jun 3, 2026
More from aj-geddes/useful-ai-prompts
All 258- Time Series Analysis
- Nodejs Express Server3.3K
- Code Review Analysis2.4K
- Jenkins Pipeline2.2K
- Rest Api Design2.1K
- Architecture Diagrams2K
- Ansible Automation1.9K
- Ios Swift Development1.5K
- Nginx Configuration1.5K
- Android Kotlin Development1.5K
- Flask Api Development1.4K
- Wireframe Prototyping1.4K
- Markdown Documentation1.3K
- Terraform Infrastructure1.2K
- Responsive Web Design1.1K
- Penetration Testing1.1K
- Css Architecture969
- Api Contract Testing926
- Root Cause Analysis916
- Event Sourcing892
- Mobile First Design869
- Api Security Hardening868
- Mobile App Testing831
- Technical Specification811