StatFas emblem: a philosopher beside a rising bar chart StatFas.comAn Easy Way to Do Statistics
Upload Data, and Get Publishable Results in a Few Seconds in APA7 format Docx file

Kruskal–Wallis Test: How to Run It Online and Report It in APA7

The Kruskal–Wallis H test compares three or more independent groups using ranks. It is the non-parametric alternative to one-way ANOVA.

What is Kruskal–Wallis Test?

The Kruskal–Wallis H test compares three or more independent groups using ranks. It is the non-parametric alternative to one-way ANOVA.

When to use it

Use it for ordinal outcomes, skewed continuous data, small samples or unequal variances across three or more different groups.

Example question: Do three treatment groups differ in pain ratings?

Preparing your data

Long format: one row per participant, a group column with three or more categories and an outcome column.

Example dataset (simulated; first rows of 54): id, group (Group A, B or C), pain (0 to 10 rating).

idgrouppain
1Group A4
2Group A9
3Group A1
4Group A3
5Group A2
6Group A6

Download the full example CSV to practise. If the tool asks for a different layout, follow the instructions on its page.

How to run it on StatFas

  1. Open the Kruskal–Wallis Test tool. You do not need an account to run an analysis.
  2. Enter your data or upload your file, laid out as described in Preparing your data.
  3. Select your variables. Select the outcome and the grouping variable. Choose a post hoc test (Dunn's test with a multiple-comparison correction).
  4. Choose any options the tool offers (for example the confidence level, a post hoc test or the error bar type) and run the analysis.
  5. Read the results on the page. Check the assumptions first, then the test statistic, the p-value and the effect size.
  6. To save your results, log in or create a free account. Every analysis stays free; the account is only needed to download.

Assumptions and checks

  • The outcome is at least ordinal.
  • Independent observations; each participant is in one group.
  • To interpret it as a comparison of medians, group distributions should have a similar shape.
  • Each group should have at least about five cases for the chi-square approximation to be reasonable.

Key numbers to look at

  • H statistic (tie-corrected), df = groups − 1, and p.
  • Mean ranks for each group.
  • Post hoc Dunn tests with Bonferroni or Holm adjusted p-values.
  • Medians and interquartile ranges.

Effect size

Report η2H = (H − k + 1) / (n − k) or ε2; interpret like η2 (about .01 small, .06 medium, .14 large).

Benchmarks such as small, medium and large are conventions (Cohen, 1988), not rules. Interpret size in the context of your field.

Reporting Kruskal–Wallis Test in APA7 style

Template

Pain ratings differed significantly across the three groups, H(2) = XX.XX, p = .XXX, η2H = .XX. Dunn's post hoc tests with Bonferroni correction showed that Group A (Mdn = X.X) had lower ratings than Group C (Mdn = X.X), adjusted p = .XXX.

Worked example (simulated data)

The numbers below were computed from the example CSV above, so you can reproduce them. They illustrate the format and are not real findings.

Pain ratings differed significantly across the three groups, H(2) = 7.82, p = .020, η2H = .11. Dunn's post hoc test with Bonferroni correction showed that Group A (Mdn = 3.5) had lower ratings than Group C (Mdn = 5.0), z = −2.78, adjusted p = .016.

APA7 reminders: italicise statistical symbols (M, SD, t, F, p, r), report exact p-values to two or three decimals (use p < .001 for very small values), omit the leading zero for values that cannot exceed 1 (.45, not 0.45), and put degrees of freedom in parentheses. See the APA7 cheat sheet.

Common mistakes

  • Running pairwise Mann–Whitney tests without adjusting for multiple comparisons.
  • Using it when the same participants appear in several groups.
  • Claiming the medians differ when the distribution shapes are very different.

Not sure which analysis you need? Use the test chooser.

Frequently asked questions

What is the degrees of freedom for H?

The number of groups minus one.

Which post hoc test follows Kruskal–Wallis?

Dunn's test, with Bonferroni or Holm adjusted p-values, is the usual choice.

References

American Psychological Association. (2020). Publication manual of the American Psychological Association (7th ed.). https://doi.org/10.1037/0000165-000

Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Lawrence Erlbaum Associates.

This guide is for learning and for preparing results for your own reports. You remain responsible for choosing an appropriate analysis, checking its assumptions and interpreting the results. Follow the formatting rules of your journal or institution where they differ from APA7.