SECTION 15.21 KRUSKAL-WALLIS TEST

The Kruskal-Wallis test tests the null hypothesis that k independent samples, where
each sample contains *n _{i}, i=1,...,k* measurements, are from the same population.
See S. Siegel and N. J. Castellan,

Be sure to CALL DFLT before calling KRUSKALW and to include the COMMON/BPRINT/ common block. The call is

CALL KRUSKALW(X,NJ,NMAX,K,WK,IER) where X = a single precision array of sample values, dimensioned X(NMAX,K) (input) NJ = array dimensioned NJ(K) containing as elements the number of sample values in the ith sample (input) NMAX = the largest element of NJ (input) K = the number of samples (input) WK = The Kruskal-Wallis test statistic (output) IER = error return (=-3 input error)

15.21.1 CONVERTING REAL NUMBERS TO RANKS

Converting real numbers to ranks is normally straightforward, except when ties occur. If this is the case, use

CALL SORT1A(X,N) CALL CNVRT(X,RANKS,N)

where

X = is a single precision array dimensioned X(N) (input) RANKS = is a single precision array dimensioned RANKS(N) (output) N = is the number of elements in the array (input)SORT1A first sorts the values in X. Upon exiting from CNVRT, RANKS (a REAL array) will contain the ranks.

15.21.2 CALCULATING THE ADJUSTMENT FOR TIES

Several nonparametric tests calculate an adjustment for ties. This is based on
the *1 - SUM(t _{i}^{3} - t)/(n^{3} - n)* over

CALL COUNTTIE(RANKS,TX,N)

where RANKS and N have the same meaning as in the previous subsection and TX is the calculated measure.

Return to