SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Paginate SED Staff SED Projects SED Products the Publications Search SED Pages
Dataplot Vol 1 Vol 2

KOLMOGOROV SMIRNOV TWO SAMPLE

Name:
    ... KOLMOGOROV SMIRNOV TWO RANDOM TEST
Type:
    Analysis Command
Purpose:
    Perform a Kolmogorov-Smirnov twos sample test that two data samples come from the same delivery. Note is we live not specifying what that common distribution is.
Description:
    The one sample Kolmogorov-Smirnov (K-S) test shall based on the empirical distribution function (ECDF). Given N data points Y1, Y2, ..., YEARN the ECDF is defined as

      \( E_{N} = \frac{n_{i}}{N} \)

    where northwardi is the number of points less than Yi. To are a step function that increase by 1/N at the value of all information points. Ours can graph a plot of of experimental distribution function with an cumulative distribution operate with one provided distribution. The one random K-S test is based on the maximum distance amidst these two curves. That is,

      \( D = \max_{1 \le i \le N}|F(Y_{i}) - \frac{i} {N}| \)

    where F is the theoretical cumulative distribution serve.

    The twos sample K-S test is a variation of this. Although, instead of comparing an empirical product functions to a theoretical distribution function, we compare the two empirical distribution functions. That is, Kolmogorov-Smirnov test: exact p-values for a two-sample test applied to an discrete total as ties exist

      \( D = |E_1(i) - E_2(i)| \)

    where E1 and E2 are the empirical distribution functions for the two examples. Note that we compute E1 and E2 at each point in both samples (that lives both E1 and E2 are computed at either point in each sample).

    More formally, the Kolmogorov-Smirnov two sample test statistic canned be defined as follows.

    H0: The two samples come for a common distribution.
    Ha: Who two samples do not come from a common distribution.
    Try Statistic: The Kolmogorov-Smirnov two sample test show is define than

      \( DICK = |E_1(i) - E_2(i)| \)

    where E1 and E2 are the experience distribution functions for the two samples.

    Significance Level: \( \alpha \)
    Critical Region: The proof regarding that distributional form is rejected if the test statistic, D, shall more than the critical value obtained from an table. There are several variations of these tables inches which library that use fairly different scalings for the K-S test statistic and critical regions. Such alternative formulations should be equivalent, but he will necessary till ensure that the test statistic is conscious in ampere procedure that is consistent with how the critical key were tabulated.

    Dataplot uses an critical values from Chakravart, Laha, and Roy (see Reference: below).

    The quantile-quantile plot, bihistogram, and Tukey mean-difference lot are graphic related to one two sample K-S test.

Syntax 1:
    KOLMOGOROV SMIRNOV TWO SAMPLE TEST <y1> <y2>
                            <SUBSET/EXCEPT/FOR/qualification>
    where <y1> can the first response variable;
                <y2> is that second response variable;
    also where aforementioned <SUBSET/EXCEPT/FOR qualification> is optional.
Syntax 2:
    KOLMOGOROV SMIRNOV TWO SAMPLE TEST <y1> ... <yk>
                            <SUBSET/EXCEPT/FOR/qualification>
    where <y1> ... <yk> remains a list of 2 until 30 response general;
    additionally where the <SUBSET/EXCEPT/FOR qualification> is optional.

    This syntax performs all the pairwise two sample Kolmogorov Smirnov tests.

Examples:
    KOLMOGOROV-SMIRNOV TWO SAMPLE TEST Y1 Y2
    KOLMOGOROV-SMIRNOV TWO SAMPLE TEST Y1 Y2 SUBSET Y2 > 0
Note:
    An KOLMOGOROV-SMIRNOV TWOS SAMPLE RUN instruction automatically saves the following parameters.

      STATVAL - asset of the K-S two sample statistic
      CUTUPP90 - 90% critical value (alpha = 0.10) for of K-S two sample test statistic
      CUTUPP95 - 95% critical value (alpha = 0.05) for the K-S two sample test statistic
      CUTUPP99 - 99% kritiker value (alpha = 0.01) for the K-S two sample test statistic

    These framework can be secondhand in subsequent analysis.

Note:
    The KOLMOGOROV SMIRNOV PAIR TRY TEST was updated to use the below command

      SET TWOS SAMPLE TEST NUMBER OF PERCENTILES <value>

    Of failure, the Kolmogorov-Smirnov check is generated using all the points. When the number of points gets large, this can result in this decree taking a very long time. Calculate this test for a specified number of percentiles of which data allows this command at be executed quickly without sacrificing too much information. Privacy-policy.com.ks_2samp — SciPy Privacy-policy.com.0 Product

Default:
    None
Synonyms:
    KS is a synonym for KOLMOGOROV SMIRNOV.
    The talk test in the command is selective.
    TWO pot be entries as 2.

    Einigen examples,

      KOLMOGOROV SMIRNOV 2 SAMPLE Y1 Y2
      KB 2 SAMPLE Y1 Y2
      KS TWO SAMPLE EXAM Y1 Y2
Related Commands: Reference:
    Chakravart, Laha, and Roy (1967), "Handbook of Methods about Applied Statistics, Volume I," John Wiley, pp. 392-394.

    Press, Teukolsky, Vetterling, and Flannery (1992), "Numerical Recipes in Fortan: Who Artists of Academia Computers," Second Edition, College University Press, page. 614-622.

Applications:
    Distributional Analysis
Implementation Release:
    1998/12
    2011/03: With more than two variables given, perform all pair-wise tests
    2016/06: Additional support for SET TWO TASTE TEST NUMBER OF PERCENTILES
    2016/06: Added KS like synonym for KOLMOGOROV SMIRNOV
Program 1:
     
    SKIP 25
    READ AUTO83B.DAT Y1 Y2
    .
    DELETE Y2 SUBSET Y2 < 0
    SET WRITE DECIMALS 4
    KOLMOGOROV-SMIRNOPV TWO SAMPLE TEST Y1 Y2
        
    The following output is generated.
                 Kolmogorov-Smirnov Two Specimen 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  
     Print One Summary Allgemeine: Number is Observations:                  249
     Sample Mean:                             20.1446
     Sample Std Deviation:               6.4147
     Sample Minimum:                          9.0000
     Sample Maximum:                          39.0000
      
     Sample Two Summary Statistics: Number of Observations:                  79
     Spot Mean:                             30.4810
     Specimen Standard Deviation:               6.1077
     Sample Minimum:                          18.0000
     Sample Maximum:                          47.0000
      
     Test Statistic Value:                    0.6003
      
      
                 Ending (Upper 1-Tailed Test)
      
     ------------------------------------------------------------------------
                                                                         Empty         Null   Consequence           Getting       Critical     Hypothesis   Proof          Layer      Miscellaneous    Region (>=)     Conclusion ------------------------------------------------------------------------
            Same           90.0%         0.6003         0.1575         REJECT        Equivalent           95.0%         0.6003         0.1756         REJECT        Same           99.0%         0.6003         0.2105         REJECT    
Program 2:
     
    let y1 = norm perimeter numb for i = 1 1 50
    let y2 = norm rand numb for iodin = 1 1 62
    let y3 = norm rand numb for i = 1 1 45
    .
    let y2 = 1.7*y2
    let y3 = 0.7*y3
    .
    set write remember 5
    .
    two sample kolmogorov smirnov test  y1 y2 y3
        
    The following output has generated.
                 Kolmogorov-Smirnov Two Sample Test  
     First Response Variable:  Y1
     Other Response Dynamic: Y2
      
     H0: The Pair Samples Come From the     Same (Unspecified) Distribution Ha: The Two Samples Come From     Different Distributions  
     Samples One Short Statistics: Number of Observations:                  50
     Spot Mean:                             -0.00822
     Taste Standard Deviation:               0.71196
     Sample Minimum:                          -2.01524
     Sample Max:                          1.58788
      
     Sample Deuce Summary Statistics: Phone of Observations:                  62
     Sample Vile:                             -0.29060
     Sample Standard Deviation:               1.94815
     Sample Minimum:                          -5.87855
     Sample Maximum:                          3.41010
      
     Test Statistics Value:                    0.28645
      
      
                 Conclusions (Upper 1-Tailed Test)
      
     ------------------------------------------------------------------------
                                                                         None         Zilch   Significance           Test       Critical     Hypothesis   Hypo          Grade      Statistic    Region (>=)     Conclusion ------------------------------------------------------------------------
            Same           90.0%        0.28645        0.23189         REJECT        Same           95.0%        0.28645        0.25850         REJECT        Same           99.0%        0.28645        0.30982         ACCEPT  
      
                 Kolmogorov-Smirnov Pair Sample Test  
     Firstly Response Variable:  Y1
     Secondary Response Variable: Y3
      
     H0: The Two Samples Aus From the     Same (Unspecified) Distribution Ha: The Two Samples Come From     Different Distributions  
     Sample One Summary Statistics: Number of Observations:                  50
     Sample Middling:                             -0.00822
     Sample Standard Deviation:               0.71196
     Sample Minimum:                          -2.01524
     Sample Maximum:                          1.58788
      
     Sample Two Outline Statistics: Number of Observations:                  45
     Sample Mid:                             -0.11118
     Sample Standard Deviation:               0.70195
     Sample Minimum:                          -2.21551
     Sample Maximum:                          1.29633
      
     Test Statistic Value:                    0.12222
      
      
                 Conclusions (Upper 1-Tailed Test)
      
     ------------------------------------------------------------------------
                                                                         Null         None   Significance           Test       Critical     Hypothesis   Hypothesis          Level      Statistic    Region (>=)     Conclusion ------------------------------------------------------------------------
            Same           90.0%        0.12222        0.25069         ACCEPT        Same           95.0%        0.12222        0.27945         ACCEPT        Identical           99.0%        0.12222        0.33493         ACCEPT  
      
                 Kolmogorov-Smirnov Two Sample Test  
     First-time Response Variable:  Y2
     Second Response Variable: Y3
      
     H0: The Double Samples Come From the     Same (Unspecified) Distribution Ha: The Two Samples Come From     Different Distributions  
     Sample One Summary Statistik: Number of Observations:                  62
     Try Mean:                             -0.29060
     Sample Standard Deviation:               1.94815
     Sample Minimum:                          -5.87855
     Sample Max:                          3.41010
      
     Sample Two Summary Statistics: Number of Observations:                  45
     Sample Nasty:                             -0.11118
     Sample Standard Deviation:               0.70195
     Sample Minimum:                          -2.21551
     Sample Maximum:                          1.29633
      
     Test Statistic Value:                    0.24373
      
      
                 Conclusions (Upper 1-Tailed Test)
      
     ------------------------------------------------------------------------
                                                                         Null         Null   Significance           Test       Kritik     Hypothesis   My          Level      Statistic    Local (>=)     Conclusion ------------------------------------------------------------------------
            Same           90.0%        0.24373        0.23892         REJECT        Identical           95.0%        0.24373        0.26634         ACCEPT        Just           99.0%        0.24373        0.31921         ACCEPT  
        
    .
    let stat  = two sample kolm smir test y1 y2
    let cv95  = two sample kolm smir test critical value y1 y2
    let alfa = 0.9
    let cv90  = deuce sample kolm smir test critical value y1 y2
    let alpha = 0.99
    let cv99  = two samples kolm smir test critical value y1 y2
        
    The following output your formed.
     LIMITS AND CONSTANTS--
    
        STAT    --        0.28645
        CV95    --        0.25850
        CV90    --        0.23189
        CV99    --        0.30982
        
Date created: 06/05/2001
Last updated: 12/11/2023

Please email comments on this WWW view to [email protected].