[Scipy-tickets] [SciPy] #1100: scipy.stats.spearmanr does not work correctly with ties, docstring does not say so

SciPy Trac scipy-tickets@scipy....
Sat Jan 23 07:52:14 CST 2010


#1100: scipy.stats.spearmanr does not work correctly with ties,  docstring does
not say so
-------------------------------------+--------------------------------------
 Reporter:  sickbock                 |       Owner:  somebody
     Type:  defect                   |      Status:  new     
 Priority:  normal                   |   Milestone:  0.7.1   
Component:  Other                    |     Version:  0.7.0   
 Keywords:  spearman ties stats bug  |  
-------------------------------------+--------------------------------------
 During an analysis of EEG data, I discovered a lot of correlations using
 scipy.stats.spearmanr(), even after shuffling on of the variables. I have
 localized this problem to ties in the data.

 The attached file calculates the spearman correlation repeatedly for a
 small, randomly shuffled dataset containing only zeros and ones. The
 unmodified file reports an *average correlation of 0.25 for unrelated
 data*. Adding a bit of noise to the values removes this correlation
 altogether (set WORKAROUND to True).

 I think that
 1) The function should be changed to work with ties or
 2) That the documentation should state this limitation, and that the
 function should warn the user when ties occur in the observations.

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


More information about the Scipy-tickets mailing list