# One-Sample Kolmogorov-Smirnov Test

The One-Sample Kolmogorov-Smirnov Test procedure compares the observed
cumulative distribution function for a variable with a specified theoretical
distribution, which may be normal, uniform, Poisson, or exponential.
The Kolmogorov-Smirnov *Z* is computed from the largest difference
(in absolute value) between the observed and theoretical cumulative
distribution functions. This goodness-of-fit test tests whether the
observations could reasonably have come from the specified distribution.

Starting with version 27.0, the Lilliefors test statistic can be used to
estimate the *p*-value by using the Monte Carlo sampling for testing against a normal
distribution with estimated parameters (this functionality was previously possible only through the
Explore procedure).

- Example
- Many parametric tests require normally distributed variables. The one-sample
Kolmogorov-Smirnov test can be used to test that a variable (for example,
*income*) is normally distributed. - Statistics
- Mean, standard deviation, minimum, maximum, number of non-missing cases, quartiles, Lilliefors test, and Monte Carlo simulation.

## One-Sample Kolmogorov-Smirnov test data considerations

- Data
- Use quantitative variables (interval or ratio level of measurement).
- Assumptions
- The Kolmogorov-Smirnov test assumes that the parameters of the test distribution are specified in advance. This procedure estimates the parameters from the sample. The sample mean and sample standard deviation are the parameters for a normal distribution, the sample minimum and maximum values define the range of the uniform distribution, the sample mean is the parameter for the Poisson distribution, and the sample mean is the parameter for the exponential distribution. The power of the test to detect departures from the hypothesized distribution may be seriously diminished.

## Obtaining a One-Sample Kolmogorov-Smirnov test

This feature requires the Statistics Base option.

- From the menus choose:
- Select one or more numeric test variables. Each variable produces a separate test.
- Optionally, select a test distribution method:
- Normal
- When selected, you can specify whether distribution parameter(s) are estimated from sample data (the default setting) or from custom settings. When Use sample data is selected, both the existing asymptotic results and Lilliefors significance correction based on the Monte Carlo sampling are used. When Custom is selected, provide values for both Mean and Std Dev.
- Uniform
- When selected, you can specify whether distribution parameter(s) are estimated from sample data (the default setting) or from custom settings. When Use sample data is selected, the Lilliefors test is used. When Custom is selected, provide values for both Min and Max.
- Poisson
- When selected, specify a Mean parameter value.
- Exponential
- When selected, you can specify whether distribution parameter(s) are estimated from the sample mean (the default setting) or from custom settings. When Use sample data is selected, the Lilliefors test is used. When Custom is selected, provide a Mean parameter value.

- Optionally, click Simulation to specify Monte Carlo simulation parameters, click Exact to specify exact test parameters, or click Options for descriptive statistics, quartiles, and control of the treatment of missing data.

This procedure pastes NPAR TESTS command syntax.