# st: Wilcoxon rank-sum (Mann-Whitney) test vs Kolmogorov Smirnov test

 From Delphine Irac <[email protected]> To [email protected] Subject st: Wilcoxon rank-sum (Mann-Whitney) test vs Kolmogorov Smirnov test Date Sat, 16 Jul 2005 18:49:34 +0200

```Dear Stata users:

I define two types of firms domestic ones (type 1) and exporting ones (type 0).
I want to test whether type 0 firms have higher average productivity
of labour (APL) than type 1, which graphical evidence seems to show by
plotting firm-level productivity distributions.
I run two tests:
ranksum l_APL, by(type_firm) porder
ksmirnov l_APL, by(type_firm)

Stata outcomes:

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

type_firm |      obs    rank sum    expected
-------------+---------------------------------
0 |      761      376455    364138.5
1 |      195       80991     93307.5
-------------+---------------------------------
combined |      956      457446      457446

----------

Ho: l_APL(type_f~m==0) = l_APL(type_f~m==1)
z =   3.580
Prob > |z| =   0.0003

P{l_APL(type_f~m==0) > l_APL(type_f~m==1)} = 0.583

Two-sample Kolmogorov-Smirnov test for equality of distribution functions:

Smaller group       D       P-value  Corrected
----------------------------------------------
0:                  0.0185    0.899
1:                 -0.1755    0.000
Combined K-S:       0.1755    0.000      0.000

I am confused:
Wilcoxon rank-sum (Mann-Whitney) test implies that type 0 firms have
higher productivity :
P{l_APL(type_f~m==0) > l_APL(type_f~m==1)} = 0.583
Whereas KS test shows that it is the opposite (.899 as a pvalue when
testing that type 0 is smaller).

I guess that there is something I am misunderstanging but I cannot
understand why. Thanks so much for helping!!

Delphine

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```