Skill Tracer
Skills › Scientific Agent Skills › clinical-decision-support › survival_analysis.md

survival_analysis.md

156 lines · skills/clinical-decision-support/references/survival_analysis.md at 5f2bc03

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1# Survival-Analysis Planning
2

Survival-Analysis Planning

Raw lines 1 to 2
3## Scope
4
5The bundled script validates a plan. It does not read time-to-event rows, fit models, draw curves, or provide an individual prognosis.
6

Scope

The bundled script validates a plan. It does not read time-to-event rows, fit models, draw curves, or provide an individual prognosis.

Raw lines 3 to 6
7## Start With the Estimand
8
9Align:
111. **Population** — eligibility and analysis set.
122. **Condition/comparison** — intervention, exposure, or groups being contrasted.
133. **Variable/endpoint** — event definition and ascertainment.
144. **Intercurrent-event strategy** — how events such as discontinuation, rescue therapy, switching, or competing events relate to the question.
155. **Population-level summary** — risk, survival probability, restricted mean survival time, hazard contrast, quantile, or another justified measure.
166. **Time horizon** — clinically and statistically justified.
18Record time zero, delayed entry, time scale, follow-up end, and calendar/data-cut date.

Start With the Estimand

Align:

  1. Population — eligibility and analysis set.
  2. Condition/comparison — intervention, exposure, or groups being contrasted.
  3. Variable/endpoint — event definition and ascertainment.
  4. Intercurrent-event strategy — how events such as discontinuation, rescue therapy, switching, or competing events relate to the question.
  5. Population-level summary — risk, survival probability, restricted mean survival time, hazard contrast, quantile, or another justified measure.
  6. Time horizon — clinically and statistically justified.

Record time zero, delayed entry, time scale, follow-up end, and calendar/data-cut date.

Raw lines 7 to 19
20## Endpoint Definition
22Specify:
24- exact event;
25- competing events;
26- recurrent events if relevant;
27- ascertainment schedule and adjudication;
28- censoring rules;
29- handling of same-day and tied events;
30- loss to follow-up;
31- administrative censoring;
32- endpoint changes and versioning.
34Do not treat a competing event as ordinary independent censoring when the target is absolute event probability.

Endpoint Definition

Specify:

  • exact event;
  • competing events;
  • recurrent events if relevant;
  • ascertainment schedule and adjudication;
  • censoring rules;
  • handling of same-day and tied events;
  • loss to follow-up;
  • administrative censoring;
  • endpoint changes and versioning.

Do not treat a competing event as ordinary independent censoring when the target is absolute event probability.

Raw lines 20 to 35
36## Descriptive Estimation
38Kaplan-Meier estimates are suitable for survival from the event of interest under appropriate censoring assumptions. Report:
40- numbers at risk;
41- events and censoring;
42- estimates at prespecified times with intervals;
43- median only if estimable;
44- follow-up distribution using an appropriate method;
45- truncation where risk sets become uninformative.
47When competing events exist, use cumulative-incidence methods for event probabilities. Naively censoring competing events in Kaplan-Meier can overestimate absolute incidence.

Descriptive Estimation

Kaplan-Meier estimates are suitable for survival from the event of interest under appropriate censoring assumptions. Report:

  • numbers at risk;
  • events and censoring;
  • estimates at prespecified times with intervals;
  • median only if estimable;
  • follow-up distribution using an appropriate method;
  • truncation where risk sets become uninformative.

When competing events exist, use cumulative-incidence methods for event probabilities. Naively censoring competing events in Kaplan-Meier can overestimate absolute incidence.

Raw lines 36 to 48
49## Group Comparisons
51The log-rank test compares event-time distributions and is most powerful under proportional alternatives. It does not quantify an effect. Pre-specify alternatives if curves may cross or effects may be delayed.
53A Cox model estimates a hazard contrast conditional on model specification. Before presenting a single hazard ratio:
55- assess proportional hazards graphically and analytically;
56- examine functional forms;
57- evaluate influential observations and interactions;
58- define adjustment variables a priori;
59- account for clustering or stratification;
60- avoid interpreting `1 − HR` as a reduction in cumulative risk.
62If proportional hazards is doubtful, consider:
64- time-varying coefficients;
65- piecewise effects;
66- landmark effects;
67- restricted mean survival time at a justified horizon;
68- survival or cumulative-incidence differences at prespecified times;
69- accelerated failure-time or flexible parametric models.
71Report why the selected summary answers the research question.

Group Comparisons

The log-rank test compares event-time distributions and is most powerful under proportional alternatives. It does not quantify an effect. Pre-specify alternatives if curves may cross or effects may be delayed.

A Cox model estimates a hazard contrast conditional on model specification. Before presenting a single hazard ratio:

  • assess proportional hazards graphically and analytically;
  • examine functional forms;
  • evaluate influential observations and interactions;
  • define adjustment variables a priori;
  • account for clustering or stratification;
  • avoid interpreting 1 − HR as a reduction in cumulative risk.

If proportional hazards is doubtful, consider:

  • time-varying coefficients;
  • piecewise effects;
  • landmark effects;
  • restricted mean survival time at a justified horizon;
  • survival or cumulative-incidence differences at prespecified times;
  • accelerated failure-time or flexible parametric models.

Report why the selected summary answers the research question.

Raw lines 49 to 72
73## Competing Risks
75Distinguish:
77- cause-specific hazard questions;
78- cumulative-incidence/absolute-risk questions;
79- subdistribution-hazard modeling.
81State which question the method answers. A subdistribution hazard ratio is not directly a risk ratio. When modeling several event types, check that resulting probability estimates are coherent.
83Primary reference: [Austin, Lee, and Fine, competing risks](https://pmc.ncbi.nlm.nih.gov/articles/PMC4741409/).

Competing Risks

Distinguish:

  • cause-specific hazard questions;
  • cumulative-incidence/absolute-risk questions;
  • subdistribution-hazard modeling.

State which question the method answers. A subdistribution hazard ratio is not directly a risk ratio. When modeling several event types, check that resulting probability estimates are coherent.

Primary reference: Austin, Lee, and Fine, competing risks.

Raw lines 73 to 84
85## Bias and Missingness
87Plan for:
89- informative censoring;
90- delayed entry/left truncation;
91- immortal time;
92- time-dependent confounding;
93- interval censoring;
94- outcome misclassification;
95- missing covariates;
96- competing events;
97- informative visit schedules;
98- treatment switching and rescue treatment;
99- site and calendar effects.
101Specify sensitivity analyses tied to plausible departures from assumptions. A “best/worst case” alone is rarely sufficient.

Bias and Missingness

Plan for:

  • informative censoring;
  • delayed entry/left truncation;
  • immortal time;
  • time-dependent confounding;
  • interval censoring;
  • outcome misclassification;
  • missing covariates;
  • competing events;
  • informative visit schedules;
  • treatment switching and rescue treatment;
  • site and calendar effects.

Specify sensitivity analyses tied to plausible departures from assumptions. A “best/worst case” alone is rarely sufficient.

Raw lines 85 to 102
103## Prediction Models
105For time-to-event prediction:
107- preserve the locked model and prediction horizon;
108- evaluate calibration at prespecified times;
109- report time-dependent discrimination with uncertainty;
110- use appropriate handling of censoring;
111- evaluate overall and subgroup performance;
112- perform external validation in relevant settings;
113- avoid selecting a horizon after viewing results.
115Use TRIPOD+AI and PROBAST+AI.

Prediction Models

For time-to-event prediction:

  • preserve the locked model and prediction horizon;
  • evaluate calibration at prespecified times;
  • report time-dependent discrimination with uncertainty;
  • use appropriate handling of censoring;
  • evaluate overall and subgroup performance;
  • perform external validation in relevant settings;
  • avoid selecting a horizon after viewing results.

Use TRIPOD+AI and PROBAST+AI.

Raw lines 103 to 116
117## Biomarker Evaluation
119For a prognostic biomarker:
121- analyze continuous form where scientifically justified;
122- pre-specify transformations and threshold;
123- avoid minimum-p-value cut-point searches;
124- report assay and specimen handling;
125- adjust for established prognostic factors;
126- validate externally.
128For a predictive biomarker, estimate and report a treatment-by-biomarker interaction in an appropriate design. Separate prognostic association from treatment-effect modification.

Biomarker Evaluation

For a prognostic biomarker:

  • analyze continuous form where scientifically justified;
  • pre-specify transformations and threshold;
  • avoid minimum-p-value cut-point searches;
  • report assay and specimen handling;
  • adjust for established prognostic factors;
  • validate externally.

For a predictive biomarker, estimate and report a treatment-by-biomarker interaction in an appropriate design. Separate prognostic association from treatment-effect modification.

Raw lines 117 to 129
130## Uncertainty and Multiplicity
132Include:
134- confidence intervals for every primary effect;
135- uncertainty in calibration/discrimination;
136- prespecified alpha or interval interpretation;
137- multiplicity strategy for outcomes, times, subgroups, and models;
138- bootstrap or cross-validation details if used;
139- sensitivity analyses;
140- model optimism and overfitting assessment.
142Do not turn a threshold-crossing p-value into clinical importance.

Uncertainty and Multiplicity

Include:

  • confidence intervals for every primary effect;
  • uncertainty in calibration/discrimination;
  • prespecified alpha or interval interpretation;
  • multiplicity strategy for outcomes, times, subgroups, and models;
  • bootstrap or cross-validation details if used;
  • sensitivity analyses;
  • model optimism and overfitting assessment.

Do not turn a threshold-crossing p-value into clinical importance.

Raw lines 130 to 143
144## Primary Method Sources
146- [ICH E9(R1) estimands and sensitivity analysis](https://database.ich.org/sites/default/files/E9-R1_Step4_Guideline_2019_1203.pdf)
147- [Royston and Parmar, restricted mean survival time](https://pubmed.ncbi.nlm.nih.gov/24314264/)
148- [Austin and Fine, reporting competing-risk analyses](https://pmc.ncbi.nlm.nih.gov/articles/PMC5698744/)
150## Plan Validator
152```bash
153python3 scripts/survival_plan_validator.py assets/survival_analysis_plan_template.json
154```
156An exit code of zero means required planning fields and selected consistency rules passed. It is not statistical approval.

Plan Validator

python3 scripts/survival_plan_validator.py assets/survival_analysis_plan_template.json

An exit code of zero means required planning fields and selected consistency rules passed. It is not statistical approval.

Raw lines 150 to 156
Runs code python3 scripts/survival_plan_validator.py :153