stat-compare-multiple-groups
Compare a continuous variable across three or more groups using one-way ANOVA or Kruskal-Wallis with post-hoc testing.
- License 许可
- MIT
- 最近更新
- 2026-11-03
- Stars
- ★ 4
- Forks
- 1
01 前言 Front Matter
- name
- stat-compare-multiple-groups
- description
- Compare a continuous variable across three or more groups using one-way ANOVA or Kruskal-Wallis with post-hoc testing.
02 资源文件 3
- 参考文档agents/claude.yaml381 B
- 参考文档agents/openai.yaml382 B
- 参考文档config.yaml318 B
03 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) ordunn(default for Kruskal-Wallis) - Output directory (default:
./multigroup_output)
Workflow
- Read data; validate that group column has three or more levels.
- Run normality tests (Shapiro-Wilk) within each group and run one global Levene's test across groups for homogeneity of variance.
- If all groups are normal and variances are approximately equal: one-way ANOVA.
- If second factor provided: two-way ANOVA with interaction term.
- If normality or homogeneity of variance is violated: Kruskal-Wallis test.
- 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.
- Compute effect size: eta-squared (η²) for ANOVA, epsilon-squared for Kruskal-Wallis.
- Generate a box plot with all groups and pairwise significance brackets.
- Save the executable analysis script (
analysis_code.pyoranalysis_code.R) and software version manifest (session_info.txt) used to produce results. - Write results and plot (PDF) to output directory.
- 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.pyoranalysis_code.R, plussession_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.
04 同仓库更多 Skills
structured-intelligence-skill-creator
Create or update repository skills that conform to local templates, provider metadata requirements, registry rules, and validation workflows.
stat-survival-analysis
Estimate and compare survival functions using Kaplan-Meier curves and log-rank test, with optional Cox proportional hazards regression.
stat-pca
Perform PCA on a numeric data matrix to reduce dimensionality, visualize sample structure, and identify top contributing features.
stat-pairwise-correlation
Compute pairwise correlations and significance tests across all numeric variables, and produce a correlation heatmap.
stat-nonlinear-embedding
Embed high-dimensional data into 2D using t-SNE or UMAP for exploratory visualization of sample or cell relationships.
stat-logistic-regression
Fit a logistic regression model for binary outcomes, report odds ratios and model performance (AUC-ROC, confusion matrix).