Skip to content

Wilcoxon test p value with one decimal place

4 messages · Jun Shen, Bert Gunter, (Ted Harding) +1 more

#
On Thu, Feb 16, 2012 at 10:15 AM, Jun Shen <jun.shen.ut at gmail.com> wrote:
No, it's discrete  :-)

(Actually, that's the answer. Read up on the Mann-Whitney test to see why).

-- Bert

Thanks.

  
    
#
On 16-Feb-2012 Bert Gunter wrote:
To expand on Bert's reply:

Given two sets of 3 numbers (x,y,z), (X,Y,Z) with x < y < z
and X < Y < Z, there are exactly 20 ways to merge them together
(according to possible relationships between the values in the
first and the second):

  x < y < z < X < Y < Z
  x < y < X < z < Y < Z
  x < y < X < Y < z < Z
  x < y < X < Y < Z < z
  [and so on until]
  X < Y < x < Z < y < z
  X < Y < Z < x < y < z

Your example  is the first of these so has probability 1/20.
Since the default for wilcox.test is "two.sided", the result
takes into account also arrangements which are at least as
extreme as the one given, of which the only case is the last
one in the above list, which also has probability 1/20.

Hence the 2-sided P-value is 1/20 + 1/20 = 1/10, which is
exactly 0.1, as returned by wilcox.test(). It would be possible
to display the result as 0.10000, say, but there is no point!

If you do

  wilcox.test(a,b, alternative="less")

then you will get 0.05 as P-value -- again exactly right.

Ted.

-------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at wlandres.net>
Date: 16-Feb-2012  Time: 18:57:08
This message was sent by XFMail
#
Well, it depends on what your p-value is.  If you try

w <- wilcox.test(a,b)
print(w$p.value, digits=20)

you will see that it is a rounding / printing issue


Hope this is helpful,

Dan

Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204