I'm trying to figure out how Kolmogorov-Smirnov one-sample testing for normality is done in Minitab (or Systat, since the answers apparently match).
If this is my data vector:
abc <- c(0.0313, 0.0273, 0.0379, 0.0427, 0.0286, 0.0327, 0.0298, 0.0381, 0.0559, 0.0573,
0.0558, 0.113, 0.0464, 0.0442, 0.0579, 0.0495)
The boneheaded way of doing this in R would be:
ks.test(abc, pnorm, mean(abc), sd(abc))
Yes, I know that the ks.test help page says to not use the data to estimate the mean/sd of the comparison distribution. Hence, boneheaded. Sidenote - if I understand correctly, SAS is using this as a regular procedure? http://support.sas.com/documentation/cdl/en/procstat/63104/HTML/default/viewer.htm#procstat_univariate_sect037.htm
Anyway, the p-value R gives for this improper test is 0.3027, while apparently both Minitab and Systat provide a p-value of 0.029.
The project manager won't hear anything about using other means of testing for normality (or, heavens forbid, use plots of data distribution). At this point I'm just trying to figure out what it is that the other softwares are doing, so that I can explain to myself the differences...
Am I missing something?? If people suggest using simulations instead of the direct test, like here (http://r.789695.n4.nabble.com/Kolmogorov-Smirnov-Test-td3037232.html), would it be possible to include detailed code?
Thank you!
lillie.testfrom thenortestpackage, I start getting p-values that are very similar, but not identical. For this vector - thelillie.testp-val is 0.021 (and Minitab's is 0.029). It's a similar small discrepancy for all other double-run vectors as well. I know that R and Minitab have identical answers to Anderson-Darling, not sure about Shapiro... – Jul 22 '14 at 10:51abc_s <- scale(abc), then you can compute it yourselfmax(abs(ecdf(abc_s)(abc_s) - drop(pnorm(abc_s)))); it is not very useful to do that, sinceks.testalready returns D, but it's fun!). And indeed, when the mean and standard deviation are unknown, the corresponding variation of the Kolmogorov-Smirnov test (in the one sample case, when the reference is the Gaussian distribution) is the Lilliefors test... – Vincent Guillemot Jul 22 '14 at 11:24