K-S Subcommand (One-Sample) (NPAR TESTS command)
NPAR TESTS K-S({NORMAL [mean,stddev]})=varlist
{POISSON [mean] }
{UNIFORM [min,max] }
{EXPONENTIAL [mean] }
The K-S
(alias KOLMOGOROV-SMIRNOV
) one-sample test compares
the cumulative distribution function for a variable with a uniform,
normal, Poisson, or exponential distribution, and the test tests whether
the distributions are homogeneous. The parameters of the test distribution
can be specified; the defaults are the observed parameters. The output
shows the number of valid cases, parameters of the test distribution,
most-extreme absolute, positive, and negative differences, Kolmogorov-Smirnov Z, and two-tailed probability for each variable.
Syntax
The minimum specification is a distribution keyword
and a list of variables. The distribution keywords are NORMAL
, POISSON
, EXPONENTIAL
, and UNIFORM
.
- The distribution keyword and its optional parameters must be enclosed within parentheses.
- The distribution keyword must be separated from its parameters by blanks or commas.
NORMAL [mean, stdev]. Normal distribution. The default parameters are the observed mean and standard deviation.
POISSON = varlist
is not supported in the
K-S subcommand.UNIFORM [min,max]. Uniform distribution. The default parameters are the observed minimum and maximum values.
EXPONENTIAL [mean]. Exponential distribution. The default parameter is the observed mean.
Operations
- The Kolmogorov-Smirnov Z is computed from the largest difference in absolute value between the observed and test distribution functions.
- The K-S probability levels assume that the test distribution is specified entirely in advance.
The distribution of the test statistic and resulting probabilities are different when the parameters
of the test distribution are estimated from the sample. The K-S test for normality uses the
Lilliefors adjustment if you do not enter a population mean and standard deviation. The power of the
test to detect departures from the hypothesized distribution may be seriously diminished. For
testing against a normal distribution with estimated parameters, consider the adjusted K-S
Lilliefors test that is available in the
EXAMINE
procedure. - For a mean of 100,000 or larger, a normal approximation to the Poisson distribution is used.
- A test statistic is calculated for each specified variable.
Example
NPAR TESTS K-S(UNIFORM)=V1 /K-S(NORMAL,0,1)=V2.
- The first
K-S
subcommand compares the distribution of V1 with a uniform distribution that has the same range as V1. - The second
K-S
subcommand compares the distribution of V2 with a normal distribution that has a mean of 0 and a standard deviation of 1.