StatLabStudent EditionUser guideGalleryFeaturesAbout

Kruskal-Wallis, median and Jonckheere-Terpstra tests

Compares three or more independent groups using ranks (Kruskal-Wallis), counts above the pooled median (median test), or tests an ordered trend across groups (Jonckheere-Terpstra).

Menu: Analyze → Nonparametric Tests → Legacy Dialogs → K Independent Samples…

When should I use it?

What are the assumptions?

How do I run it in StatLab?

  1. Choose outcome(s) and the grouping variable (optional code range).
  2. Keep 'Pairwise comparisons' ticked to see which groups differ (Dunn test, Bonferroni-adjusted).
  3. Choose Significance = Exact or Monte Carlo for small samples or sparse data.

How do I read the output?

OutputMeaning
Kruskal-Wallis H, df, Asymp. Sig.Overall test across all groups.
Pairwise ComparisonsDunn tests; read 'Adj. Sig.' (Bonferroni).
Std. J-T StatisticPositive = values rise with group order.
Exact Sig. / Point ProbabilityPermutation p-value using every possible arrangement of the data.
Monte Carlo Sig. (99% CI)Estimated from 10,000 random arrangements (seed 2000000); the interval shows its precision.

Worked example

On the practice survey dataset (File → Sample dataset), this command — which the dialog's Paste button also produces — runs the procedure:

PROC npKIndep /vars=(score age) /group=group /kw=YES /dunn=YES /median=NO /jt=NO /sig=asymp.

Output tables: Ranks · Test Statistics · Pairwise Comparisons of Programme group — Wellbeing score · Pairwise Comparisons of Programme group — Age (years).

How would I report it in APA style?

A Kruskal-Wallis test on Wellbeing score gave H(2) = 5.27, p = .072, ε² = .04. A Kruskal-Wallis test on Age (years) gave H(2) = 1.75, p = .416, ε² = .01.

Computed by StatLab's validated procedure code when this page was built. The example only illustrates the steps; choose variables that fit your own research question.

What are common mistakes?

Open StatLab   All guide topics