# Kruskal–Wallis H test (/docs/analyses/kruskal-wallis)



## When to use it [#when-to-use-it]

Use Kruskal–Wallis instead of a [one-way ANOVA](/docs/analyses/anova-oneway) when you have three or more groups and the scores are ordinal or skewed.

## Assumptions [#assumptions]

Groups are independent. The outcome is at least ordinal. The test does not tell you which groups differ until you turn on post hoc.

## Running it in Tensr [#running-it-in-tensr]

<Steps>
  <Step>
    Analyze → Nonparametric Tests → K Independent Samples. In chat: “Kruskal–Wallis of score by method.”
  </Step>

  <Step>
    Group column and value column are required. Post hoc starts off.
  </Step>
</Steps>

## Options [#options]

<TypeTable
  type="{
  group_column: { type: 'string', description: 'Three or more groups.' },
  value_column: { type: 'string', description: 'Score to rank.' },
  post_hoc: {
    type: 'boolean',
    description: 'Pairwise Mann–Whitney tests with a Bonferroni adjustment.',
    default: 'false',
  },
  confidence_level: { type: 'number', description: 'Accepted on the request.', default: '0.95' },
  decimal_places: {
    type: '0–6',
    description: 'Report output. Decimal places.',
    default: '3',
  },
  apa_format: {
    type: 'boolean',
    description: 'Report output. APA-style p-values.',
    default: 'true',
  },
  include_charts: {
    type: 'boolean',
    description: 'Report output. Shared chart switch.',
    default: 'true',
  },
}"
/>

## Reading the output [#reading-the-output]

The three teaching methods, compared on ranks. The same moderate mean gap as the ANOVA, read without assuming a normal curve.

| Group    |  n | Median | Status   |
| -------- | -: | -----: | -------- |
| Lecture  | 32 |   69.1 | included |
| Online   | 32 |  71.05 | included |
| Workshop | 32 |  72.95 | included |

Kruskal-Wallis test of `score` by `method` (3 groups) on 96 rows. Effect size ε² = 0.076 (small; ε² \< 0.01 negligible, 0.01 ≤ ε² \< 0.08 small, 0.08 ≤ ε² \< 0.26 medium, ε² ≥ 0.26 large). Cutoffs: Mangiafico, 2016. The primary result is significant (p = .027). This is large enough, in this sample, to treat the comparison this page is about as a real association rather than noise. Metrics: H statistic = 7.22; p-value = .027; ε² = 0.076; Effect size = small.

## Reporting (APA 7) [#reporting-apa-7]

Kruskal-Wallis test of `score` by `method` (3 groups) on 96 rows. Effect size ε² = 0.076 (small; ε² \< 0.01 negligible, 0.01 ≤ ε² \< 0.08 small, 0.08 ≤ ε² \< 0.26 medium, ε² ≥ 0.26 large). Cutoffs: Mangiafico, 2016. This result is significant (p = .027). The effect is moderate, so report its size with the p-value.

## Coming from SPSS [#coming-from-spss]

Analyze → Nonparametric Tests → K Independent Samples.
