08-15-2012 09:58 PM
hi i am trying to do a program which does a wilcoxon signed ranked test . However i discover that the result from labview differs from that for matlab . Is that some possible reason ?
Data Used
A : 5 6 3 6 7 2 5 6 8
B : 8 6 0 7 4 5 9 3 7
labview p value 0.0468
matlab p value 0.9036
Thank you.
08-16-2012 02:06 AM
08-16-2012 04:42 AM
Hi GerdW,
I have attached the file as requested . As i am unable to attach the . file the code is as follows ,
x = [ 5 6 3 6 7 2 5 6 8];
y = [8 6 0 7 4 5 9 3 7 ];
[p, h] = signrank(x,y,'alpha',0.05);
disp(p);
disp(h);
Thank you .
I have made a mistake regarding the p values it should be 0.9219 -> matlab , 0.7421 -> labview .
08-20-2012 11:17 AM
Hi seanpps2,
It does seem strange that these two pieces of software get different answers.
Do you know which one is the answer you expect?
I have submitted this issue to R&D for investigation.
08-20-2012 09:02 PM
Hi Alisha,
Unfortunately i do not have a standard answer for the stats. test. Do you have any idea of a posible timeline with regards to the problem as we are looking to integrate this into our product. Thank you for your assistance.
08-21-2012 01:55 AM
08-21-2012 02:27 PM
Hi sean,
At this point, we don't have much knowledge about what is going on, whether there is anything wrong with this calculation or not so we don't have any timeline at this point.
A dataset with known results would indeed be helpful.
08-21-2012 08:53 PM
Hi ,
I have tested with several stats. software such as SPSS and miniTab . It seems that for the above mentioned dataset different result are obtained. That why it is rather hard to provide a sample dataset with a known value .
For instance for the below dataset
X : 12 13 15 19 20 21 27
Y : 18 23 24 30 32 35 40
BOTH labview and matlab obtained a result of 0.0156. However , this dataset is obtained from a college textbook(reliable source i believed) , Statistic for Engineer and Scientist (William Navidi) and it shows an answer of 0.0174.
Thank you .
08-21-2012 10:12 PM
There are some serious flaws in the LV implementation. Your last dataset is immune because the values for the differences are unique. The serious issues with the LV version include:
1. The rank of multiple ties is averaged, all zeros should be ignored. Instead the rank of two ties are each 0.5, the rank of three ties is 2. This error propogates through the remaining rank values. The lowest non-tied value should have rank 1.
3. The ranks are converted to I32 after the Rank Transformation VI, this rounds off the 0.5 values from ties and again gives erroneous results.
4. For some reason the rank is incremented after it is converted to I32, this probably worked in some special case, but not in general.
5. In the lookup table (for small samples like this), the index array should probably be Interpolate 1D array instead. In cases with ties, you get a better match.
With these fixed I get reasonable, but not perfect agreement with Matlab (I get p=0.8945 for your first dataset). Mathematica gives me slightly different results still, actually closer to the LV value (p=0.8854).
08-22-2012 09:52 PM
Hi Darin ,
Thank you for your explaination. Do you mind if you share your implementation ?
Regards