Page 231 - Applied Statistics Using SPSS, STATISTICA, MATLAB and R
P. 231

212      5 Non-Parametric Tests of Hypotheses


           5.4  Inference on More Than Two Populations

           In  the present  section, we describe non-parametric tests that have  parametric
           counterparts already described in section 4.5. Note that some of the tests described
           for contingency tables also apply to more than two independent samples.


           5.4.1 The Kruskal-Wallis Test for Independent Samples

           The Kruskal-Wallis test is the non-parametric counterpart of the one-way ANOVA
           test described in section 4.5.2. The test assesses whether c independent samples are
           from the same population or from populations with continuous distribution and the
           same median for the variable being tested. The variable being tested must be at
           least of ordinal type. The test procedure is a direct generalisation of the Mann-
           Whitney rank sum test described in section 5.3.1.2. Thus, one starts by assigning
           natural ordered ranks to the sample values, from the smallest to the largest. Tied
           ranks are substituted by their average.


           Commands 5.10.  SPSS,  STATISTICA,  MATLAB and R commands  used to
           perform the Kruskal-Wallis test.


             SPSS          Analyze; Nonparametric Tests; K
                           Independent Samples
             STATISTICA    Statistics; Nonparametrics; Comparing
                           multiple indep. samples (groups)

             MATLAB        p=kruskalwallis(x)

             R             kruskal.test(X~CLASS)



              Let  R i denote the sum of ranks for sample  i, with  n i cases. Under the null
           hypothesis, we expect that each R i will exhibit a small deviation from the average
           of all R i,  R . The test statistic is:

                      12   c
                                     2
              KW  =       ∑ n ( R  − R) ,                                  5.38
                    n( n  + )  = i 1  i  i
                        1

           which, under the null hypothesis, has an asymptotic chi-square distribution with
           df = c – 1  degrees of freedom (when the number of observations in each group
           exceeds 5).
              When there are tied ranks, a correction is inserted in formula 5.38, dividing the
           KW value by:
   226   227   228   229   230   231   232   233   234   235   236