Calculating the 1 Sample Kolmogorov Smirnov Test Statistic for Normality Can anyone give me some insight into where this calculation for the KS test statistic is going wrong (see figure 1)? I ran the test in SPSS and SAS as a check. I have used the same process for other data and gotten the correct KS statistic (see figure 2). 
I suspect that the presence of duplicate values in the figure 1 data is operative. If this is the case, does anyone know how SPSS and SAS adjusts the KS test stat for dups?
Any assistance is appreciated.
Figure 1

Figure 2

 A: I was originally using this formula for the column entitled "Abs Diff" in my spreadsheet above:

However, after further research I found this formula which indeed matches the KS test statistic values produced by SPSS and SAS in all cases.

Thanks to everyone who viewed this post.
A: It appears that the SPSS K-S Algorithm uses the sample mean and sample standard deviation in its determination of its F(x) value. I am looking at a simple example of a K-S test in Canavos (1984) - Applied probability and statistics, pp. 343-344, they show a sample of n = 16 observations where they calculate the KS test statistic.
They use a hypothetical population mean and sigma of mu = 985 and sigma = 50. The sample mean = 980.50 and a sample standard deviation of 61.29.
In the Canavos example, when they calculate their KS statistic using the m = 985 and sigma = 50 values, their hand calculated KS value is 0.1207.
When I ran it in both SPSS and MINITAB, I got a value of 0.1750.
So, I did an EXCEL hand calculation using the sample mean and sample standard deviation values of 980.50 and 61.29, respectively. Then I got the same value of 0.17488 ~ 0.175. So that is what is going on with software packages like SPSS and MINITAB.
v/r
Kenneth Lewis
Virginia State University
Department of Psychology
