[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Two-sided P value for Wilcoxon (Mann-Whitney) rank-sum test

From   "Newson, Roger B" <>
To   <>
Subject   st: RE: Two-sided P value for Wilcoxon (Mann-Whitney) rank-sum test
Date   Thu, 2 Oct 2008 15:50:41 +0100

The P-value given by -ranksum- is in fact 2-sided. That is why it is given as

    Prob> |z| =   0.7003

where z is the asymptotically standard Normal test statistic and  |z| is its modulus (or absolute value). Most people prefer a 2-valued P-value, and a lot of people are confused by the multiple P-values given by -ttest-.

If you want to calculate confidence intervals (as well as P-values) for rank statistics, then you might use the -somersd- package, which you can download from SSC, and which calculates confidence intervals for a range of rank statistics, such as Kendall's tau-a, Somers' D, and median slopes, differences and ratios. A few documents, papers and presentations on the -somersd- package can be downloaded from my website. (See my signature below.)

I hope this helps.

Best wishes


Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Web page:
Departmental Web page:

Opinions expressed are those of the author, not of the institution.

-----Original Message-----
From: [] On Behalf Of Andres Gonzalez Rangel
Sent: 02 October 2008 15:13
Subject: st: Two-sided P value for Wilcoxon (Mann-Whitney) rank-sum test

Dear Sirs,

It is possible to make a two-sided test in a non-parametric command like ranksum?  I know that signtest can, but it needs the format "signtest var1 = var2", and I need something like "signtest var, by(group)" which is only allowed with ranksum.

The problem is that, contrary to ttest which returns one-sided and two-sided tests of significance for alternative hypothesis, ranksum returns only one P value, which I suppose is a one-sided test of significance for the Ho.

. ranksum var, by(group)
Two-sample Wilcoxon rank-sum (Mann-Whitney) test
      group  |      obs    rank sum    expected
          no |       39        1842        1794
         yes |       52        2344        2392
    combined |       91        4186        4186
unadjusted variance    15548.00
adjustment for ties       -1.98
adjusted variance      15546.02
Ho: tnfap(group==no) = tnfap(group==yes)
             z =   0.385
    Prob> |z| =   0.7003

I need the Pr of Ho against Ha: diff != 0, like ttest does

Thanks in advance for your kind help.

Best Regards,

Andrés González Rangel
Epidemiology Graduate Student
See how Windows Mobile brings your life together-at home, work, or on the go.
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index