Back to Skills

data-analysis

Generate statistical analysis code with 4-round review. Select appropriate statistical tests, interpret results, and produce analysis reports with p-values, effect sizes, and confidence intervals. Use when analyzing experimental data for a paper.

272stars33forksUpdated 8/13/2026

Security Assessment

Safe(95/100)
Security Score95/100

About data-analysis

Data Analysis is a research-oriented skill that generates rigorous statistical analysis code and subjects it to a structured 4-round review. It helps select appropriate statistical tests, interpret results, and produce analysis reports complete with p-values, effect sizes, and confidence intervals — aimed at analyzing experimental data for a paper. It solves the problem of ad-hoc, error-prone statistical scripting by imposing a consistent code structure and a multi-pass review that catches mathematical, data-handling, and reporting flaws.

The skill structures analysis code into labeled sections (import, load data, dataset preparation, descriptive statistics, preprocessing, analysis, and saving results) and then runs four review rounds: fundamental code and statistical flaws, data handling (missing values, units, preprocessing, test choice and assumptions), per-table sensibility and uncertainty measures, and cross-table completeness and consistency. It ships two helper scripts: `stat_summary.py`, which detects data types, recommends tests, runs comparisons, and outputs effect sizes and significance stars (requiring numpy and scipy), and `format_pvalue.py`, which formats p-values as stars, LaTeX, or plain text using only the standard library. A test-selection table maps data types to tests (t-test, Mann-Whitney U, ANOVA, Kruskal-Wallis, chi-square, Fisher's exact, Pearson/Spearman, OLS/logistic/mixed effects), and rules require reported uncertainty for every value, appropriate tests, and no hallucinated results. The scripts operate on local user-supplied data files with common scientific packages.

The target users are researchers, data scientists, and graduate students preparing quantitative results for publication. Use cases include comparing methods across metrics, choosing and validating a statistical test, formatting p-values for a LaTeX table, and reviewing analysis code for statistical soundness before submission.

FAQ

What is the 4-round review?

Round 1 checks fundamental code and statistical flaws, round 2 checks data handling (missing values, units, preprocessing, test choice and assumptions), round 3 reviews each table for sensible values and uncertainty measures, and round 4 checks cross-table completeness and consistency.

What helper scripts are included and what do they need?

stat_summary.py detects data types, recommends and runs tests, and outputs effect sizes and significance stars (requires numpy and scipy). format_pvalue.py formats p-values as stars, LaTeX, or plain text and is standard-library only.

How does it choose a statistical test?

It uses a selection table mapping data type and design to tests — for example independent or paired t-tests, Mann-Whitney U, ANOVA or Kruskal-Wallis, chi-square or Fisher's exact, Pearson or Spearman correlation, and OLS, logistic, or mixed-effects regression.

Which packages are allowed?

pandas, numpy, scipy, statsmodels, sklearn, and pickle (with pingouin and matplotlib noted in the referenced review prompts). It relies on built-in package functions rather than reimplementing statistical routines by hand.

Does it work on my own data files?

Yes. It reads local data sources you point it at — CSV, JSON, pickle, or experiment logs — and reports results that must match the actual data, with an explicit rule never to hallucinate values.

All Files

4 files
scripts/format_pvalue.py4.8 KB
View
SKILL.md3.5 KB
View
scripts/stat_summary.py8.4 KB
View
references/review-prompts.md4.0 KB
View

Install data-analysis

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill