agentleFS
Scientific-ToolingScientific-Tooling/structured-intelligence/skills/stat-compare-multiple-groups/SKILL.md

stat-compare-multiple-groups

Skill4 starsChanged 12 days agoMITView on GitHub

Compare a continuous variable across three or more groups using one-way ANOVA or Kruskal-Wallis with post-hoc testing.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read data; validate that group column has three or more levels.

    line 27
  2. Distinctive:

    Run normality tests (Shapiro-Wilk) within each group and run one global Levene's test across groups for homogeneity of variance.

    line 28
  3. Distinctive:

    If all groups are normal and variances are approximately equal: one-way ANOVA.

    line 29
  4. Distinctive:

    If second factor provided: two-way ANOVA with interaction term.

    line 30
  5. Distinctive:

    If normality or homogeneity of variance is violated: Kruskal-Wallis test.

    line 31
  6. Distinctive:

    If omnibus test is significant (p < 0.05): run post-hoc pairwise comparisons.

    line 32
  7. Distinctive:

    Write results and plot (PDF) to output directory.

    line 38
  8. Distinctive:

    Does not support repeated-measures ANOVA.

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: Multiple-Group Statistical Comparison

Use When

  • User wants to compare a continuous measurement across three or more experimental groups
  • User needs an omnibus test (ANOVA or Kruskal-Wallis) plus pairwise post-hoc comparisons
  • User has a two-factor design and wants to test for interaction effects (two-way ANOVA)

Inputs

  • Required:
    • Data table (CSV or TSV) with a numeric value column and a group column (three or more levels)
  • Optional:
    • Group variable column name
    • Value variable column name
    • Second factor column for two-way ANOVA (optional; triggers two-way analysis)
    • Post-hoc method: tukey (default for ANOVA) or dunn (default for Kruskal-Wallis)
    • Output directory (default: ./multigroup_output)

Workflow

  1. Read data; validate that group column has three or more levels.
  2. Run normality tests (Shapiro-Wilk) within each group and run one global Levene's test across groups for homogeneity of variance.
  3. If all groups are normal and variances are approximately equal: one-way ANOVA.
    • If second factor provided: two-way ANOVA with interaction term.
  4. If normality or homogeneity of variance is violated: Kruskal-Wallis test.
  5. If omnibus test is significant (p < 0.05): run post-hoc pairwise comparisons.
    • ANOVA: Tukey HSD (controls family-wise error rate).
    • Kruskal-Wallis: Dunn test with Benjamini-Hochberg correction.
  6. Compute effect size: eta-squared (η²) for ANOVA, epsilon-squared for Kruskal-Wallis.
  7. Generate a box plot with all groups and pairwise significance brackets.
  8. Save the executable analysis script (analysis_code.py or analysis_code.R) and software version manifest (session_info.txt) used to produce results.
  9. Write results and plot (PDF) to output directory.
  10. Report: omnibus test result, effect size, significant pairwise comparisons.

Output Contract

  • Omnibus test result (TSV): test, statistic, df, p_value, effect_size, effect_size_type
  • Post-hoc comparisons table (TSV): group1, group2, statistic, p_value, adj_p_value, significant
  • Box plot with significance brackets (PDF)
  • Decision log explaining method selection (printed to stdout)
  • Reproducibility artifacts: analysis_code.py or analysis_code.R, plus session_info.txt

Limits

  • Two-way ANOVA assumes balanced or near-balanced design; unbalanced designs require Type III sums of squares.
  • Does not support repeated-measures ANOVA; use specialized tools for within-subject designs.
  • Tukey HSD assumes equal group sizes; Games-Howell is preferred for unequal variances.
  • Common failure: too few observations per group (n < 5) makes tests unreliable.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.