![]() |
KOLMOGOROV SMIRNOV TWO SAMPLEName:
where ni is the number of points less than Yi. 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 K-S test is based on the maximum distance between these two curves. That is,
where F is the theoretical cumulative distribution function. The two sample K-S 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 E1 and E2 are the empirical distribution functions for the two samples. Note that we compute E1 and E2 at each point in both samples (that is both E1 and E2 are computed at each point in each sample). More formally, the Kolmogorov-Smirnov two sample test statistic can be defined as follows.
The quantile-quantile plot, bihistogram, and Tukey mean-difference plot are graphical alternatives to the two sample K-S 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.
KOLMOGOROV-SMIRNOV TWO SAMPLE TEST Y1 Y2 SUBSET Y2 > 0
These parameters can be used in subsequent analysis.
Press, Teukolsky, Vetterling, and Flannery (1992), "Numerical Recipes in Fortan: The Art of Scientific Computing," Second Edition, Cambridge University Press, pp. 614-622.
SKIP 25 READ AUTO83B.DAT Y1 Y2 . DELETE Y2 SUBSET Y2 < 0 SET WRITE DECIMALS 4 KOLMOGOROV-SMIRNOPV TWO SAMPLE TEST Y1 Y2The following output is generated. Kolmogorov-Smirnov Two Sample Test First Response Variable: Y1 Second Response Variable: Y2 H0: The Two Samples Come From the Same (Unspecified) Distribution Ha: The Two Samples Come From Different Distributions Sample One Summary Statistics: Number of Observations: 249 Sample Mean: 20.1446 Sample Standard Deviation: 6.4147 Sample Minimum: 9.0000 Sample Maximum: 39.0000 Sample Two Summary Statistics: Number of Observations: 79 Sample Mean: 30.4810 Sample Standard Deviation: 6.1077 Sample Minimum: 18.0000 Sample Maximum: 47.0000 Test Statistic Value: 0.6003 Conclusions (Upper 1-Tailed Test) ------------------------------------------------------------------------ Null Null Significance Test Critical Hypothesis Hypothesis Level Statistic Region (>=) Conclusion ------------------------------------------------------------------------ Same 90.0% 0.6003 0.1575 REJECT Same 95.0% 0.6003 0.1756 REJECT Same 99.0% 0.6003 0.2105 REJECT
|
Privacy
Policy/Security Notice
NIST is an agency of the U.S.
Commerce Department.
Date created: 6/5/2001 |