Why I am getting Same p-value, h and stats while using Wilcoxon Rank test for 7 different data set?

1 ビュー (過去 30 日間)
Meghraj Kc
Meghraj Kc 2022 年 6 月 13 日
編集済み: the cyclist 2022 年 6 月 13 日
I am trying to find the significant realtion between the az_solar and Mean_Surface_REF of seven different bands using Wilcoxon rank test. But I am geeting same p-value and statistics for every bands. However, each band contains different value.
Would some one please help me regrading these issue?
%% This is the code i am using
[p1,h1,stats1] = ranksum(az_solar,Mean_Surface_REF(:,1));
[p2,h2,stats2] = ranksum(az_solar,Mean_Surface_REF(:,2));
[p3,h3,stats3] = ranksum(az_solar,Mean_Surface_REF(:,3));
[p4,h4,stats4] = ranksum(az_solar,Mean_Surface_REF(:,4));
[p5,h5,stats5] = ranksum(az_solar,Mean_Surface_REF(:,5));
[p6,h6,stats6] = ranksum(az_solar,Mean_Surface_REF(:,5));
[p7,h7,stats7] = ranksum(az_solar,Mean_Surface_REF(:,7));
Results:
8.1275311e-44
8.1275311e-44
8.1275311e-44
8.1275311e-44
8.1275311e-44
8.1275311e-44
8.1275311e-44
Also, I have attached my dataset.

採用された回答

dpb
dpb 2022 年 6 月 13 日
taz=readmatrix('az_solar.xlsx').';
>> [mean(taz) std(taz)]
ans =
138.9109 16.7621
>>
>> mnref=readmatrix('Mean_Surface_REF.xlsx');
>> [mean(mnref); std(mnref)]
ans =
0.0030 0.0065 0.0166 0.0093 0.0013 0.0045 0.0049
0.0034 0.0023 0.0043 0.0034 0.0039 0.0053 0.0052
>>
pretty-much explains it -- the means are some 4-5 orders of magnitude between the one vector and any of the vectors in the array. You've just totally saturated the value of the test statistic to the point the p-value returned is essentially zero.
You'd have been able to determine this yourself if you had simply looked at your data before blindly throwing it at some test statistic.
>> [p,h,stats]=ranksum(taz,mnref(:,1))
p =
8.0633e-44
h =
logical
1
stats =
struct with fields:
zval: 13.8827
ranksum: 25026
>> format long, format compact
>> 1-normcdf(stats.zval)
ans =
0
>> normcdf(stats.zval)
ans =
1
>> normcdf(stats.zval)
ans =
1
>>

その他の回答 (1 件)

the cyclist
the cyclist 2022 年 6 月 13 日
編集済み: the cyclist 2022 年 6 月 13 日
That test statistic only depends on the count and relative ordering of the respective set elements. In your case, it looks like the counts are always the same, and (as @dpb points out), your 7 cases are always completely offset from the comparator set.
Here is a small example showing the same thing:
x = 1:5;
y1 = 101:105; % 5 elements, fully offset from x
y2 = 1001:1005; % Also 5 elements, fully offset from x [same result]
y3 = 101:103; % 3 elements, still fully offset [different result due to different count]
ranksum(x,y1)
ans = 0.0079
ranksum(x,y2)
ans = 0.0079
ranksum(x,y3)
ans = 0.0357

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by