Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: -ksmirnov- for uniform distribution?


From   Antoine Terracol <terracol@univ-paris1.fr>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: -ksmirnov- for uniform distribution?
Date   Thu, 27 Mar 2008 21:36:35 +0100

Should'nt it be
ksmirnov p = p
for a uniform on [0,1] ?

Antoine

Stas Kolenikov wrote:
> I've done some simulations on performance of certain tests, and I want
> to relate the p-values that come out of a test to the uniform
> distribution. Looking at the syntax of -ksmirnov-, it appears that I
> need to put something like the straight line for the RHS expression,
> so I am trying:
> 
> sort p
> ksmirnov p = (_n-1/2)/(_N+1)
> One-sample Kolmogorov-Smirnov test against theoretical distribution
>            (_n-0.5)/2001
> 
>  Smaller group       D       P-value  Corrected
>  ----------------------------------------------
>   p:                  0.0007    0.998
>  Cumulative:        -0.0002    1.000
>  Combined K-S:       0.0007    1.000      1.000
> 
> 
> 
> and it happily gives me the p-value of 1. Well, I know that the test
> is biased, I do the histogram -- and it produces an almost triangular
> distribution of p-values heavily loaded on small p-values, and when I
> do the distance between p and the right-hand side by hand, I find that
> the difference between the distribution functions is like 0.33, not
> 0.0007 reported in -ksmirnov-. What am I doing wrong here?
> 


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index