Software to Simplify Statistical Practice ...

Kruskal-Wallis Rank Sum Test



The data are from a comparison of four investment firms. The observations represent percentage of growth during a three month period for recommended funds.





  1. Open the DataBook growth.vstz
  2. Choose the menu Data
  3. Choose the menu Analyze and the command Kruskal-Wallis
  4. In Variable, select investment
  5. In Grouping Variable, select firms
  6. Click OK




By default, R code is printed after parsing and before evaluation.
You can avoid this in File / Option / Advanced menu.

DataSheet is converted to DataFrame, in the form DataBook.DataSheet

> tapply($investment,$firms, median, na.rm = TRUE)

  A   B   C   D
4.1 2.8 2.1 3.7


> kruskal.test(formula = investment ~ firms, data =


       Kruskal-Wallis rank sum test


data:  investment by firms
Kruskal-Wallis chi-squared = 13.6904, df = 3, p-value = 0.003358