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

BOOST
From plugin
medsci-skills
34462 skills
Install
$ npx -y skills add Aperivue/medsci-skills --skill analyze-stats --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/analyze-stats

Context preview

The summary Claude sees to decide when to auto-load this skill.

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

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
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

Get the whole plugin

Other skills on medsci-skills.