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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for survival

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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.5 $0.00010 $0.00392
Sonnet 5.5 $0.00005 $0.00196
Haiku 4.5 $0.00003 $0.00098

Measured 2mo ago against content hash be79c2b92f52, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-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 2mo 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. 2mo 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 2d ago), licensed MIT. It adds 26 tokens to every session and 980 once invoked, about $0.0001 per session on Opus 5.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

survival compared with skills from other repositories

survival next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
survivalLeoLin990405/r-analytics-skillSkill52d agoMITA26Claude Code, Codex
data-science-statistical-analysisj4flmao/agent-skillsSkill383d agoMITA103Claude Code, Codex
r-expertpersonamanagmentlayer/pclSkill4411d agoApache-2.0A53Claude Code
stata-ai-fusionhaoyu-haoyu/stata-ai-fusionSkill454mo agoMITA117Claude Code, Codex
audit-structural-equivalenceyogsoth-ai/de-anthropocentric-research-engineSkill51014d agoApache-2.0A55Claude Code, Codex
ara-compileyogsoth-ai/de-anthropocentric-research-engineSkill51014d agoApache-2.0A33Claude Code
audit-explanatory-compressionyogsoth-ai/de-anthropocentric-research-engineSkill51014d agoApache-2.0A43Claude Code, Codex