2.13.4.2 kstest2(Pro)

Menu Information

Statistics: Nonparametric Tests: Two Sample Kolmogorov-Smirnov Test

Brief Information

Perform a two-sample Kolmogorov-Smirnov test

Additional Information

This feature is for OriginPro only.

Command Line Usage

1. kstest2 irng:=(col(a),col(b));

2. kstest2 -r 2 type:=1 irng:=(col(a),col(b)) tail:=lower;

3. kstest2 irng:=(col(a),col(b)) tail:=upper rt:=<new name:=KS>;

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input Data Form type

Input

int

0
Specify the input data form.

Option list:

  • Indexed
    Input data range, includes input data and group
Example:
kstest2 (1,2)
In this example, the input group range should be stored in the first column, and the input data range should be stored in the second column.
  • Raw
    Select two independent columns as input data.
Note: With the Stack and Unstack tool, you can convert indexed data to raw data, and raw data to index data.
Input irng

Input

Range

<active>
Specify input data range.
Null Hypothesis null

Input

string

0
The null hypothesis to be tested. This string is not editable, and changes according to the selected Alternate Hypothesis.
Alternative Hypothesis tail

Input

int

Radio

Indicate whether an upper, lower, or two-tailed KS-test should be performed
Option list

  • two:F (x) <> G(y)
    Performs a 2-tailed KS-test
  • upper:F (x) > G(y)
    Performs an upper-tailed KS-test
  • lower:F (x) < G(y)
    Performs an lower-tailed KS-test
Significance Level alpha

Input

double

0.05
Specify the significance level of the test.
Output Results rt

Output

ReportTree

[<input>]<new>

Specify the output result sheet, which includes Notes table, Descriptive table, Freqs table and Test Statistics table.

Examples

  1. To perform a two-tailed two-sample KS-test on columns 1 and 2 of the active worksheet , using default settings:
    kstest2 irng:=(col(a),col(b));
  2. To perform a upper-tailed two-sample KS-test on columns 1 and 2 of the active worksheet, use the script command:
    kstest2 irng:=(col(a),col(b)) tail:=1;
  3. To perform a lower-tailed two-sample KS-test on columns 1 and 3 of the active worksheet, and save the result table with the name as KS, use the script command:
    kstest2 irng:=(1,3) tail:=2 rt:=<new name:=KS>;
    Of course, the name, such as KS, you can define it by yourself.

More Information

For more information, please refer to our User Guide.

References

Nag C Library Function Document: nag_2_sample_ks_test(g08cdc)

Related X-Functions

mwtest, ttest2