PluginBench
Skill
Review
Audit score 70

data-analysis

lingzhi227/agent-research-skills

Generate rigorous statistical analysis code with multi-round review and proper uncertainty reporting.

What is data-analysis?

Produces statistical analysis code with 4-round peer review for experimental data. Selects appropriate tests based on data type, reports p-values and effect sizes, and generates analysis reports with confidence intervals. Use when analyzing experimental results for papers or research.

  • Detects data types and recommends appropriate statistical tests (t-tests, ANOVA, Mann-Whitney U, Chi-square, correlation, regression)
  • Generates analysis code with structured sections: imports, data loading, preprocessing, descriptive statistics, and hypothesis testing
  • Performs 4-round code review checking for mathematical errors, data handling issues, sensible values, and cross-table consistency
  • Formats p-values with significance stars, LaTeX notation, or plain text for publication
  • Calculates effect sizes, confidence intervals, and standard deviations for all nominal values
  • Handles missing values, unit conversions, and confounding variables in analysis

How to install data-analysis

npx skills add https://github.com/lingzhi227/agent-research-skills --skill data-analysis
Prerequisites
  • Python with numpy, scipy, statsmodels, sklearn, and pandas installed
  • Data in CSV, JSON, pickle, or experiment log format
  • Clear research goal or hypothesis to test
Claude Code
Cursor
Windsurf
Cline

How to use data-analysis

  1. 1.Provide your data source (CSV, JSON, pickle, or experiment logs) and your research goal or hypothesis
  2. 2.The skill generates analysis code structured with imports, data loading, preprocessing, and statistical tests appropriate for your data type
  3. 3.Review the generated code through the 4-round review process: check for mathematical errors, data handling issues, value sensibility, and cross-table consistency
  4. 4.Run the analysis code to produce results with p-values, effect sizes, and confidence intervals
  5. 5.Format p-values for publication using the format-pvalue script (stars, LaTeX, or plain text)

Use cases

Good for
  • Analyzing experimental results from A/B tests or method comparisons to determine statistical significance
  • Processing survey or observational data with multiple groups to test hypotheses using appropriate tests
  • Generating publication-ready statistical summaries with p-values and effect sizes for research papers
  • Comparing treatment groups in clinical or behavioral studies with proper uncertainty quantification
  • Validating machine learning model performance across multiple runs with statistical rigor
Who it's for
  • Researchers and academics analyzing experimental data
  • Data scientists validating model performance with statistical tests
  • Graduate students preparing statistical analyses for theses or papers
  • Anyone conducting hypothesis testing on experimental or observational data

data-analysis FAQ

What statistical tests does this skill support?

It supports t-tests, paired t-tests, Mann-Whitney U, ANOVA, Kruskal-Wallis, Chi-square, Fisher's exact, Pearson/Spearman correlation, OLS regression, logistic regression, and mixed-effects models. Test selection is automatic based on data type and sample characteristics.

Does it handle missing data?

Yes. The skill includes data handling review in Round 2 of the 4-round review process, checking for missing values, units, preprocessing, and appropriate test choice for your data.

Can I use this for publication-ready results?

Yes. Every nominal value must have uncertainty (confidence interval, standard deviation, or p-value), and the skill enforces this. Results must match actual data—no hallucination.

What packages are required?

pandas, numpy, scipy, statsmodels, and sklearn. All are standard Python data science libraries.

How does the 4-round review work?

Round 1 checks for mathematical/statistical errors; Round 2 reviews data handling and test choice; Round 3 validates individual table values and uncertainty; Round 4 ensures cross-table consistency and completeness.

Full instructions (SKILL.md)

Source of truth, from lingzhi227/agent-research-skills.


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 TypeTest
Two groups, normalIndependent t-test
Two groups, non-normalMann-Whitney U
Paired samplesPaired t-test / Wilcoxon
Multiple groupsANOVA / Kruskal-Wallis
CategoricalChi-square / Fisher's exact
CorrelationPearson / Spearman
RegressionOLS / 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-design
  • Downstream: table-generation, figure-generation, backward-traceability
  • See also: math-reasoning