One-sample Kolmogorov-Smirnov Test
The Kolmogorov-Smirnov goodness of fit test is used to test whether the empirical distribution of a set of observations is consistent with a random sample drawn from a specific theoretical distribution.
The Kolmogorov-Smirnov goodness of fit test is generally more powerful than the chi-squared goodness of fit test for continuous variables. For discrete variables, the chi-squared test is generally preferable.
If parameter values for the theoretical distribution are not available, they may be estimated from the observations automatically as part of the test for normal (Gaussian) or exponential distributions. For other distributions, the chi-squared test must be used if parameters are to be estimated. In this case, the parameters are estimated from the data separately from the test and then entered into the dialog.
To perform a one-sample Kolmogorov-Smirnov test
Choose Statistics Compare Samples
One Sample
Kolmogorov-Smirnov GOF. The dialog shown below appears.
The one-sample Kolmogorov-Smirnov test has the following options:
Data
Data Set
Select a data set from the dropdown list or type the name of a data set. You can also type into the Data Set edit field any expression that evaluates to a data set.
Variable
Select the column to which the test will be applied.
Hypotheses
Alternative Hypothesis
Specify the alternative hypothesis. For example, to perform a one-sided test against the alternative hypothesis that the mean of Variable 1 is greater than the mean of Variable 2, select greater from the list box.
Distribution
Select the distribution for the variable.
Results
Enter the name for the object in which to save the results of the analysis.
Print Results
Select this to print out the results of the analysis in the designated output window.
Distribution Parameters
When a distribution is chosen, fields for those parameters associated with the distribution are enabled.
Related S-PLUS language functions
ks.gof, chisq.gof, qqplot