Nonparametric Tests

Several nonparametric tests are available. As usual, this section mentions only a few possibilities. Currently, these refer to an outcome variable that indicates ranks (or that can, and should, be ranked, such as a non-normal metric variable), and a grouping variable. Note that if your data do not represent ranks, Stata will do the ranking for you.

Two groups

For two groups, you might use Wilcoxon's rank sum test (which is equivalent to Mann and Whitney's U test), or the median test. The commands for these tests go like this:

ranksum income, by(sex)

median income, by(sex)

For the median test, option exact is available that computes an exact test according to Fisher.

More than two groups

In this case, you might use the Kruskal-Wallis test. If the groups represent some kind or order, a test for trend across groups is available.

kwallis income, by(firmsize)

nptrend income, by(firmsize)

© W. Ludwig-Mayerhofer, Stata Guide | Last update: 21 Dec 2010