it is answered in many books on non-parametric statistics. You may go through the book Sheskin. Handbook of parametric and nonparametric statistical procedures (CRC, 2000)(ISBN 158488133X). few lines from the book,
The Kruskal-Wallis one-way analysis of variance by ranks (Kruskal A952) and Kruskal and Wallis A952)) is employed with ordinal (rank- order) data in a hypothesis testing situation involving a design with two or more independent samples. The test is an extension of the Mann-Whitney U test (Test 12) to a design involving more than two independent samples and, when к = 2, the Kruskal-Wallis one-way analysis of
variance by ranks will yield a result that is equivalent to that obtained with the Mann-Whitney U test. If the result of the Kruskal-Wallis one-way analysis of variance by ranks is significant, it indicates there is a significant difference between at least two of the sample medians in the set of к medians. As a result of the latter, the researcher can conclude there is a high likelihood that at least two of the samples represent populations with different median values.
In employing the Kruskal-Wallis one-way analysis of variance by ranks one of the
following is true with regard to the rank-order data that are evaluated: a) The data are in a rank- order format, since it is the only format in which scores are available; or b) The data have been transformed into a rank-order format from an interval/ratio format, since the researcher has reason to believe that one or more of the assumptions of the single-factor between-subjects analysis of variance (Test 21) (which is the parametric analog of the Kruskal-Wallis test) are saliently violated. It should be noted that when a researcher elects to transform a set of interval/ratio data into ranks, information is sacrificed. This latter fact accounts for why there is reluctance among some researchers to employ nonparametric tests such as the Kruskal-Wallis
one-way analysis of variance by ranks, even if there is reason to believe that one or more of the assumptions of the single-factor between-subjects analysis of variance have been violated.
Various sources (e.g., Conover A980, 1999), Daniel A990), and Marascuilo and
McSweeney A977)) note that the Kruskal-Wallis one-way analysis of variance by ranks is based on the following assumptions: a) Each sample has been randomly selected from the population it represents; b) The к samples are independent of one another; c) The dependent vari- able (which is subsequently ranked) is a continuous random variable. In truth, this assumption, which is common to many nonparametric tests, is often not adhered to, in that such tests are often employed with a dependent variable that represents a discrete random variable; and d) The underlying distributions from which the samples are derived are identical in shape. The shapes of the underlying population distributions, however, do not have to be normal. Maxwell and Delaney A990) point out that the assumption of identically shaped distributions implies equal