Hello.
The following matlab code generates two vectors of
1000 uniformally random numbers and uses Wilcoxon
ranksum test for assessing whether two samples of
observations come from the same distribution. The code repeats
this process for 100 times and calculates histogram of the
resulting p values.
My naive assumption was that this histogram will be distributed
around a number very close to 1. However, as you can see,
it is almost uniformally distributed over the entire range
between 0 and 1.
Is there somethin I miss in understanding of rank sum test?
Thanks
>> pv = [];
>> n = 1000;
>> for i=1:100;
a = rand(n, 1);
b = rand(n,1);
pv = [pv, ranksum(a,b)];
end;
>> [n, x] = hist(pv);
>> [x', n']
ans =
0.0530 7.0000
0.1521 6.0000
0.2512 16.0000
0.3502 8.0000
0.4493 10.0000
0.5484 9.0000
0.6475 8.0000
0.7466 13.0000
0.8457 12.0000
0.9447 11.0000
|