Kruskal–Wallis one-way analysis of variance

From Hidden Wiki
Jump to navigation Jump to search

The Kruskal–Wallis test by ranks, Kruskal–Wallis H test[1] (named after William Kruskal and W. Allen Wallis), or one-way ANOVA on ranks[1] is a non-parametric method for testing whether samples originate from the same distribution.[2][3][4] It is used for comparing two or more independent samples of equal or different sample sizes. It extends the Mann–Whitney U test, which is used for comparing only two groups. The parametric equivalent of the Kruskal–Wallis test is the one-way analysis of variance (ANOVA).

A significant Kruskal–Wallis test indicates that at least one sample stochastically dominates one other sample. The test does not identify where this stochastic dominance occurs or for how many pairs of groups stochastic dominance obtains. For analyzing the specific sample pairs for stochastic dominance, Dunn's test,[5] pairwise Mann–Whitney tests with Bonferroni correction,[6] or the more powerful but less well known Conover–Iman test[6] are sometimes used.

Since it is a non-parametric method, the Kruskal–Wallis test does not assume a normal distribution of the residuals, unlike the analogous one-way analysis of variance. If the researcher can make the assumptions of an identically shaped and scaled distribution for all groups, except for any difference in medians, then the null hypothesis is that the medians of all groups are equal, and the alternative hypothesis is that at least one population median of one group is different from the population median of at least one other group.

Method

  1. Rank all data from all groups together; i.e., rank the data from 1 to N ignoring group membership. Assign any tied values the average of the ranks they would have received had they not been tied.
  2. The test statistic is given by:
    <math>H = (N-1)\frac{\sum_{i=1}^g n_i(\bar{r}_{i\cdot} - \bar{r})^2}{\sum_{i=1}^g\sum_{j=1}^{n_i}(r_{ij} - \bar{r})^2},</math> where:
    • <math>n_i</math> is the number of observations in group <math>i</math>
    • <math>r_{ij}</math> is the rank (among all observations) of observation <math>j</math> from group <math>i</math>
    • <math>N</math> is the total number of observations across all groups
    • <math>\bar{r}_{i\cdot} = \frac{\sum_{j=1}^{n_i}{r_{ij}}}{n_i}</math> is the average rank of all observations in group <math>i</math>
    • <math>\bar{r} =\tfrac 12 (N+1)</math> is the average of all the <math>r_{ij}</math>.
  3. If the data contain no ties the denominator of the expression for <math>H</math> is exactly <math>(N-1)N(N+1)/12</math> and <math>\bar{r}=\tfrac{N+1}{2}</math>. Thus
    <math>

\begin{align} H & = \frac{12}{N(N+1)}\sum_{i=1}^g n_i \left(\bar{r}_{i\cdot} - \frac{N+1}{2}\right)^2 \\ & = \frac{12}{N(N+1)}\sum_{i=1}^g n_i \bar{r}_{i\cdot }^2 -\ 3(N+1) \end{align} </math>
The last formula only contains the squares of the average ranks.

  1. A correction for ties if using the short-cut formula described in the previous point can be made by dividing <math>H</math> by <math>1 - \frac{\sum_{i=1}^G (t_i^3 - t_i)}{N^3-N}</math>, where G is the number of groupings of different tied ranks, and ti is the number of tied values within group i that are tied at a particular value. This correction usually makes little difference in the value of H unless there are a large number of ties.
  2. Finally, the decision to reject or not the null hypothesis is made by comparing <math>H</math> to a critical value <math>H_c</math> obtained from a table or a software for a given significance or alpha level. If <math>H</math> is bigger than <math>H_c</math>, the null hypothesis is rejected. If possible (no ties, sample not too big) one should compare <math>H</math> to the critical value obtained from the exact distribution of <math>H</math>. Otherwise, the distribution of H can be approximated by a chi-squared distribution with g-1 degrees of freedom. If some <math>n_i</math> values are small (i.e., less than 5) the exact probability distribution of <math>H</math> can be quite different from this chi-squared distribution. If a table of the chi-squared probability distribution is available, the critical value of chi-squared, <math>\chi^2_{\alpha: g-1}</math>, can be found by entering the table at g − 1 degrees of freedom and looking under the desired significance or alpha level.
  3. If the statistic is not significant, then there is no evidence of stochastic dominance between the samples. However, if the test is significant then at least one sample stochastically dominates another sample. Therefore, a researcher might use sample contrasts between individual sample pairs, or post hoc tests using Dunn's test, which (1) properly employs the same rankings as the Kruskal–Wallis test, and (2) properly employs the pooled variance implied by the null hypothesis of the Kruskal–Wallis test in order to determine which of the sample pairs are significantly different.[5] When performing multiple sample contrasts or tests, the Type I error rate tends to become inflated, raising concerns about multiple comparisons.

Exact probability tables

A large amount of computing resources is required to compute exact probabilities for the Kruskal–Wallis test. Existing software only provides exact probabilities for sample sizes less than about 30 participants. These software programs rely on asymptotic approximation for larger sample sizes.

Exact probability values for larger sample sizes are available. Spurrier (2003) published exact probability tables for samples as large as 45 participants.[7] Meyer and Seaman (2006) produced exact probability distributions for samples as large as 105 participants.[8]

Exact distribution of <math>H</math>

Choi et al.[9] made a review of two methods that had been developed to compute the exact distribution of <math>H</math>, proposed a new one, and compared the exact distribution to its chi-squared approximation.

See also

References

1 }}
     | references-column-width 
     | references-column-count references-column-count-{{#if:1|{{{1}}}}} }}
   | {{#if: 
     | references-column-width }} }}" style="{{#if: 
   | {{#iferror: {{#ifexpr: 1 > 1 }}
     | Template:Column-width
     | Template:Column-count }}
   | {{#if: 
     | Template:Column-width }} }} list-style-type: {{#switch: 
   | upper-alpha
   | upper-roman
   | lower-alpha
   | lower-greek
   | lower-roman = {{{group}}}
   | #default = decimal}};">
  1. 1.0 1.1 Kruskal–Wallis H Test using SPSS Statistics, Laerd Statistics
  2. Template:Cite journal
  3. Template:Cite book
  4. Template:Cite book
  5. 5.0 5.1 Template:Cite journal
  6. 6.0 6.1 Template:Cite report
  7. Template:Cite journal
  8. Template:Cite journal Critical value tables and exact probabilities from Meyer and Seaman are available for download at http://faculty.virginia.edu/kruskal-wallis/ Template:Webarchive. A paper describing their work may also be found there.
  9. Template:Cite journal

Further reading

External links

Template:Statistics