survival

survival is a skill for Claude Code, Codex from LeoLin990405/r-analytics-skill. It costs 26 tokens per session (980 once invoked), scanned A, original, MIT.

An R guide for survival analysis, which studies the time until an event occurs while allowing for incomplete observations.

In plain words
What is it for?
Use it to create Kaplan-Meier estimates, fit Cox regression models, calculate hazard ratios, test model assumptions, and handle changing factors over time.
Why use it?
It helps estimate survival over time, compare groups, and measure how factors such as age or treatment affect the chance of an event.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create Kaplan-Meier estimates, fit Cox regression models, calculate hazard ratios, test model assumptions, and handle changing factors over time.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/leolin990405/r-analytics-skill/survival
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add LeoLin990405/r-analytics-skill --skill survival
Clone the repo
git clone --depth 1 https://github.com/LeoLin990405/r-analytics-skill

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for survival

README.md
[![agentmods](https://agentmods.dev/badge/skills/leolin990405/r-analytics-skill/survival.svg)](https://agentmods.dev/skills/leolin990405/r-analytics-skill/survival)
Your own site
<a href="https://agentmods.dev/skills/leolin990405/r-analytics-skill/survival"><img src="https://agentmods.dev/badge/skills/leolin990405/r-analytics-skill/survival.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 980 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00026 $0.00980
Opus 5 $0.00013 $0.00490
Sonnet 5 $0.00005 $0.00196
Haiku 4.5 $0.00003 $0.00098

Measured 4d ago against content hash be79c2b92f52, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

survival scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

sub-skills/r-ml/r-ml-survival/survival/SKILL.md · 168 lines

How it starts

The opening of the file, as written. The whole thing — 168 lines — stays where its author put it; the contents beside it link to each section on GitHub.

survival

Core survival analysis functions.

Survival Objects

library(survival)

# Create survival object
Surv(time, event)
Surv(time, time2, event)  # Interval censoring
Surv(time, event, type = "right")

# Example
surv_obj <- Surv(df$time, df$status)

Kaplan-Meier Estimation

# Fit KM curve
km_fit <- survfit(Surv(time, status) ~ 1, data = df)

# By group
km_fit <- survfit(Surv(time, status) ~ group, data = df)

# Summary
summary(km_fit)
summary(km_fit, times = c(30, 60, 90))

# Median survival
km_fit

# Plot
plot(km_fit)
plot(km_fit, conf.int = TRUE)

Cox Proportional Hazards

# Fit Cox model
cox_fit <- coxph(Surv(time, status) ~ age + sex + treatment, data = df)

# Summary
summary(cox_fit)

# Hazard ratios
exp(coef(cox_fit))
exp(confint(cox_fit))

# Test proportional hazards
cox.zph(cox_fit)
plot(cox.zph(cox_fit))

Stratified Cox Model

# Stratify by variable
cox_fit <- coxph(Surv(time, status) ~ age + strata(sex), data = df)

# Multiple strata
cox_fit <- coxph(Surv(time, status) ~ age + strata(sex, center), data = df)

Time-Varying Covariates

# Create time-varying dataset
tvc_data <- tmerge(df, df, id = id,
                   tstop = time,
                   event = event(time, status))

# Add time-varying covariate
tvc_data <- tmerge(tvc_data, covariate_df, id = id,
                   trt = tdc(start_time, treatment))

# Fit model
cox_fit <- coxph(Surv(tstart, tstop, event) ~ trt + age, data = tvc_data)

Parametric Models

# Weibull
weibull_fit <- survreg(Surv(time, status) ~ age + sex,
                       data = df, dist = "weibull")

# Exponential
exp_fit <- survreg(Surv(time, status) ~ age + sex,
                   data = df, dist = "exponential")

# Log-normal
lnorm_fit <- survreg(Surv(time, status) ~ age + sex,
                     data = df, dist = "lognormal")

# Log-logistic
llog_fit <- survreg(Surv(time, status) ~ age + sex,
                    data = df, dist = "loglogistic")

Read the full file on GitHub · 168 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 168 lines · 26 tokens per session scan A be79c2b92f52

Subscribe to this mod's changes

survival is a skill published in the GitHub repository LeoLin990405/r-analytics-skill (5 stars, last pushed 5mo ago), licensed MIT. It adds 26 tokens to every session and 980 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

bio-applied-bio-data-formats

Parse/write FASTA, FASTQ, SAM/BAM, VCF, BED, GFF/GTF with pysam and pure Python; decode SAM FLAG/CIGAR; reconcile 0-based vs 1-based coordinates. Use for custom format parsers or off-by-one coordinate bugs.

Pavel-Kravchenko/Bioinformatics · 67 tokens

bio-applied-mageck-gene-essentiality

Run MAGeCK count/test on pooled CRISPR sgRNA screens, scoring gene essentiality via RRA, FDR, and log2 fold-change. Use when analyzing CRISPR screen FASTQ/count data, calling essential or drug-resistance genes, or benchmarking vs DepMap.

Pavel-Kravchenko/Bioinformatics · 69 tokens

bio-applied-molecular-evolution

Test Hardy-Weinberg equilibrium, simulate Wright-Fisher drift/selection, and compute dN/dS, Tajima's D, and Fst with NumPy/SciPy. Use for neutral theory, molecular clock divergence time, selection scans, or effective population size (Ne) questions.

Pavel-Kravchenko/Bioinformatics · 67 tokens

bio-applied-network-modules

Detect PPI/co-expression modules with NetworkX/python-louvain/leidenalg (Louvain, Leiden, modularity Q) and WGCNA eigengenes. Use when clustering a gene network, computing WGCNA modules, or testing DEG/pathway enrichment on network communities.

Pavel-Kravchenko/Bioinformatics · 65 tokens

bio-applied-ribo-seq

Ribo-seq: cutadapt/bowtie2 adapter+rRNA removal, plastid P-site calibration, 3-nt periodicity QC, RiboCode/ribotricer ORF calling, translation efficiency. Use when user has ribosome profiling or footprint data.

Pavel-Kravchenko/Bioinformatics · 64 tokens

bio-core-computational-genetics

Translate DNA per-frame, score codon usage bias (RSCU/CAI), simulate restriction digests/ORFs, and test three-point-cross mapping and Hardy-Weinberg equilibrium. Use for CAI, virtual digests, crossover mapping, or HWE tests.

Pavel-Kravchenko/Bioinformatics · 64 tokens