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.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/aipoch-ai/survival-analysis-kmWhat 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
- "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."
- "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."
- "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
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 skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-aipoch-ai-survival-analysis-km": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-read, file-write, code-execution
Related Skills
mechanism-flowchart
Generates Mermaid flowchart code and visual diagrams for pathophysiological.
reference-style-sync
One-click synchronization and standardization of reference formats in literature management tools, intelligently fixing metadata errors.
clinical-data-cleaner
Use when cleaning clinical trial data, preparing data for FDA/EMA submission, standardizing SDTM datasets, handling missing values in clinical studies, detecting outliers in lab results, or converting raw CRF data to CDISC format. Cleans and standardizes clinical trial data for regulatory compliance with audit trails.
metagenomic-krona-chart
Analyze data with `metagenomic-krona-chart` using a reproducible workflow, explicit validation, and structured outputs for review-ready interpretation.
anatomy-quiz-master
Generate interactive anatomy quizzes for medical education with multiple question types, difficulty levels, and anatomical regions. Supports gross anatomy, neuroanatomy, and clinical correlations for self-assessment and exam preparation.