I was recently given the following data.

7 1 6 6 2 8 3 7 4 6 3 3 1 8 4 5 9 3 2 4 1 4 4 3 6 3 4 2 3 2 7 2 7 4 2 4 4 4 3 2 2 4 5 8 6 4 3 1 5 5

I then ran a KS test as follows in R:


and got the following:

One-sample Kolmogorov-Smirnov test

data:  mydata 
D = 0.1832, p-value = 0.06985
alternative hypothesis: two-sided 

Trouble is when I do the same test in SPSS, as shown here: https://statistics.laerd.com/spss-tutorials/testing-for-normality-using-spss-statistics.php

I get a p-value of 0.000 but exactly the same test statistic. Does anyone have an idea why this is? I'm not an expert in SPSS at all (don't even have it installed) but the fact that the D-statistic matches makes me think I ran it correctly and am somehow misreading it.

RioRaider's hint was the right way to go. After manually applying Lilliefors Significance Correction as described here: http://home.ubalt.edu/ntsbarsh/stat-data/SPSSSAS.htm


Exp[ -7.01256D2(n + 2.78019) + 2.99587D(n+2.78019)1/2 - 0.122119 + 0.97498/n1/2 + 1.67997/n ] 

I get exactly the p-values as described. Is there a way I can flag his comment as a +1?

  • $\begingroup$ Do you have confirmation from SPSS that it read the data exactly as intended and that it is identical to the data you fed into R? although not a confirmation i guess getting the same value is a clue that the data was probably read correctly and for the same value of the test statistic and the same sample size the p-values would have to be the same. $\endgroup$ Sep 14 '12 at 22:06
  • $\begingroup$ The R manual page for the KS test explicitly mentions that using the mean and sd of the data for the parameters is invalid. You can verify this with a simulation. $\endgroup$
    – whuber
    Sep 14 '12 at 22:11
  • 5
    $\begingroup$ I noticed that the SPSS output linked by @user1357015 notes that Lilliefors Significance Correction is used. Maybe that is the difference? $\endgroup$
    – RioRaider
    Sep 14 '12 at 22:23
  • $\begingroup$ @whuber: I tried it with using rnorm and so forth, the effect is minor. $\endgroup$ Sep 14 '12 at 23:58
  • 2
    $\begingroup$ @user1357015 Yes, it is the effect of Lilliefors correction aplied in Explore procedure. If you use K-S prodecure that is under Nonparametric tests menu, you'll get the same sig. as in R. $\endgroup$
    – ttnphns
    Sep 15 '12 at 6:11

Answered in comments by RioRaider and OP has confirmed that this is the correct answer:

I noticed that the SPSS output linked by @user1357015 notes that Lilliefors Significance Correction is used. Maybe that is the difference?

  • $\begingroup$ I've copied this comment by @RioRaider as a community wiki answer because it is, more or less, an answer to this question. We have a dramatic gap between answers and questions. At least part of the problem is that some questions are answered in comments: if comments which answered the question were answers instead, we would have fewer unanswered questions. $\endgroup$
    – mkt
    Sep 11 '19 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.