# [SciPy-User] KS 2-sample p-value

 Classic List Threaded
4 messages
Reply | Threaded
Open this post in threaded view
|
Report Content as Inappropriate

## [SciPy-User] KS 2-sample p-value

 Hi folks. I'm curious about the p-value computation for the 2-sample KS test (lines 4298-4302 here [1], link below). Can someone please give me a reference for this, in particular for the mysterious "en + 0.12 + 0.11 / en" piece?  I've looked at the MIT OpenCourseWare notes on KS [2] and at the SciPy docs for kstwobign but I'm still totally confuzzled by that piece. Thanks for your time! Moy 1: https://github.com/scipy/scipy/blob/master/scipy/stats/stats.py#L42982: http://ocw.mit.edu/courses/mathematics/18-443-statistics-for-applications-fall-2006/lecture-notes/lecture14.pdf_______________________________________________ SciPy-User mailing list [hidden email] https://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|
Report Content as Inappropriate

## Re: KS 2-sample p-value

 On Fri, Jun 10, 2016 at 3:02 PM, Moy wrote:Hi folks. I'm curious about the p-value computation for the 2-sample KS test (lines 4298-4302 here [1], link below). Can someone please give me a reference for this, in particular for the mysterious "en + 0.12 + 0.11 / en" piece?  I've looked at the MIT OpenCourseWare notes on KS [2] and at the SciPy docs for kstwobign but I'm still totally confuzzled by that piece. Thanks for your time! Moy 1: https://github.com/scipy/scipy/blob/master/scipy/stats/stats.py#L4298 2: http://ocw.mit.edu/courses/mathematics/18-443-statistics-for-applications-fall-2006/lecture-notes/lecture14.pdfI don't think I ever looked at the details for that, or don't remember. For similar one-sample test Stephens had several articles with similar small sample corrections as a function of the number of observations.I don't find anything related in a brief google search. My guess would be that this is from an old (older than 30 or 40 years) study that found that the fractional polynomial provides a good approximation.Some of the nonparametric tests in scipy.stats also referred to older (maybe 1980s) books on nonparametric testing where I never had access to.Sometimes another statistics package, R, SAS, Stata, has a relevant original reference in the documentation.Josef  _______________________________________________ SciPy-User mailing list [hidden email] https://mail.scipy.org/mailman/listinfo/scipy-user _______________________________________________ SciPy-User mailing list [hidden email] https://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|
Report Content as Inappropriate

## Re: KS 2-sample p-value

 On Fri, Jun 10, 2016 at 4:06 PM, wrote:On Fri, Jun 10, 2016 at 3:02 PM, Moy wrote:Hi folks. I'm curious about the p-value computation for the 2-sample KS test (lines 4298-4302 here [1], link below). Can someone please give me a reference for this, in particular for the mysterious "en + 0.12 + 0.11 / en" piece?  I've looked at the MIT OpenCourseWare notes on KS [2] and at the SciPy docs for kstwobign but I'm still totally confuzzled by that piece. Thanks for your time! Moy 1: https://github.com/scipy/scipy/blob/master/scipy/stats/stats.py#L4298 2: http://ocw.mit.edu/courses/mathematics/18-443-statistics-for-applications-fall-2006/lecture-notes/lecture14.pdfI don't think I ever looked at the details for that, or don't remember. For similar one-sample test Stephens had several articles with similar small sample corrections as a function of the number of observations.I don't find anything related in a brief google search. My guess would be that this is from an old (older than 30 or 40 years) study that found that the fractional polynomial provides a good approximation.Stephens 1970 http://www.jstor.org/stable/2984408has this form of the polynomial with 0.11 and 0.12 coefficients, but AFAICS from a quick browse and from what I remember of his other articles it's for one-sample tests, but maybe he has somewhere a section on two-sample tests.The best reference for Stephens is a chapter in a book that summarizes his earlier articles, but I don't remember where I have a copy of it.Josef Some of the nonparametric tests in scipy.stats also referred to older (maybe 1980s) books on nonparametric testing where I never had access to.Sometimes another statistics package, R, SAS, Stata, has a relevant original reference in the documentation.Josef  _______________________________________________ SciPy-User mailing list [hidden email] https://mail.scipy.org/mailman/listinfo/scipy-user _______________________________________________ SciPy-User mailing list [hidden email] https://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|
Report Content as Inappropriate

## Re: KS 2-sample p-value

 > Stephens 1970 http://www.jstor.org/stable/2984408> has this form of the polynomial with 0.11 and 0.12 coefficients, but > AFAICS from a quick browse and from what I remember of his other > articles it's for one-sample tests, but maybe he has somewhere a > section on two-sample tests. > The best reference for Stephens is a chapter in a book that summarizes > his earlier articles, but I don't remember where I have a copy of it. Thanks, Josef, this is very helpful. Best, Moy _______________________________________________ SciPy-User mailing list [hidden email] https://mail.scipy.org/mailman/listinfo/scipy-user
Loading...