[Scipy-tickets] [SciPy] #1388: scipy.stats.linregress is producing negative p-values

SciPy Trac scipy-tickets@scipy....
Wed Feb 16 18:27:54 CST 2011

#1388: scipy.stats.linregress is producing negative p-values
 Reporter:  mataap  |       Owner:  somebody
     Type:  defect  |      Status:  new     
 Priority:  normal  |   Milestone:  0.10.0  
Component:  Other   |     Version:  0.8.0   
 Keywords:          |  

Comment(by josefpktd):

 you mixed up the sequence, r and p should be exchanged

     prob = distributions.t.sf(np.abs(t),df)*2
     return slope, intercept, r, prob, sterrest

 pvalue should always be non-negative according to this calculations

 From the calculations it looks like r is the raw correlation between x and
 y which can be negative.

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

More information about the Scipy-tickets mailing list