Skip to content

Commit 8ce3a74

Browse files
spec: add survival-kaplan-meier specification (#2449)
## New Specification: `survival-kaplan-meier` Related to #2441 --- ### specification.md # survival-kaplan-meier: Kaplan-Meier Survival Plot ## Description A Kaplan-Meier survival plot visualizes the probability of survival (or event-free time) over a time period using a step function. It is the standard method for estimating survival functions from time-to-event data, handling censored observations where the event has not yet occurred. The plot shows how survival probability decreases over time, with optional confidence intervals and comparison between groups. ## Applications - Medical research tracking patient survival rates after diagnosis or treatment - Reliability engineering analyzing time-to-failure for equipment or components - Customer analytics measuring time-to-churn or subscription retention - Clinical trials comparing survival outcomes between treatment and control groups ## Data - `time` (numeric) - Time to event or censoring (e.g., days, months, years) - `event` (binary) - Event indicator (1 = event occurred, 0 = censored) - `group` (categorical, optional) - Grouping variable for comparing survival curves - Size: 50-1000 observations - Example: Clinical trial data with patient survival times and treatment groups ## Notes - Use step function (not smooth curves) to accurately represent discrete event times - Include 95% confidence intervals as shaded bands around the survival curve - Mark censored observations with tick marks on the curve - When comparing groups, use distinct colors and include a legend - Consider adding median survival time annotation and at-risk table below the plot - Log-rank test p-value can be included when comparing groups --- **Next:** Add `approved` label to the issue to merge this PR. --- :robot: *[spec-create workflow](https://github.com/MarkusNeusinger/pyplots/actions/runs/20584237116)* Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 3cc18aa commit 8ce3a74

File tree

4 files changed

+62
-0
lines changed

4 files changed

+62
-0
lines changed

plots/survival-kaplan-meier/implementations/.gitkeep

Whitespace-only changes.

plots/survival-kaplan-meier/metadata/.gitkeep

Whitespace-only changes.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# survival-kaplan-meier: Kaplan-Meier Survival Plot
2+
3+
## Description
4+
5+
A Kaplan-Meier survival plot visualizes the probability of survival (or event-free time) over a time period using a step function. It is the standard method for estimating survival functions from time-to-event data, handling censored observations where the event has not yet occurred. The plot shows how survival probability decreases over time, with optional confidence intervals and comparison between groups.
6+
7+
## Applications
8+
9+
- Medical research tracking patient survival rates after diagnosis or treatment
10+
- Reliability engineering analyzing time-to-failure for equipment or components
11+
- Customer analytics measuring time-to-churn or subscription retention
12+
- Clinical trials comparing survival outcomes between treatment and control groups
13+
14+
## Data
15+
16+
- `time` (numeric) - Time to event or censoring (e.g., days, months, years)
17+
- `event` (binary) - Event indicator (1 = event occurred, 0 = censored)
18+
- `group` (categorical, optional) - Grouping variable for comparing survival curves
19+
- Size: 50-1000 observations
20+
- Example: Clinical trial data with patient survival times and treatment groups
21+
22+
## Notes
23+
24+
- Use step function (not smooth curves) to accurately represent discrete event times
25+
- Include 95% confidence intervals as shaded bands around the survival curve
26+
- Mark censored observations with tick marks on the curve
27+
- When comparing groups, use distinct colors and include a legend
28+
- Consider adding median survival time annotation and at-risk table below the plot
29+
- Log-rank test p-value can be included when comparing groups
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Specification-level metadata for survival-kaplan-meier
2+
# Auto-synced to PostgreSQL on push to main
3+
4+
spec_id: survival-kaplan-meier
5+
title: Kaplan-Meier Survival Plot
6+
7+
# Specification tracking
8+
created: 2025-12-29T22:39:04Z
9+
updated: null
10+
issue: 2441
11+
suggested: MarkusNeusinger
12+
13+
# Classification tags (applies to all library implementations)
14+
# See docs/concepts/tagging-system.md for detailed guidelines
15+
tags:
16+
plot_type:
17+
- survival
18+
- step
19+
- line
20+
data_type:
21+
- numeric
22+
- timeseries
23+
- categorical
24+
domain:
25+
- healthcare
26+
- statistics
27+
- research
28+
- engineering
29+
features:
30+
- basic
31+
- confidence-interval
32+
- censored-data
33+
- comparison

0 commit comments

Comments
 (0)