Kruskal–Wallis test

From WikiMD's Food, Medicine & Wellness Encyclopedia

Difference_between_ANOVA_and_KW_test
Example_of_assigning_any_tied_values_the_average_of_the_rank
Ozone_by_month_boxplots

== Kruskal–Wallis test ==

The Kruskal–Wallis test is a non-parametric method for testing whether samples originate from the same distribution. It is used for comparing two or more independent samples of equal or different sample sizes. The test extends the Mann–Whitney U test, which is used for comparing only two groups. It is named after William Kruskal and W. Allen Wallis.

Overview[edit | edit source]

The Kruskal–Wallis test is used when the assumptions of ANOVA (analysis of variance) are not met, particularly the assumption of normality. It is an alternative to the one-way ANOVA and is used when the data is ordinal or when the assumptions of ANOVA are not satisfied.

Assumptions[edit | edit source]

The Kruskal–Wallis test makes the following assumptions:

  • The samples are independent.
  • The dependent variable is measured at least at the ordinal level.
  • The distributions of the groups are similar in shape.

Procedure[edit | edit source]

1. Rank all the data from all groups together. 2. Calculate the sum of ranks for each group. 3. Compute the test statistic H using the formula:

 \[
 H = \left( \frac{12}{N(N+1)} \sum \frac{R_i^2}{n_i} \right) - 3(N+1)
 \]
 where \( N \) is the total number of observations, \( R_i \) is the sum of ranks for the i-th group, and \( n_i \) is the number of observations in the i-th group.

4. Compare the test statistic H to the chi-square distribution with \( k-1 \) degrees of freedom, where \( k \) is the number of groups.

Interpretation[edit | edit source]

If the calculated H value is greater than the critical value from the chi-square distribution table, the null hypothesis that all groups have the same distribution is rejected. This indicates that at least one group distribution is different from the others.

Applications[edit | edit source]

The Kruskal–Wallis test is widely used in various fields such as psychology, medicine, education, and agriculture to compare the effectiveness of different treatments or conditions.

Related Tests[edit | edit source]

See also[edit | edit source]

Wiki.png

Navigation: Wellness - Encyclopedia - Health topics - Disease Index‏‎ - Drugs - World Directory - Gray's Anatomy - Keto diet - Recipes

Search WikiMD


Ad.Tired of being Overweight? Try W8MD's physician weight loss program.
Semaglutide (Ozempic / Wegovy and Tirzepatide (Mounjaro / Zepbound) available.
Advertise on WikiMD

WikiMD is not a substitute for professional medical advice. See full disclaimer.

Credits:Most images are courtesy of Wikimedia commons, and templates Wikipedia, licensed under CC BY SA or similar.

Contributors: Prab R. Tumpati, MD