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-code

Installs 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
1Arman-Kudaibergenov avatarcf-editArman-Kudaibergenov/1c-ai-development-kitТочечное редактирование конфигурации 1С. Используй когда нужно изменить свойства конфигурации, добавить или удалить объект из состава, настроить роли по умолчан0skills.sh installs
2Arman-Kudaibergenov avatarcf-initArman-Kudaibergenov/1c-ai-development-kitСоздать пустую конфигурацию 1С (scaffold XML-исходников). Используй когда нужно начать новую конфигурацию с нуля0skills.sh installs
3Arman-Kudaibergenov avatardb-runArman-Kudaibergenov/1c-ai-development-kitЗапуск 1С:Предприятие. Используй когда пользователь просит запустить 1С, открыть базу, запустить предприятие0skills.sh installs
4Arman-Kudaibergenov avatarinspectArman-Kudaibergenov/1c-ai-development-kit>0skills.sh installs
5arpitg1304 avatarros1-developmentarpitg1304/robotics-agent-skills>0skills.sh installs
6awslabs avataramazon-location-serviceawslabs/agent-pluginsIntegrates Amazon Location Service APIs for AWS applications. Use this skill when users want to add maps (interactive MapLibre or static images); geocode addres0skills.sh installs