Roboculator
Online CalculatorsCategoriesDate & EventsNews
Get Started
Online CalculatorsCategoriesDate & EventsNewsGet Started
Roboculator

Smart calculators for every challenge. Free, fast, and private.

Categories

  • Finance
  • Health
  • Math
  • Construction
  • Conversion
  • Everyday Life

Popular Tools

  • Date & Events
  • Loan Calculator
  • BMI Calculator
  • Percentage Calc
  • Latest News
  • Search All

Resources

  • Glossary
  • Topic Tags
  • News & Insights

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  • Editorial Policy
  • Disclaimer
© 2026 Roboculator. All rights reserved.
Roboculator

roboculator.com

  1. Home
  2. /Statistics
  3. /Statistical Inference & Hypothesis Testing
  4. /Kruskal-Wallis Test Calculator

Kruskal-Wallis Test Calculator

Calculator

Results

H Statistic

43.4

Degrees of Freedom

2

Total N

9

Rank Sum Group 1

19.5

Rank Sum Group 2

9

Rank Sum Group 3

34.5

Mean Rank Group 1

6.5

Mean Rank Group 2

3

Mean Rank Group 3

11.5

Results

H Statistic

43.4

Degrees of Freedom

2

Total N

9

Rank Sum Group 1

19.5

Rank Sum Group 2

9

Rank Sum Group 3

34.5

Mean Rank Group 1

6.5

Mean Rank Group 2

3

Mean Rank Group 3

11.5

The Kruskal-Wallis Test Calculator is the non-parametric alternative to one-way ANOVA for comparing three or more independent groups. Instead of comparing means, it compares the rank distributions of the groups, making it suitable for ordinal data or continuous data that violate ANOVA's normality assumption.

Enter values for three groups (up to 3 observations each) to compute the H-statistic, rank sums, and degrees of freedom. The H-statistic approximately follows a chi-square distribution under the null hypothesis.

Visual Analysis

How It Works

The Kruskal-Wallis test ranks all observations from all groups combined, then examines whether the rank sums differ more than expected by chance. The procedure is:

  1. Combine all observations and rank them from 1 to N
  2. Compute the rank sum \(R_i\) for each group
  3. Calculate the H-statistic

The test statistic is:

$$H = \frac{12}{N(N+1)} \sum_{i=1}^{k} \frac{R_i^2}{n_i} - 3(N+1)$$

Where \(N\) is the total sample size, \(k\) is the number of groups, \(n_i\) is the size of group \(i\), and \(R_i\) is the rank sum of group \(i\). Under the null hypothesis that all groups come from the same distribution, H approximately follows a chi-square distribution with \(k - 1\) degrees of freedom.

The expected rank sum for group \(i\) under H₀ is \(n_i(N+1)/2\). The H-statistic measures how much the observed rank sums deviate from these expected values. Larger H indicates greater between-group differences in rank distributions.

A tie correction factor can be applied: \(H_{corrected} = H / (1 - \sum(t^3 - t) / (N^3 - N))\), where \(t\) is the number of tied observations in each tied group.

Understanding Your Results

Interpreting the Kruskal-Wallis test results:

  • H-Statistic: Compare to the chi-square critical value with df = k − 1. For k = 3 groups and α = 0.05, the critical value is 5.991 (df = 2). If H > 5.991, reject the null hypothesis.
  • Rank Sums: Higher rank sums indicate groups with generally larger values. Compare each group's rank sum to its expected value ni(N+1)/2 to see which groups deviate.
  • Post-hoc Tests: A significant H only indicates that at least one group differs. Use Dunn's test or pairwise Mann-Whitney tests with Bonferroni correction to identify which specific groups differ.
  • Effect Size: Eta-squared for H: η² = (H − k + 1)/(N − k). Values of 0.01, 0.06, 0.14 correspond to small, medium, large effects.

Worked Examples

Three Drug Dosages

Inputs

g1n3
g1v17
g1v29
g1v311
g2n3
g2v14
g2v25
g2v38
g3n3
g3v112
g3v214
g3v315

Results

h statistic5.6
df2
grand n9
r1 sum14
r2 sum7
r3 sum24

Three dosage groups tested. H = 5.6 < 5.991 (critical at α=0.05, df=2), marginally non-significant. Group 3 has the highest rank sum, indicating higher values.

Soil Types and Plant Height

Inputs

g1n3
g1v12
g1v23
g1v34
g2n3
g2v16
g2v27
g2v310
g3n3
g3v112
g3v215
g3v318

Results

h statistic7.2
df2
grand n9
r1 sum6
r2 sum15
r3 sum24

Plant heights across three soil types. H = 7.2 > 5.991, indicating significant differences. Post-hoc tests would identify which soil types differ.

Frequently Asked Questions

Use Kruskal-Wallis when: (1) Data are ordinal (ranked), (2) The normality assumption of ANOVA is violated and samples are small, (3) Group variances are very different (heteroscedasticity), (4) Data contain extreme outliers. For normally distributed data, ANOVA is slightly more powerful. The Kruskal-Wallis test has approximately 95% of the power of ANOVA under normality.

Kruskal-Wallis is the k-group extension of the Mann-Whitney U test. When k = 2 groups, the Kruskal-Wallis H-statistic equals the square of the Mann-Whitney Z-statistic (H = Z²). Both are rank-based non-parametric tests, but Mann-Whitney handles exactly two groups while Kruskal-Wallis handles three or more.

Dunn's test is the most common post-hoc procedure, performing pairwise comparisons using rank sums with a correction for multiple comparisons (Bonferroni or Holm). Alternatively, perform pairwise Mann-Whitney U tests with a Bonferroni-adjusted significance level (α/number of comparisons). The Steel-Dwass-Critchlow-Fligner test is another option that controls familywise error.

Strictly, Kruskal-Wallis tests whether the groups come from the same distribution (stochastic equality). It tests medians only when group distributions have the same shape and spread. If distributions differ in shape, a significant result might reflect differences in spread rather than location. Always examine group distributions alongside the test result.

Under the null hypothesis, H approximately follows a chi-square distribution with k−1 degrees of freedom. This approximation improves with larger sample sizes. For very small samples (each ni < 5), exact tables of the Kruskal-Wallis distribution should be used instead. The approximation is generally adequate when each group has at least 5 observations.

Yes, Kruskal-Wallis naturally accommodates unequal group sizes — the formula adjusts for ni in each term. Unequal sizes are common in non-parametric settings. However, very unequal group sizes reduce power and can make the chi-square approximation less accurate. Balance your design when possible for maximum power.

Sources & Methodology

Kruskal, W.H. & Wallis, W.A. (1952). Use of Ranks in One-Criterion Variance Analysis. Journal of the American Statistical Association, 47(260), 583-621. | Conover, W.J. (1999). Practical Nonparametric Statistics, 3rd Edition. Wiley. | Dunn, O.J. (1964). Multiple Comparisons Using Rank Sums. Technometrics, 6(3), 241-252.
R

Roboculator Team

The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.

How helpful was this calculator?

Be the first to rate!

Related Calculators

P-Value Calculator

Statistical Inference & Hypothesis Testing

Confidence Interval Calculator

Statistical Inference & Hypothesis Testing

Margin of Error Calculator

Statistical Inference & Hypothesis Testing

Sample Size Calculator

Statistical Inference & Hypothesis Testing

Critical Value Calculator

Statistical Inference & Hypothesis Testing

Z-Test Calculator

Statistical Inference & Hypothesis Testing