Claude Skill MartBrowse skillsQuick linesLearn by videoTerminal guideWhat is a Skill?
← Back to list

Batch Cohort Analysis (batch-cohort)

Turns one validated analysis template into N variable-swapped R/Python scripts across exposure × outcome pairs, then aggregates everything into a summary results matrix.

Data & AnalyticsAdvanced★ 320⑂ 77AI score 8/10Last updated: Sep 29, 2026

What it does

  • Reads a validated analysis script (or a template type such as nhis_cohort, cross_national, survey_weighted) and identifies the slot variables to swap: EXPOSURE_VAR, OUTCOME_VAR, codings and labels.
  • Takes an exposure/outcome spec (inline list, CSV file, or the all keyword for every pairwise combination), builds a combination matrix, then emits one script per combination plus a run_all.R master runner.
  • In execute/full mode it runs the batch, logs failed combinations with reasons, and aggregates summary_matrix.csv, subgroup_matrix.csv, and an optional effect-size heatmap.
  • Enforces epidemiology guardrails: drop self-adjustment when the exposure is also a covariate, mandatory survey-weighted analysis, EPV (≥10 events per covariate) check, Bonferroni column when >5 combinations, physician-diagnosis in outcome definitions, data SHA256 in the README, and explicit hypothesis-generation (anti-p-hacking) framing.
  • Cross-national mode produces paired Korea/US scripts and a direction-agreement column.

Who it's for

  • Medical and public-health researchers working with KNHANES, NHANES, NHIS, or any cleaned cohort file.
  • PIs and graduate students who want to systematically explore many exposure–outcome hypotheses with one fixed methodology.
  • Research teams standardizing a single reproducible statistical pipeline across many analysts.

Example uses

  1. Point it at KNHANES HN18.csv plus a validated script and run six exposures (depression, obesity, smoking, heavy drinking, low income, low education) against diabetes in full mode.
  2. Run Korea (KNHANES) and US (NHANES) side by side for 3 exposures × 3 outcomes (diabetes, hypertension, metabolic syndrome) to get nine paired cross-national scripts.
  3. On an NHIS sample cohort, generate code_only scripts for AF / heart failure / COPD / CKD against all-cause mortality, cardiovascular death and stroke, then review before executing.

· · · Install guide · · ·

Try it now, no install

Paste this into Claude to use the skill without installing anything.

Read the instructions in this file and follow them to help me:
https://raw.githubusercontent.com/Aperivue/medsci-skills/HEAD/skills/batch-cohort/SKILL.md

What I want: (describe your task here)

If Claude can't open the link, open it yourself and paste the contents instead.

↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.

Install in the Claude app (no terminal)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
↓ Download ZIP
Install in Claude Code

Let Claude do it — paste this into Claude Code

Install the skill I found on Claude Skill Mart.
Copy the skills/batch-cohort folder from the GitHub repo Aperivue/medsci-skills into my ~/.claude/skills/batch-cohort/.
When it's done, tell me in one line what this skill can do.

Install with a command instead

git clone https://github.com/Aperivue/medsci-skills.git && mkdir -p ~/.claude/skills && cp -r medsci-skills/skills/batch-cohort ~/.claude/skills/

⚠ This is a third-party skill. Check the source repository before installing.

  1. Open a terminal and move to the folder where you keep repos.
  2. Clone the repository: git clone https://github.com/Aperivue/medsci-skills.git
  3. Create the skills directory: mkdir -p ~/.claude/skills
  4. Copy the skill in: cp -r medsci-skills/skills/batch-cohort ~/.claude/skills/
  5. Also copy the companion skills (analyze-stats, replicate-study, cross-national, make-figures, write-paper) so the referenced workflows and the code-quality gate work.
  6. Restart Claude Code, type /batch-cohort, and supply: data path(s), template path or template type, exposure/outcome lists, and mode (code_only / execute / full).
  7. Make sure R or Python is installed (e.g. the R survey package for weighted analysis) if you want actual batch execution rather than code generation only.