/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.
$ npx -y skills add lingzhi227/agent-research-skills --skill data-analysis --agent claude-codeHow 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
/data-analysis
Context preview
The summary Claude sees to decide when to auto-load this skill.
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.
SKILL.md
data-analysis.SKILL.mdname: data-analysis
description: 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.
argument-hint: [data-source]
Data Analysis
Generate rigorous statistical analysis code with multi-round review.
Input
- `$0` — Data source (CSV, JSON, pickle, or experiment logs)
- `$1` — Research goal or hypothesis to test
References
- 4-round code review prompts: `~/.claude/skills/data-analysis/references/review-prompts.md`
Scripts
Statistical summary and comparison
python ~/.claude/skills/data-analysis/scripts/stat_summary.py --input results.csv --compare method --metric accuracy --output summary.json
python ~/.claude/skills/data-analysis/scripts/stat_summary.py --input results.csv --describe
Detects data types, recommends tests, runs comparisons, outputs effect sizes and significance stars. Requires numpy, scipy.
Format p-values
python ~/.claude/skills/data-analysis/scripts/format_pvalue.py --values "0.001 0.05 0.23" --format stars
python ~/.claude/skills/data-analysis/scripts/format_pvalue.py --csv results.csv --column pvalue --format latex
Formats p-values with stars, LaTeX notation, or plain text. Stdlib-only.
Workflow
Step 1: Generate Analysis Code
Structure the code with these sections: 1. `# IMPORT` — pandas, numpy, scipy, statsmodels, sklearn 2. `# LOAD DATA` — Load from original data files 3. `# DATASET PREPARATIONS` — Missing values, units, exclusion criteria 4. `# DESCRIPTIVE STATISTICS` — Summary tables if needed 5. `# PREPROCESSING` — Dummy variables, normalization 6. `# ANALYSIS` — Statistical tests per hypothesis 7. `# SAVE ADDITIONAL RESULTS` — Extra results to pickle
Step 2: 4-Round Code Review
1. **Round 1 — Code Flaws**: Mathematical/statistical errors, wrong calculations, trivial tests 2. **Round 2 — Data Handling**: Missing values, units, preprocessing, test choice 3. **Round 3 — Per-Table**: Sensible values, measures of uncertainty, missing data 4. **Round 4 — Cross-Table**: Completeness, consistency, missing variables
Step 3: Produce Results
- Every nominal value must have uncertainty (CI, STD, or p-value)
- Statistical tests must be appropriate for the data type
- Results must match actual data — never hallucinate
Allowed Packages
`pandas`, `numpy`, `scipy`, `statsmodels`, `sklearn`, `pickle`
Statistical Test Selection
| Data Type | Test | |-----------|------| | Two groups, normal | Independent t-test | | Two groups, non-normal | Mann-Whitney U | | Paired samples | Paired t-test / Wilcoxon | | Multiple groups | ANOVA / Kruskal-Wallis | | Categorical | Chi-square / Fisher's exact | | Correlation | Pearson / Spearman | | Regression | OLS / Logistic / Mixed effects |
Rules
- Always report p-values for statistical tests
- Account for relevant confounding variables
- Use inherent package functionality (e.g., `formula = "y ~ a * b"` for interactions)
- Do not manually implement available statistical functions
- Access dataframes using string-based column names, not integer indices
Related Skills
- Upstream: [experiment-code](../experiment-code/), [experiment-design](../experiment-design/)
- Downstream: [table-generation](../table-generation/), [figure-generation](../figure-generation/), [backward-traceability](../backward-traceability/)
- See also: [math-reasoning](../math-reasoning/)
Read more
name: data-analysis description: 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. argument-hint: [data-source]
Data Analysis
Generate rigorous statistical analysis code with multi-round review.
Input
- `$0` — Data source (CSV, JSON, pickle, or experiment logs)
- `$1` — Research goal or hypothesis to test
References
- 4-round code review prompts: `~/.claude/skills/data-analysis/references/review-prompts.md`
Scripts
Statistical summary and comparison
python ~/.claude/skills/data-analysis/scripts/stat_summary.py --input results.csv --compare method --metric accuracy --output summary.json python ~/.claude/skills/data-analysis/scripts/stat_summary.py --input results.csv --describe
Detects data types, recommends tests, runs comparisons, outputs effect sizes and significance stars. Requires numpy, scipy.
Format p-values
python ~/.claude/skills/data-analysis/scripts/format_pvalue.py --values "0.001 0.05 0.23" --format stars python ~/.claude/skills/data-analysis/scripts/format_pvalue.py --csv results.csv --column pvalue --format latex
Formats p-values with stars, LaTeX notation, or plain text. Stdlib-only.
Workflow
Step 1: Generate Analysis Code
Structure the code with these sections: 1. `# IMPORT` — pandas, numpy, scipy, statsmodels, sklearn 2. `# LOAD DATA` — Load from original data files 3. `# DATASET PREPARATIONS` — Missing values, units, exclusion criteria 4. `# DESCRIPTIVE STATISTICS` — Summary tables if needed 5. `# PREPROCESSING` — Dummy variables, normalization 6. `# ANALYSIS` — Statistical tests per hypothesis 7. `# SAVE ADDITIONAL RESULTS` — Extra results to pickle
Step 2: 4-Round Code Review
1. **Round 1 — Code Flaws**: Mathematical/statistical errors, wrong calculations, trivial tests 2. **Round 2 — Data Handling**: Missing values, units, preprocessing, test choice 3. **Round 3 — Per-Table**: Sensible values, measures of uncertainty, missing data 4. **Round 4 — Cross-Table**: Completeness, consistency, missing variables
Step 3: Produce Results
- Every nominal value must have uncertainty (CI, STD, or p-value)
- Statistical tests must be appropriate for the data type
- Results must match actual data — never hallucinate
Allowed Packages
`pandas`, `numpy`, `scipy`, `statsmodels`, `sklearn`, `pickle`
Statistical Test Selection
| Data Type | Test | |-----------|------| | Two groups, normal | Independent t-test | | Two groups, non-normal | Mann-Whitney U | | Paired samples | Paired t-test / Wilcoxon | | Multiple groups | ANOVA / Kruskal-Wallis | | Categorical | Chi-square / Fisher's exact | | Correlation | Pearson / Spearman | | Regression | OLS / Logistic / Mixed effects |
Rules
- Always report p-values for statistical tests
- Account for relevant confounding variables
- Use inherent package functionality (e.g., `formula = "y ~ a * b"` for interactions)
- Do not manually implement available statistical functions
- Access dataframes using string-based column names, not integer indices
Related Skills
- Upstream: [experiment-code](../experiment-code/), [experiment-design](../experiment-design/)
- Downstream: [table-generation](../table-generation/), [figure-generation](../figure-generation/), [backward-traceability](../backward-traceability/)
- See also: [math-reasoning](../math-reasoning/)
31 skills for Claude Code covering the full academic research paper lifecycle — from literature search to slide generation — plus GitHub repository analysis for research topics. Extracted from 17 GitHub repos studying LLM-agent-driven research automation.
Other skills on agent-research-skills.
- /algorithm-design
Design algorithms with LaTeX pseudocode and UML diagrams. Generate algorithmic environments, Mermaid class/sequence diagrams, and ensure consistency between pseudocode and implementation. Use when formalizing methods for a paper.
Open skill - /atomic-decomposition
Decompose research ideas into atomic, self-contained concepts with bidirectional math-code mapping. For each concept, extract the math formula from papers and find code implementations. Use for complex system papers requiring formal grounding.
Open skill - /backward-traceability
Make every number in the final PDF traceable to the exact code line that produced it. Uses \hypertarget/\hyperlink LaTeX commands and \num{formula} evaluated at compile time. Use for reproducibility and data integrity verification.
Open skill - /citation-management
Manage BibTeX citations for LaTeX papers. Harvest missing citations from a draft using Semantic Scholar, validate cite keys against .bib files, deduplicate entries, and format bibliography. Use when working with references, BibTeX, or citations.
Open skill - /code-debugging
Debug experiment code with structured error analysis. Categorize errors, apply targeted fixes with retry logic, and use reflection to prevent recurring issues. Use when experiment code fails or produces incorrect results.
Open skill - /deep-research
Conduct systematic academic literature reviews in 6 phases, producing structured notes, a curated paper database, and a synthesized final report. Output is organized by phase for clarity.
Open skill

