ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified data analysis Safety 4/5

survival-analysis-km

Generates Kaplan-Meier survival curves, calculates survival statistics (log-rank test, median survival time), and estimates hazard ratios for clinical and biological survival data analysis. Triggered when user requests survival analysis, Kaplan-Meier plots, time-to-event analysis, or asks about survival statistics in biomedical contexts.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/aipoch-ai/survival-analysis-km
Or

What This Skill Does

The survival-analysis-km skill is a sophisticated computational tool designed for biomedical and clinical researchers. It automates the generation of Kaplan-Meier survival curves, which are the gold standard for visualizing time-to-event data in clinical trials or observational studies. Beyond simple visualization, this skill performs rigorous statistical testing, including the log-rank test for group comparison and the Wilcoxon test to determine if significant differences exist between survival distributions. It also incorporates Cox proportional hazards regression to calculate hazard ratios, allowing researchers to quantify the effect of specific covariates on the survival outcome. The skill generates publication-quality visual assets, including both raster (.png) and vector (.pdf) outputs, alongside comprehensive CSV data tables for further downstream analysis or manuscript submission.

Installation

To integrate this skill into your environment, use the OpenClaw command-line interface. Ensure you have the necessary system dependencies installed for the lifelines, matplotlib, and pandas libraries. Run the following command:

clawhub install openclaw/skills/skills/aipoch-ai/survival-analysis-km

Use Cases

This skill is highly effective for medical research scenarios where time-to-event data is critical. Typical use cases include:

  • Comparing the efficacy of two different drug treatments in a clinical trial.
  • Analyzing patient mortality rates based on genetic biomarkers or stratification factors.
  • Assessing the impact of lifestyle interventions on disease progression over time.
  • Investigating 'time to failure' in biological systems where events are right-censored.

Example Prompts

  1. "Generate a Kaplan-Meier plot for the dataset at ./data/patient_survival.csv, using 'treatment' as the group and comparing survival times, then provide the log-rank p-values."
  2. "Perform a survival analysis on my study data. I have columns named 'days_to_death' and 'event_observed'. Please include a risk table and calculate hazard ratios."
  3. "Analyze the effect of chemotherapy versus placebo on survival. Save the output to the ./results directory as both PNG and PDF."

Tips & Limitations

  • Data Integrity: Ensure your event column is strictly binary (1 for event, 0 for censored). Incorrect coding of the event column is the most common cause of calculation errors.
  • Assumptions: The Cox proportional hazards model assumes that hazard ratios are constant over time. Always check the model residuals if your study duration is long.
  • Visualization: When dealing with more than four groups, the survival curves may become crowded. Use the --risk-table flag cautiously to maintain plot readability.
  • Missing Data: This skill requires complete cases for the survival time and event columns; ensure your CSV is cleaned using pandas prior to running the analysis to avoid dropping rows.

Metadata

Author@aipoch-ai
Stars4473
Views1
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-aipoch-ai-survival-analysis-km": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#survival-analysis#biostatistics#data-science#clinical-research#kaplan-meier
Safety Score: 4/5

Flags: file-read, file-write, code-execution