MAGIC Agent Skills is now open source! Star on GitHub
MAGIC Agent SkillsMAGIC Agent Skills
Skills Reference

magic-statistical-analysis

Perform descriptive statistics, hypothesis testing, and correlation analysis with mandatory uncertainty communication. Use when computing statistics, testing hypotheses, comparing groups, or analyzing correlations with significance.

When It Activates

Use this skill when computing statistics or testing hypotheses. Trigger phrases: statistics, statistical, hypothesis test, t-test, chi-square, correlation, regression, significance, p-value, distribution, balance check.

  • Need descriptive statistics with narrative interpretation
  • Need hypothesis testing (group comparisons)
  • Need correlation analysis with significance
  • After magic-data-profiling or magic-data-cleaning, before reporting
  • Results naturally feed into magic-report-generation for structured deliverables, or magic-data-visualization for charts

When NOT to Use: Use magic-data-profiling for initial exploration; use magic-data-exploration for pattern discovery.

Quick Facts

PropertyValue
Version2.0.0
Complexityhigh
Phase1
Scripts3

Tags

data-science statistics hypothesis-testing correlation analysis

Scripts

Scriptable Tools (call directly or read + adapt)

ScriptStandard CLI UsageWhen to Customize
descriptive_stats.pypython3 descriptive_stats.py --input data.csv --output stats.json--columns col1,col2 to restrict; --explain for verbose narrative; --auto-checkpoint for versioned snapshots
hypothesis_test.pypython3 hypothesis_test.py --input data.csv --output test.json --group_col region --value_col revenue--group_col and --value_col functionally required; --test to override auto; --explain for narrative; --auto-checkpoint
correlation_analysis.pypython3 correlation_analysis.py --input data.csv --output corr.json--method pearson|spearman|kendall to override auto; --columns to restrict

New in v2.0.0

--auto-checkpoint Flag

descriptive_stats.py and hypothesis_test.py support --auto-checkpoint, which saves a numbered snapshot (ckpt_NN_*.csv) after each successful analysis run.

--explain Flag

Both descriptive_stats.py and hypothesis_test.py support --explain, which outputs a JSON execution plan describing which test will be run, on which columns, with which parameters — without writing any result files.

# Preview what hypothesis test will be selected
python3 hypothesis_test.py --input data.csv --output test.json \
  --group_col region --value_col revenue --explain

Test Selection

The skill auto-selects the appropriate statistical test based on data characteristics:

ConditionTest
2 groups + normal distributiont-test
2 groups + non-normalMann-Whitney U
3+ groups + normalOne-way ANOVA
3+ groups + non-normalKruskal-Wallis
Both categoricalChi-square

Every test result includes an effect size (Cohen's d, eta-squared, rank-biserial, or Cramer's V) alongside the p-value.

Dependencies

pandas numpy scipy matplotlib seaborn

Was this page helpful?
Edit on GitHub

Last updated on

On this page