survival-analysis

Fit Kaplan-Meier, Cox, and AFT models to right-censored time-to-event data.

33|6|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/xjtulyc/awesome-rosetta-skills --skill survival-analysis-xjtulyc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: survival-analysis
Source: https://github.com/xjtulyc/awesome-rosetta-skills/tree/main/skills/03-mathematics/survival-analysis
Command: npx skills add https://github.com/xjtulyc/awesome-rosetta-skills --skill survival-analysis-xjtulyc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires lifelines, scikit-survival, pandas, matplotlib, numpy.

What problem does it solve?

This Skill helps you analyze time-to-event data by estimating survival functions, quantifying treatment or covariate effects, and handling censoring and competing risks in a principled statistical way.

Core Features & Use Cases

  • Kaplan-Meier and Log-Rank testing: Estimate survival curves for one or multiple groups and test differences between them (e.g., log-rank).
  • Cox Proportional Hazards + diagnostics: Fit hazard ratio models and check the proportional-hazards assumption using Schoenfeld residuals.
  • Competing risks and AFT modeling: Estimate cause-specific cumulative incidence (Aalen-Johansen / Fine-Gray approaches) and model accelerated failure time using parametric distributions; support time-varying covariates via long-format counting-process data.

Quick Start

Use the survival-analysis Skill to fit a Cox proportional hazards model from your dataset and produce hazard ratios plus a proportional-hazards assumption test.

Frequently Asked Questions about survival-analysis

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

FAQPage Schema
How do I estimate Kaplan-Meier survival curves and compare groups using a log-rank test?▼

The Skill fits Cox proportional hazards models using lifelines, calculating hazard ratios while validating the proportional-hazazard assumption using Schoenfeld residuals for right-censored data.

How does Cox proportional hazards modeling handle proportional-hazards assumption testing?▼

The Skill fits Cox proportional hazards models using lifelines, calculating hazard ratios while validating the proportional-hazard assumption using Schoenfeld residuals for right-censored data.

Can I model competing risks and cumulative incidence functions with right-censored data?▼

You can model competing risks by estimating cause-specific cumulative incidence functions using Aalen-Johansen or Fine-Gray approaches, applying these methods to right-censored clinical or reliability datasets via scikit-survival.

How do I include time-varying covariates in an accelerated failure time model?▼

You can include time-varying covariates by structuring your data in long-format counting-process form, allowing the Skill to fit accelerated failure time parametric models using lifelines and pandas.

Does lifelines work with pandas and matplotlib for survival analysis visualization?▼

Yes, the Skill uses lifelines with pandas for data handling, numpy for calculations, and matplotlib to support model fitting and generate survival curve or cumulative incidence function visualizations.