
KOLMOGOROV SMIRNOV TWO SAMPLEName:
where n(i) is the number of points less than Y_{i} This is a step function that increases by 1/N at the value of each data point. We can graph a plot of the empirical distribution function with a cumulative distribution function for a given distribution. The one sample KS test is based on the maximum distance between these two curves. That is,
where F is the theoretical cumulative distribution function. The two sample KS test is a variation of this. However, instead of comparing an empirical distribution function to a theoretical distribution function, we compare the two empirical distribution functions. That is,
where E_{1} and E_{2} are the empirical distribution functions for the two samples. Note that we compute E_{1} and E_{2} at each point in both samples (that is both E_{1} and E_{2} are computed at each point in each sample). More formally, the KolmogorovSmirnov two sample test statistic can be defined as follows.
The quantilequantile plot, bihistogram, and Tukey meandifference plot are graphical alternatives to the two sample KS test.
<SUBSET/EXCEPT/FOR/qualification> where <y1> is the first response variable; <y2> is the second response variable; and where the <SUBSET/EXCEPT/FOR qualification> is optional.
KOLMOGOROVSMIRNOV TWO SAMPLE TEST Y1 Y2 SUBSET Y2 > 0
CUTUPP90  90% critical value (alpha = 0.10) for the KS two sample test statistic CUTUPP95  95% critical value (alpha = 0.05) for the KS two sample test statistic CUTUPP99  99% critical value (alpha = 0.01) for the KS two sample test statistic These parameters can be used in subsequent analysis.
"Numerical Recipes in Fortan: The Art of Scientific Computing", Second Edition, Press, Teukolsky, Vetterlling, and Flannery, Cambridge University Press, 1992, pp. 614622.
READ AUTO83B.DAT Y1 Y2 . DELETE Y2 SUBSET Y2 < 0 KOLMOGOROVSMIRNOPV TWO SAMPLE TEST Y1 Y2 The following output is generated. ************************************************* ** KOLMOGOROVSMIRNOPV TWO SAMPLE TEST Y1 Y2 ** ************************************************* KOLMOGOROVSMIRNOV TWO SAMPLE TEST NULL HYPOTHESIS H0: TWO SAMPLES COME FROM THE SAME (UNSPECIFIED) DISTRIBUTION ALTERNATE HYPOTHESIS HA: TWO SAMPLES COME FROM DIFFERENT DISTRIBUTIONS SAMPLE: NUMBER OF OBSERVATIONS FOR SAMPLE 1 = 249 NUMBER OF OBSERVATIONS FOR SAMPLE 2 = 79 TEST: KOLMOGOROVSMIRNOV TEST STATISTIC = 1.000000 ALPHA LEVEL CUTOFF CONCLUSION 10% 0.37000 REJECT H0 5% 0.41000 REJECT H0 1% 0.49000 REJECT H0
Date created: 6/5/2001 