[Scipy-tickets] [SciPy] #1744: Wilcoxon signed rank test validation on textbook example fails

SciPy Trac scipy-tickets@scipy....
Thu Oct 11 10:59:35 CDT 2012


#1744: Wilcoxon signed rank test validation on textbook example fails
-------------------------+--------------------------------------------------
 Reporter:  chris1869    |       Owner:  somebody         
     Type:  defect       |      Status:  new              
 Priority:  normal       |   Milestone:  StatisticsCleanup
Component:  scipy.stats  |     Version:  0.11.0           
 Keywords:  malfunction  |  
-------------------------+--------------------------------------------------
 Intro:

 ----

 I recently started using scipy for inference testing. For validation
 purpose I ran an example from a german textbook on inference testing using
 small samples.

 Problem:

 ----

 scipy raises:
 RuntimeWarning: invalid value encountered in sqrt in line 1289 (in the
 master branch, 1284 in my windows binary)

 Cause:

 ----
 I reviewed the code and it seems that ties and zero-differences are not
 treated according to this textbook.[1]

 Solution:

 ----
 The rank of the zero differences account for both upper and lower rank
 sum. Hence half the rank should be added to the upper resp. lower rank
 sum. As zero differences are omitted in the first place, the number of
 samples is artificially decreased. Moreover the textbook offers a
 continuity correction for sample sizes below 60.

 I wrote a corrected version of the wilcoxon routine and a short test to
 compare both results. The corrected version yields the result according to
 the textbook.


 [1] Bortz, Lienert: Kurzgefasste Statistik für die klinische Forschung
 (Leitfaden für die verteilungsfreie Analyse kleiner Stichproben) ,
 Springer Verlag 2008

 P.S.: Hope this is the right way to file the bug report

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1744>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list