Agent skill

Univariate Multivariable Cox Regression

by aipoch in aipoch/medical-research-skills

A skill your agent uses when running prognostic survival analysis on a clinical cohort with time-to-event data to estimate univariate and multivariable Cox proportional hazards models, export result…

MITAuto-check passedData & Analytics

Install Univariate Multivariable Cox Regression

skills CLI
$ npx skills add aipoch/medical-research-skills --skill univariate-multivariable-cox-regression -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aipoch/medical-research-skills univariate-multivariable-cox-regression --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aipoch/medical-research-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/'awesome-med-research-skills/Data Analysis/univariate-multivariable-cox-regression' .claude/skills/univariate-multivariable-cox-regression && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
univariate-multivariable-cox-regression
GitHub stars
1.9k
Token cost
~2.7k tokens
SKILL.md length
941 words
Files
25 (incl. scripts, references)
Skills in repo
578
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when running prognostic survival analysis on a clinical cohort with time-to-event data to estimate univariate and multivariable Cox proportional hazards models, export result…

  • Works in 7 steps: Run Cox Analysis → Generate Univariate Forest Plot → Generate Multivariable Forest Plot → …
  • Export result tables
  • SKILL.md covers When to Use, When Not to Use, When to Read External Files and Usage, plus 7 more sections
  • Runs R scripts from its folder; calls bash

What it does

Univariate Multivariable Cox Regression is an agent skill from aipoch/medical-research-skills. Use when running prognostic survival analysis on a clinical cohort with time-to-event data to estimate univariate and multivariable Cox proportional hazards models, export result tables, and generate forest plots. NOT for: nomogram construction, calibration curves, time-dependent ROC analysis, or model training/feature selection beyond the built-in univariate screening rule.

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 29 other files, including scripts and reference files (for example `eval_report_univariate-multivariable-cox-regression_result.json`, `references/algorithm.md` and `references/cli-guide.md`).

It sits in Data & Analytics, covering Machine learning, Performance reviews and Fine-tuning. The repository describes itself as: Hundreds of agent skills for medical research, including protocol design, data analysis, evidence insights, and academic writing. The licence is MIT.

When your agent uses it

  • Export result tables
  • Generate forest plots

Example prompts

  • “/univariate-multivariable-cox-regression”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Run Cox Analysis
  2. Generate Univariate Forest Plot
  3. Generate Multivariable Forest Plot
  4. Validate and Prepare Data
  5. Run Univariate Cox Models
  6. Run Multivariable Cox Model
  7. Generate Forest Plots

What it can do on your machine

Read from SKILL.md and the folder at commit 686e09d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 9 files in scripts/ (R, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • bash

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Univariate Multivariable Cox Regression loads about 2.7k tokens when it runs, and up to ~5.7k if it reads all its reference files. Until then it costs about 104 tokens; SKILL.md has 941 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~104
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from aipoch/medical-research-skills at commit 686e09d, republished under its MIT licence (© aipoch). 941 words, ~2,709 tokens.

Download SKILL.mdSave it as .claude/skills/univariate-multivariable-cox-regression/SKILL.md (or your agent's skills folder). This skill also uses 24 other files; get the full folder from GitHub.
name
univariate-multivariable-cox-regression
description
Use when running prognostic survival analysis on a clinical cohort with time-to-event data to estimate univariate and multivariable Cox proportional hazards models, export result tables, and generate forest plots. NOT for: nomogram construction, calibration curves, time-dependent ROC analysis, or model training/feature selection beyond the built-in univariate screening rule.

Univariate and Multivariable Cox Regression

When to Use

Use this skill when you need to:

  • run univariate and multivariable Cox regression on a clinical survival cohort;
  • identify prognostic clinical variables associated with time-to-event outcomes;
  • export hazard-ratio tables and then render forest plots from those results.

Typical user requests:

  • "Run single-factor and multi-factor Cox regression on this survival dataset."
  • "Find prognostic variables from my clinical cohort and give me forest plots."
  • "Use futime and fustat to do Cox regression for age, stage, and risk."

When Not to Use

Do not use this skill for:

  • nomogram construction or calibration analysis;
  • time-dependent ROC analysis or external prognostic model validation;
  • feature discovery pipelines beyond the built-in univariate screening rule;
  • non-survival outcomes such as binary diagnosis or differential expression.

When to Read External Files

SituationFile to ReadPurpose
Need algorithm detailsreferences/algorithm.mdStatistical workflow, assumptions, and feature-selection rule
Need to run analysisscripts/main.RExecute Rscript scripts/main.R <command> [options]
Encounter errorsreferences/troubleshooting.mdCommon SKILL_* errors and fixes
Need CLI examplesreferences/cli-guide.mdCommand-specific argument examples
Need test datatests/data/Minimal runnable cohort for smoke testing

Usage

1. Run Cox Analysis
bash
Rscript scripts/main.R analyze \
  --data_file ./clinical_data.csv \
  --features age,gender,stage,risk \
  --time_col futime \
  --event_col fustat \
  --output_dir ./output/ \
  --seed 42
2. Generate Univariate Forest Plot
bash
Rscript scripts/main.R forest-plot \
  --data_file ./output/table/prognosis_uni_cox_results.xlsx \
  --plot_save ./output/plot/uni_forest_plot.pdf
3. Generate Multivariable Forest Plot
bash
Rscript scripts/main.R multi-forest-plot \
  --data_file ./output/table/prognosis_multi_cox_results.xlsx \
  --plot_save ./output/plot/multi_forest_plot.pdf

Arguments

Analyze Command
ShortLongTypeDefaultDescription
-d--data_filecharacterrequiredClinical CSV file with sample IDs as row names
-f--featurescharacterage,gender,stage,Tstage,Nstage,Mstage,riskComma-separated features for Cox analysis
-t--time_colcharacterfutimeSurvival time column
-e--event_colcharacterfustatEvent column encoded as 1=event, 0=censored
-u--skip_univariatecharacterfalseSkip univariate screening and fit multivariable model on all requested features
-o--output_dircharacter./output/Output directory
--overwriteflagFALSEAllow writing into a non-empty output directory
-s--seedinteger42Random seed for reproducibility
-T--timeout_secondsinteger0Elapsed time limit in seconds; 0 disables timeout
Forest Plot Commands

These arguments apply to both forest-plot and multi-forest-plot.

ShortLongTypeDefaultDescription
-d--data_filecharacterrequiredCox result table in .xlsx, .xls, or .csv format
-p--plot_savecharacterrequiredOutput PDF path
-w--widthdouble8Plot width in inches
-H--heightdouble6Plot height in inches
-F--font_sizedouble11Font size for forest-plot labels
-s--seedinteger42Random seed for reproducibility
-T--timeout_secondsinteger0Elapsed time limit in seconds; 0 disables timeout

Input Format

Clinical Data (--data_file for analyze)

CSV file with sample IDs as row names and one column per feature/end-point variable.

csv
",age,gender,stage,futime,fustat,risk
SAMPLE_001,65,Male,StageIII,365,1,high
SAMPLE_002,52,Female,StageII,730,0,low
SAMPLE_003,78,Male,StageIV,180,1,high

Requirements

  • The file must be CSV.
  • Sample IDs must be stored in the first column as row names.
  • time_col must contain finite numeric values greater than 0.
  • event_col must contain only 0 and 1.
  • All requested features, time_col, and event_col must exist.
  • At least 10 complete samples and at least 2 events are required after filtering incomplete rows.
Cox Result Table (--data_file for plot commands)

The plotting commands read the output table created by analyze.

Required columns:

  • Characteristics
  • Total(N)
  • HR (95% CI)
  • P value

Output Files

Analyze Command
FileDescription
table/prognosis_uni_cox_results.xlsxUnivariate Cox result table. Present unless --skip_univariate true
table/prognosis_multi_cox_results.xlsxMultivariable Cox result table
data/analysis_data.rdsSerialized complete-case dataset used for Cox fitting
session_info.txtSession info and recorded run parameters
Plot Commands
FileDescription
plot/uni_forest_plot.pdfPDF forest plot generated by forest-plot
plot/multi_forest_plot.pdfPDF forest plot generated by multi-forest-plot
plot/session_info.txtSession info and plotting parameters written beside the PDF
Show full SKILL.md (400 more words)Show less
Result Table Columns
ColumnDescription
CharacteristicsVariable name for continuous terms, or level label for categorical terms
Total(N)Number of complete-case samples used for modeling
HR (95% CI)Hazard ratio with 95% confidence interval
P valueWald-test p-value formatted to three decimals or <0.001
featureSource feature corresponding to each row

Workflow

Step 1: Validate and Prepare Data
  • Read the clinical CSV.
  • Check required columns and data types.
  • Convert character predictors to factors.
  • Remove rows with missing values across requested model variables.
Step 2: Run Univariate Cox Models
  • Fit one Cox model per feature when --skip_univariate false.
  • Export hazard ratios, confidence intervals, and p-values.
Step 3: Run Multivariable Cox Model
  • Use all significant univariate features with p < 0.05.
  • If fewer than 3 significant features are found, fall back to all requested features.
  • Export adjusted hazard ratios, confidence intervals, and p-values.
Step 4: Generate Forest Plots
  • Read the result table.
  • Parse HR (95% CI) values.
  • Render a one-page PDF forest plot.

Examples

Basic Analysis
bash
Rscript scripts/main.R analyze \
  -d tests/data/sample_clinical_survival_data.csv \
  -o tests/expected_output/ \
  --overwrite
Analysis With Selected Features and Overwrite
bash
Rscript scripts/main.R analyze \
  -d clinical_data.csv \
  -f age,gender,stage,risk \
  -o ./results/ \
  --overwrite \
  -T 600
Direct Multivariable Fit Without Univariate Screening
bash
Rscript scripts/main.R analyze \
  -d clinical_data.csv \
  -f age,stage,risk \
  -u true \
  -o ./results/
Plot Generation
bash
Rscript scripts/main.R forest-plot \
  -d ./results/table/prognosis_uni_cox_results.xlsx \
  -p ./results/plot/uni_forest_plot.pdf \
  -w 10 -H 7 -F 12

Rscript scripts/main.R multi-forest-plot \
  -d ./results/table/prognosis_multi_cox_results.xlsx \
  -p ./results/plot/multi_forest_plot.pdf \
  -w 10 -H 7 -F 12

Error Handling

ErrorCauseSolution
SKILL_INVALID_PARAMETERMissing required CLI value, invalid extension, unknown command, unreadable CSV input, invalid clinical values, too few complete samples/events, or Cox model fitting failure caused by unsupported input dataCheck argument names, file types, clinical value constraints, and model input suitability
SKILL_FILE_NOT_FOUNDInput file path does not existVerify the input path
SKILL_MISSING_COLUMNSRequired columns are absent from the clinical file or plot tableCheck column names and spelling
SKILL_EMPTY_DATAInput file or plot table contains no usable rowsVerify file content and export process
SKILL_PACKAGE_NOT_FOUNDRequired R package is missingInstall the listed CRAN package(s)

IF error persists, READ: references/troubleshooting.md


Testing

Smoke Test With Included Data
bash
Rscript scripts/main.R --help

Rscript scripts/main.R analyze \
  -d tests/data/sample_clinical_survival_data.csv \
  -o tests/expected_output/ \
  --overwrite

Rscript scripts/main.R forest-plot \
  -d tests/expected_output/table/prognosis_uni_cox_results.xlsx \
  -p tests/expected_output/plot/uni_forest_plot.pdf

Rscript scripts/main.R multi-forest-plot \
  -d tests/expected_output/table/prognosis_multi_cox_results.xlsx \
  -p tests/expected_output/plot/multi_forest_plot.pdf
Automated Smoke Test Script
bash
Rscript tests/run_smoke_test.R

Optional shell wrapper:

bash
bash tests/run_smoke_test.sh
Expected Outputs
text
tests/expected_output/
|-- data/analysis_data.rds
|-- plot/multi_forest_plot.pdf
|-- plot/session_info.txt
|-- plot/uni_forest_plot.pdf
|-- session_info.txt
|-- table/prognosis_multi_cox_results.xlsx
`-- table/prognosis_uni_cox_results.xlsx

References

  1. Cox DR (1972). Regression Models and Life-Tables. Journal of the Royal Statistical Society: Series B.
  2. Therneau TM, Grambsch PM (2000). Modeling Survival Data: Extending the Cox Model.
  3. Harrell FE (2015). Regression Modeling Strategies.

For detailed algorithm, READ: references/algorithm.md


Implementation Checklist

  • CLI parsing with optparse
  • set.seed() for reproducibility
  • requireNamespace() dependency checks
  • Session info recording
  • Timeout parameter exposed as CLI option
  • File reading instructions in SKILL.md
  • Modular script structure in scripts/
  • Test data provided in tests/data/
  • Error handling with SKILL_* codes
  • References documented in references/

Last updated: 2026-04-16 | Version: 1.1.0

© aipoch, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 24 other files (scripts, references) in awesome-med-research-skills/Data Analysis/univariate-multivariable-cox-regression of aipoch/medical-research-skills.

  • SKILL.md
  • eval_report_univariate-multivariable-cox-regression_result.json
  • references/algorithm.md
  • references/cli-guide.md
  • references/troubleshooting.md
  • scripts/cli.R
  • scripts/cox_helpers.R
  • scripts/functions.R
  • scripts/io.R
  • scripts/main.R
  • scripts/plotting.R
  • scripts/run_analysis.R
  • scripts/utils.R
  • scripts/validation.R
  • tests/data/sample_clinical_survival_data.csv
  • tests/expected_output/data
  • … and 9 more

Open the folder on GitHubat commit 686e09d

Compare with similar skills

Univariate Multivariable Cox Regression next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Univariate Multivariable Cox Regression compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Univariate Multivariable Cox Regression this skillaipoch/medical-research-skills1.9k—~2.7kAutomated safety check: PassMIT
Geomlitalo-goncalves/geoML109—~4.9kAutomated safety check: PassGPL-3.0
Evaluating Machine Learning Modelsforyourhealth111-pixel/Vibe-Skills3.6k—~390Automated safety check: PassMIT
Bio Machine Learning Survival AnalysisGPTomics/bioSkills1.2k1 repos~4.6kAutomated safety check: PassMIT
Mlnetmanagedcode/dotnet-skills486—~559Automated safety check: PassMIT
ML Pipelinehashgraph-online/awesome-codex-plugins1.3k—~3.2kAutomated safety check: PassApache-2.0

Similar skills

  • Geoml

    italo-goncalves/geoML

    Working knowledge of the geoML Python package (github.com/italo-goncalves/geoML): variational Gaussian processes for spatial data, implicit geological modelling, block models, drillhole data…

    109 GitHub stars~4.9k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Evaluating Machine Learning Models

    foryourhealth111-pixel/Vibe-Skills

    Evaluate trained machine learning models with the right metrics and comparison logic.

    3.6k GitHub stars~390 tokensUpdated 1 mo ago
    Data & AnalyticsAuto-check passed
  • Builds and validates predictive time-to-event models on clinical and omics data with penalized Cox, random survival forests, gradient-boosted and deep survival models, and prediction-grade…

    1.2k GitHub starsUsed in 1 repo~4.6k tokens
    Data & AnalyticsAuto-check passed
  • Mlnet

    managedcode/dotnet-skills

    Use ML.NET to train, evaluate, or integrate machine-learning models into .NET applications with realistic data preparation, inference, and deployment expectations.

    486 GitHub stars~559 tokensUpdated today
    Data & AnalyticsAuto-check passed
  • ML Pipeline

    hashgraph-online/awesome-codex-plugins

    MANDATORY whenever a task involves training, fine-tuning, tuning, or evaluating a machine-learning model on data (tabular, time series, text, images — any modality).

    1.3k GitHub stars~3.2k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    AI & LLM EngineeringAuto-check passed

More from aipoch/medical-research-skills

All 578 skills in this repo
  • Academic Poster Generator

    aipoch/medical-research-skills

    Complete workflow for generating academic research posters from PDF literature; use when you need to extract paper content from PDFs and produce a LaTeX-based poster…

    1.9k GitHub stars~2.2k tokensUpdated 23 days ago
    Auto-check passed
  • Diagnostic Study Quality Assessment Quadas

    aipoch/medical-research-skills

    Analyzes clinical diagnostic accuracy studies for bias using the QUADAS-2 tool.

    1.9k GitHub stars~1.4k tokensUpdated 23 days ago
    Auto-check passed
  • Exploratory Data Analysis

    aipoch/medical-research-skills

    Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats.

    1.9k GitHub stars~3.7k tokensUpdated 23 days ago
    Auto-check passed
  • Iso Certification

    aipoch/medical-research-skills

    A toolkit for preparing ISO 13485:2016 certification documentation for medical device QMS.

    1.9k GitHub stars~1.8k tokensUpdated 23 days ago
    Auto-check passed
  • Journal Skills

    aipoch/medical-research-skills

    Recommends target journals for manuscript submission by analyzing the paper topic/abstract and the journal distribution of similar PubMed literature; use when users ask for journal…

    1.9k GitHub stars~1.7k tokensUpdated 23 days ago
    Auto-check passed
  • Latex Posters

    aipoch/medical-research-skills

    Creates academic-poster writing packages for LaTeX using beamerposter, tikzposter, or baposter.

    1.9k GitHub stars~1.3k tokensUpdated 23 days ago
    Auto-check passed

Questions about Univariate Multivariable Cox Regression

What does Univariate Multivariable Cox Regression do?

A skill your agent uses when running prognostic survival analysis on a clinical cohort with time-to-event data to estimate univariate and multivariable Cox proportional hazards models, export result…. Univariate Multivariable Cox Regression is an agent skill from aipoch/medical-research-skills. Use when running prognostic survival analysis on a clinical cohort with time-to-event data to estimate univariate and multivariable Cox proportional hazards models, export result tables, and generate forest plots.

When should I use Univariate Multivariable Cox Regression?

Univariate Multivariable Cox Regression fits situations like: export result tables; generate forest plots.

How do I install Univariate Multivariable Cox Regression in Claude Code?

Run `npx skills add aipoch/medical-research-skills --skill univariate-multivariable-cox-regression -a claude-code`. Or copy the skill folder (awesome-med-research-skills/Data Analysis/univariate-multivariable-cox-regression in aipoch/medical-research-skills) into .claude/skills/univariate-multivariable-cox-regression in your project. Claude Code loads it when a task matches its description.

How do I install Univariate Multivariable Cox Regression in Codex?

Run `npx skills add aipoch/medical-research-skills --skill univariate-multivariable-cox-regression -a codex`. Or copy the skill folder (awesome-med-research-skills/Data Analysis/univariate-multivariable-cox-regression in aipoch/medical-research-skills) into .agents/skills/univariate-multivariable-cox-regression in your project. Codex loads it when a task matches its description.

Can I use Univariate Multivariable Cox Regression in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aipoch/medical-research-skills --skill univariate-multivariable-cox-regression -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/univariate-multivariable-cox-regression, .gemini/skills/univariate-multivariable-cox-regression, .github/skills/univariate-multivariable-cox-regression and .opencode/skills/univariate-multivariable-cox-regression in your project.

What does Univariate Multivariable Cox Regression need to run?

Going by SKILL.md and its folder, Univariate Multivariable Cox Regression needs R for the scripts in its folder and the command-line tools its instructions call (bash).

Does Univariate Multivariable Cox Regression access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Univariate Multivariable Cox Regression safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Univariate Multivariable Cox Regression use?

Univariate Multivariable Cox Regression is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Univariate Multivariable Cox Regression use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.9k tokens, read only when the agent opens those files.

What are the alternatives to Univariate Multivariable Cox Regression?

Skills that share tags, products or a category with Univariate Multivariable Cox Regression: Geoml (italo-goncalves/geoML, 109 stars), Evaluating Machine Learning Models (foryourhealth111-pixel/Vibe-Skills, 3.6k stars), Bio Machine Learning Survival Analysis (GPTomics/bioSkills, 1.2k stars) and Mlnet (managedcode/dotnet-skills, 486 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Univariate Multivariable Cox Regression?

aipoch (a GitHub organization) maintains it in aipoch/medical-research-skills, which has 1,937 GitHub stars. The repository holds 578 skills in this directory. The repository was last updated on September 17, 2026.

Source: aipoch/medical-research-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.