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?
--
Stas Kolenikov, also found at http://stas.kolenikov.name
Small print: I don't check this account regularly
*
* 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/