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

stat-compare-two-groups

Skill4 starsChanged 12 days agoMITView on GitHub

Compare a continuous variable between two groups with automatic selection of t-test, Welch test, or Mann-Whitney U test based on data properties.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    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 exactly two levels.

    line 27
  2. Distinctive:

    Run normality test (Shapiro-Wilk) on each group separately.

    line 28
  3. Distinctive:

    If both groups are normal: run Levene's test for equal variance.

    line 29
  4. Distinctive:

    If either group is non-normal: Mann-Whitney U test (unpaired) or Wilcoxon signed-rank test (paired).

    line 32
  5. Distinctive:

    Write a structured result and plot (PDF) to output directory.

    line 36

≈ “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: Two-Group Statistical Comparison

Use When

  • User wants to test whether a continuous measurement differs between two experimental groups (e.g., treated vs. control, knockout vs. wild-type)
  • User needs a p-value, effect size, and confidence interval for a two-group comparison
  • User is unsure which statistical test is appropriate and wants automatic method selection

Inputs

  • Required:
    • Data table (CSV or TSV) with a numeric value column and a group column (exactly two group levels)
  • Optional:
    • Group variable column name (default: auto-detected if only one non-numeric column)
    • Value variable column name (default: auto-detected if only one numeric column)
    • Paired comparison: true or false (default: false)
    • Alternative hypothesis: two-sided (default), greater, or less
    • Output directory (default: ./compare_output)

Workflow

  1. Read data; validate that group column has exactly two levels.
  2. Run normality test (Shapiro-Wilk) on each group separately.
  3. If both groups are normal: run Levene's test for equal variance.
    • Equal variance (p > 0.05): Student's t-test.
    • Unequal variance (p ≤ 0.05): Welch's t-test.
  4. If either group is non-normal: Mann-Whitney U test (unpaired) or Wilcoxon signed-rank test (paired).
  5. Compute effect size: Cohen's d (parametric) or rank-biserial correlation r (non-parametric).
  6. Compute 95% confidence interval for the difference in means (parametric) or Hodges-Lehmann estimator (non-parametric).
  7. Generate a box plot with individual data points and significance annotation.
  8. Write a structured result and plot (PDF) to output directory.
  9. Report method used, test statistic, p-value, effect size, confidence interval, and interpretation.
  10. Save the executable analysis script (analysis_code.py or analysis_code.R) and software version manifest (session_info.txt) used to produce results.

Output Contract

  • Result (TSV): group1, group2, method_used, statistic, p_value, effect_size, effect_size_type, ci_lower, ci_upper, n_group1, n_group2
  • Box plot with data points (PDF)
  • Decision log explaining method selection (printed to stdout)
  • Reproducibility artifacts: analysis_code.py or analysis_code.R, plus session_info.txt

Limits

  • Requires exactly two groups; use stat-compare-multiple-groups for three or more groups.
  • Minimum recommended sample size: n ≥ 5 per group (results are unreliable below this).
  • Paired comparison requires equal sample sizes in both groups.
  • Common failure: group column contains more than two levels — filter data before running.

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.