When you need to compare three or more groups but your data doesn't follow a perfect bell curve, the Kruskal-Wallis test is your primary choice. It looks at the rank order of your data rather than the exact values, making it a reliable way to spot true differences in messy, skewed, or outlier-prone datasets.
Understanding Group Differences by Rank
The Kruskal-Wallis test organizes your observations by rank—essentially sorting every data point from smallest to largest across all groups. Instead of calculating the average, it evaluates whether the sum of these ranks differs significantly across your categories.
This approach ensures that individual extreme values (outliers) do not disproportionately influence your results. By stripping away the requirement for precise distribution assumptions, it allows you to derive clear insights from datasets that are too messy for traditional parametric tests.
Interpreting Effect Size
Once the test is complete, Lattice provides an effect size known as epsilon squared. This metric quantifies the magnitude of the differences observed, categorized as small, medium, or large.
Understanding the effect size helps you decide if a 'statistically significant' result actually matters for your business or research goals. A very small p-value combined with a negligible effect size suggests that while a difference is detectable, it may not be practically meaningful.
Automatic Post-Hoc Guidance
If the Kruskal-Wallis test returns a significant result, you have confirmed that a difference exists, but you do not yet know where that difference lies. Lattice automatically flags the need for further investigation.
When this occurs, the platform prompts you to run a post-hoc analysis, such as Dunn's test. This step is essential to determine which specific groups are driving the variation, allowing you to move from general discovery to actionable conclusions.
1 · Intent → method
An LLM picks svt_run_kruskal from a fixed catalog.
2 · Method → numbers
Deterministic Python engine runs the math. Same input → same output.
3 · Numbers → plain language
A second LLM translates the result into your domain’s vocabulary.
Why use Kruskal-Wallis instead of ANOVA?
ANOVA assumes your data is normally distributed and that the variance across groups is equal. If your data is skewed or has outliers, the Kruskal-Wallis test provides a more accurate result because it is based on data ranks rather than the sensitivity of the mean.
What do I do if the test result is significant?
A significant Kruskal-Wallis result tells you that at least one group is different from the others. Lattice will suggest performing a Dunn's test, which acts as a post-hoc analysis to pinpoint exactly which specific pairs of groups are different from one another.
Tool input schema
Schema for svt_run_kruskal not exported yet (run pnpm export:registry).