Skip to content
Research
Skill

/analyze-stats

Use when data needs statistical analysis. Runs reproducible Python/R code for Table 1, diagnostic accuracy, agreement, regression, survival, propensity score, survey-weighted and repeated-measures models, with publication tables. Sample size is /calc-sample-size; pooling studies

From plugin
medsci-skills
38162 skills

Claude Code

$ npx -y skills add Aperivue/medsci-skills --skill analyze-stats --agent claude-code

SKILL.md

analyze-stats.SKILL.md
name: analyze-stats
description: Use when data needs statistical analysis. Runs reproducible Python/R code for Table 1, diagnostic accuracy, agreement, regression, survival, propensity score, survey-weighted and repeated-measures models, with publication tables. Sample size is /calc-sample-size; pooling studies is /meta-analysis.
metadata:
  triggers: "statistics, statistical analysis, analyze data, run stats, table 1, demographics table, ROC curve, agreement analysis, ICC, kappa, survival analysis, Kaplan-Meier, group comparison, logistic regression, linear regression, regression, propensity score, PSM, IPTW, SIPTW, overlap weighting, repeated measures, mixed model, GEE, longitudinal, survey weighted, KNHANES, NHANES, NHIS cohort, complex survey, wOR, weighted odds ratio, claims-based, ICD-10"

Statistical Analysis Skill

Generate reproducible code (Python preferred, R when necessary) for medical research analyses, run it, and produce publication-ready tables and figures from its output.

Data Privacy Check

Before reading any data file, check whether it might contain Protected Health Information (PHI):

1. If `*_deidentified.*` files exist in the working directory, use those. 2. If only raw CSV/Excel files exist, ask the user whether the data contain patient identifiers (names, national ID / RRN, contact details); if so, have them de-identify it first with `/deidentify`. 3. Proceed once the user confirms the data are de-identified or contain no PHI. 4. **NEVER** display raw PHI values (names, phone numbers, RRN) in your output, because console output is copied into transcripts and drafts. If you encounter them, warn the user and suggest `/deidentify`.

Reference Files

  • `${CLAUDE_SKILL_DIR}/references/templates/` — reusable analysis scripts; read the matching one

before generating code.

  • `${CLAUDE_SKILL_DIR}/references/analysis_guides/` — methodology guides; the Phase 2 table says

which to read.

  • `${CLAUDE_SKILL_DIR}/references/table-standards/` — `table-standards.md` (universal and AMA

rules, footnote order, gtsummary pipeline), `journal-profiles/` (YAML per journal: radiology, jama, nejm, lancet, european_radiology, ajr), `table-types/` (one template per table type), `tool-comparison.md` (R/Python table tools).

  • `${CLAUDE_SKILL_DIR}/references/style/figure_style.mplstyle` — figure style.

Workflow

Phase 1: Data Assessment

1. **Read the data file** (CSV, Excel, TSV, or other tabular format). 2. **Report to the user**: shape (rows x columns); column names and inferred types (continuous, categorical, ordinal, binary, datetime); missing values per column (count and percentage); first 5 rows; unique value counts for categorical columns. 3. **Identify the analysis unit**: patient, exam, lesion, image, rater, study, etc. 4. If a variable name or coding is uncertain, write `[VERIFY: variable_name]` and ask the user to confirm it against the data dictionary; never guess a column name or coding.

Phase 2: Analysis Plan

**Observational designs** (cohort, case-control, cross-sectional, registry, survey): before planning, look for a `variable_operationalization.md` from `/define-variables` (or an equivalent codebook-backed definition table). If none exists, warn the user and recommend running `/define-variables` first, because exposure/outcome/covariate definitions and cutoffs invented ad hoc from the data dictionary are a common reason reviewers reject observational work. This is a warning, not a block: proceed on explicit user confirmation and record that the artifact was not available.

Propose an analysis plan; the user decides the research question and endpoints. Mark any clinical definition, cutoff, diagnostic criterion or guideline claim you could not confirm `[VERIFY]`.

1. **Detect the analysis type** from the table in Analysis-Specific Guidelines, or accept the user's specification. 2. **List the specific tests** to be performed. 3. **Identify primary and secondary endpoints**. 4. **State the assumptions** that will be checked (normality, homogeneity, independence). 5. **Note data cleaning** needed (recoding, outlier handling, missing-data strategy). 6. **Anchor the estimand to the research question.**

  • Interaction, synergy or effect modification: the primary estimand is the **interaction

parameter itself** (a likelihood-ratio test of the interaction term, or the interaction OR/HR on one stated scale) — not a main-effect OR whose CI is then read as "no synergy". A public-health or biological **synergy** claim is additive-scale: report **RERI**, **AP** or **S**, each with a CI (R `interactionR` / `epiR`; Knol & VanderWeele reporting), not only a multiplicative product term, because a non-significant multiplicative interaction is compatible with a large additive one (and vice versa). Joint categories (high/high vs low/low) show joint association, not interaction; "stronger in A than in B" from separate stratum estimates is the difference-in-significance fallacy — report the formal interaction term.

  • Equivalence or non-inferiority: declare the margin up front (a TOST procedure, or the CI

compared against a pre-stated MCID); a non-significant difference is not equivalence without a margin. 7. **Screen every categorical/binary predictor for separation before fitting anything.** A predictor that perfectly predicts the outcome has no finite MLE, and the failure is silent: `glm` returns an odds ratio near 0 (or enormous), *p* ≈ 0.99, and an AUC that ends up in a table. Pathognomonic imaging signs (T2-FLAIR mismatch, the string sign, a halo sign) cause it routinely: 100% specificity means an empty cell by construction.

   python3 "${CLAUDE_SKILL_DIR}/scripts/check_separation.py" \
     --data cohort.csv --outcome idh_mutant --auto --strict

`COMPLETE_SEPARATION` (an empty cell) and `QUASI_SEPARATION` (a cell below the sparsity flo

Read more
@aperivue
Ships withmedsci-skills

Created & maintained by Yoojin Nam, MD Department of Radiology and Research Institute of Radiology, University of Ulsan College of Medicine, Asan Medical Center, Seoul, Republic of Korea MedSci Skills is a set of Agent Skills for clinical research: literature

Stars on GitHub

Momentum

stars in total
381
Star history of Aperivue/medsci-skills on GitHub, a chart by star-history.com

Other skills on medsci-skills.

academic-aio

academic-aio

Use when a medical AI paper should be found and cited by AI search engines and RAG tools. Optimizes the title, abstract, summary…

add-journal

add-journal

Use when a target journal has no profile yet. Reads the journal's author guidelines and writes a detailed /write-paper profile…

author-strategy

author-strategy

Use when analyzing a researcher's publication record from PubMed. Fetches an author's papers, classifies study types and author…

batch-cohort

batch-cohort

Use when one validated cohort analysis must be repeated across many exposure/outcome pairs. Generates one R/Python script per…

calc-sample-size

calc-sample-size

Use when planning how many patients or cases a study needs before data collection (power analysis, IRB justification). Walks a…

More skills from other plugins.

academic-paper-review

academic-paper-review

Use this skill when the user requests to review, analyze, critique, or summarize academic papers, research articles, preprints,…

@bytedance@bytedanceInstall Skill
last30days

last30days

Research what people actually say about any topic in the last 30 days. Pulls posts and engagement from Reddit, X, YouTube,…

@mvanhorn@mvanhornInstall Skill

Questions about analyze-stats.

Which coding agents can use analyze-stats?
analyze-stats installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.