lifelines

Analyze right-censored time-to-event data with Kaplan-Meier curves and Cox regression.

19|2|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/tondevrel/scientific-agent-skills --skill lifelines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lifelines
Source: https://github.com/tondevrel/scientific-agent-skills/tree/main/skills/lifelines
Command: npx skills add https://github.com/tondevrel/scientific-agent-skills --skill lifelines

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies complex survival analysis, enabling users to accurately model time-to-event data, even with censored observations.

Core Features & Use Cases

  • Survival Analysis: Analyze time-to-event data common in clinical trials, epidemiology, and reliability engineering.
  • Censored Data Handling: Properly accounts for data where the event of interest has not yet occurred by the study's end.
  • Risk Factor Identification: Utilizes Cox Proportional Hazards models to identify factors influencing event occurrence.
  • Use Case: A medical researcher can use this Skill to analyze patient survival data, determine the median survival time, and identify if a new drug significantly impacts patient longevity compared to a placebo.

Quick Start

Use the lifelines skill to fit a Kaplan-Meier survival curve to the 'days' and 'died' columns in the dataframe.

Frequently Asked Questions about lifelines

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

FAQPage Schema
How do I perform survival analysis on right-censored time-to-event data?

Survival analysis on right-censored time-to-event data requires fitting a Kaplan-Meier curve to estimate survival probabilities over time. This Skill uses the lifelines Python library to handle censored observations where the event has not yet occurred by the study's end.

What is the best way to identify risk factors influencing patient survival time?

Identifying risk factors influencing patient survival time is best achieved using Cox Proportional Hazards models. This Skill leverages Cox regression to determine how specific variables impact event occurrence, making it essential for clinical trial analysis and epidemiological studies.

Can I use the lifelines library for reliability engineering and clinical trial analysis?

Yes, the lifelines library supports both reliability engineering and clinical trial analysis. It provides statistical modeling and visualization capabilities for time-to-event data, allowing you to estimate median survival times and compare treatment effects across different cohorts.

How do I fit a Kaplan-Meier survival curve to a dataframe with days and event columns?

Fitting a Kaplan-Meier survival curve to a dataframe with days and event columns involves passing the time and event observation columns to the estimator. This Skill processes the 'days' and 'died' columns to generate survival curves that properly account for censored data.

Why does survival analysis require special handling for censored observations?

Survival analysis requires special handling for censored observations because standard statistical methods cannot accurately model data where the event of interest has not occurred. Proper censored data handling ensures unbiased estimates of survival probabilities and hazard rates.