🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Survival Curve Risk Table

by @aipoch-ai

Analyze data with `survival-curve-risk-table` using a reproducible workflow, explicit validation, and structured outputs for review-ready interpretation.

Versionv1.0.0
⚑ When to Use
TriggerAction
- Use this skill for data analysis tasks that require explicit assumptions, bounded scope, and a reproducible output format.
- Use this skill when you need a documented fallback path for missing inputs, execution errors, or partial evidence.
πŸ’‘ Examples

Example 1: Basic Risk Table Generation


Example invocation: python scripts/main.py \

--input survival_data.csv \ --time-col time \ --event-col event \ --group-col treatment \ --output risk_table.png

Example 2: Specify Journal Style


Example invocation: python scripts/main.py \

--input survival_data.csv \ --time-col time \ --event-col status \ --group-col arm \ --style NEJM \ --time-points 0,6,12,18,24,30,36 \ --output figure_1a.pdf

Example 3: Combined Figure Generation (Curve + Risk Table)


Example invocation: python scripts/main.py \

--input survival_data.csv \ --time-col months \ --event-col death \ --group-col group \ --km-plot km_curve.png \ --combine \ --output combined_figure.png

Example 4: Batch Generate Multi-Timepoint Tables


Example invocation: python scripts/main.py \

--input survival_data.csv \ --time-col time \ --event-col event \ --group-col treatment \ --time-points 0,12,24,36,48,60 \ --format both \ --output-dir ./output/

Example 5: Using Existing Survival Data (Python API)

from scripts.main import RiskTableGenerator

Initialize generator

generator = RiskTableGenerator( style="JCO", time_points=[0, 6, 12, 18, 24, 30], figure_size=(8, 6) )

Load survival data

generator.load_data( df=survival_df, time_col="time", event_col="event", group_col="treatment_arm" )

Generate risk table

generator.generate_risk_table( output_path="risk_table.png", show_censored=True )

Generate combined figure (KM curve + risk table)

generator.generate_combined_plot( km_plot_path="km_curve.png", output_path="combined_figure.pdf" )

βš™οΈ Configuration


Python dependencies

pip install -r requirements.txt

πŸ“‹ Tips & Best Practices

Q: How are time points automatically determined?

A: Default uses quantiles in the data (0%, 25%, 50%, 75%, 100%) or fixed intervals (e.g., every 12 months)

Q: How to handle multiple groups?

A: Automatically detect group column, support up to 6 groups. Exceeding automatically uses pagination or reduced font

Q: Can it work with KM curves generated by Python/R?

A: Yes, supports importing external KM curve images for combination

View on ClawHub
TERMINAL
clawhub install survival-curve-risk-table

πŸ§ͺ Use this skill with your agent

Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

πŸ” Can't find the right skill?

Search 60,000+ AI agent skills β€” free, no login needed.

Search Skills β†’