stat-survival-analysis
Skill4 starsChanged 12 days agoMITView on GitHub
Estimate and compare survival functions using Kaplan-Meier curves and log-rank test, with optional Cox proportional hazards regression.
In this repository56 other files it gives its agents.
- bioinformatics-env-setupSkill
- design-thermostable-mutationsSkill
- download-gdcSkill
- download-geoSkill
- download-sraSkill
- source-summarizerSkill
- genome-alignment-qcSkill
- genome-read-alignmentSkill
- genome-variant-annotationSkill
- genome-variant-callingSkill
- genome-variant-filteringSkill
- metagenome-assemblySkill
- metagenome-binningSkill
- metagenome-functional-profilingSkill
- metagenome-host-removalSkill
- metagenome-taxonomic-profilingSkill
- ncbi-eutilities-assistantSkill
- ngs-quality-controlSkill
- ngs-read-preprocessingSkill
- paper-to-briefSkill
- predict-protein-heat-stabilitySkill
- researchSkill
- rnaseq-alignment-qcSkill
- rnaseq-differential-expressionSkill
- rnaseq-functional-enrichmentSkill
- rnaseq-read-alignmentSkill
- rnaseq-read-countingSkill
- rnaseq-transcript-quantificationSkill
- rpsblast-assistantSkill
- scrnaseq-cellranger-countSkill
- scrnaseq-cell-type-annotationSkill
- scrnaseq-clusteringSkill
- scrnaseq-differential-expressionSkill
- scrnaseq-integrationSkill
- scrnaseq-quality-controlSkill
- scrnaseq-trajectory-analysisSkill
- search-enaSkill
- search-geoSkill
- search-gsaSkill
- search-ncbi-datasetsSkill
- search-sraSkill
- stat-analyze-distributionSkill
- stat-assess-data-qualitySkill
- stat-bayesian-estimationSkill
- stat-cluster-samplesSkill
- stat-compare-multiple-groupsSkill
- stat-compare-two-groupsSkill
- stat-fit-glmSkill
- stat-fit-linear-modelSkill
- stat-learn-bayesian-networkSkill
- stat-logistic-regressionSkill
- stat-nonlinear-embeddingSkill
- stat-pairwise-correlationSkill
- stat-pcaSkill
- structured-intelligence-skill-creatorSkill
- <skill-id>Skill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Use cases: clinical trial outcomes, patient survival, cancer prognosis
- Distinctive: line 29
Read data; validate that time column is non-negative numeric and event column is binary (0/1).
- Distinctive: line 32
If multiple groups: run log-rank test (Mantel-Cox).
- Distinctive: line 34
If covariate columns provided: a.
- Distinctive: line 39
Write results and plots (PDF) to output directory.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: Survival Analysis
Use When
- User wants to analyze time-to-event data (overall survival, disease-free survival, time to relapse)
- User wants to compare survival curves between two or more groups (e.g., high vs. low expression, treated vs. untreated)
- User wants to identify predictors of survival using multivariable Cox regression
- Use cases: clinical trial outcomes, patient survival, cancer prognosis
Inputs
- Required:
- Data table (CSV or TSV) with: time-to-event column (numeric), event indicator column (1 = event occurred, 0 = censored)
- Time column name
- Event column name
- Optional:
- Group column name for Kaplan-Meier comparison and log-rank test (if omitted: single KM curve)
- Covariate column names for Cox regression (if provided: runs multivariable Cox model)
- Time unit label (default:
days) - Output directory (default:
./survival_output)
Workflow
- Read data; validate that time column is non-negative numeric and event column is binary (0/1).
- Compute Kaplan-Meier survival estimate for each group (or overall if no group column).
- Report median survival time and 95% confidence interval (Greenwood formula) per group.
- If multiple groups: run log-rank test (Mantel-Cox); report chi-square statistic and p-value.
- Generate Kaplan-Meier plot with confidence intervals, censoring tick marks, and at-risk table.
- If covariate columns provided: a. Fit Cox proportional hazards model. b. Test proportional hazards assumption (Schoenfeld residuals). c. Report for each covariate: hazard ratio, 95% CI, z-statistic, p-value. d. Generate forest plot of hazard ratios.
- Write results and plots (PDF) to output directory.
- Save the executable analysis script (
analysis_code.pyoranalysis_code.R) and software version manifest (session_info.txt) used to produce results.
Output Contract
- KM table (TSV): time, survival_probability, ci_lower, ci_upper, n_at_risk, n_events, group
- Median survival table (TSV): group, median_survival, ci_lower, ci_upper
- Log-rank test result (TSV): chi_square, df, p_value (if multiple groups)
- Cox regression table (TSV): covariate, hazard_ratio, ci_lower, ci_upper, z_statistic, p_value (if covariates provided)
- Kaplan-Meier plot with at-risk table (PDF)
- Forest plot (PDF, Cox only)
- Reproducibility artifacts:
analysis_code.pyoranalysis_code.R, plussession_info.txt
Limits
- Requires accurate censoring information; informative censoring (censored because of outcome-related reasons) biases results.
- Cox model assumes proportional hazards — verify with Schoenfeld residuals test (p > 0.05 for each covariate).
- Log-rank test has low power when hazard ratio changes over time (crossing survival curves).
- Common failure: event column containing values other than 0/1 (e.g., 2 for competing events) — binarize or use competing risks models.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

