Hi
I find an inconsistency of results with two datasets. With the first dataset, the manually calculated answer is consistent with SAS output. But with the second dataset, it is not the case. Please see the attached Excel sheet. Please let me know where the error is.
Thank you
S_pera
Your formula is incorrect. The KS statistic does not use the AbsDiff column.
Instead you need three columns:
1. LowSn = (cumFreq-1)/5
2. DPlus = F(X) - LowSn
3. DMinus = Sn - F(X)
Then KS = max(DPlus, DMinus)
For more information, see What is Kolmogorov's D Statistic and especially the section "Compute the statistic manually".
Hi Reeza
No there were no ties. I am attaching the Excel file again. Please try.
rgds
S_pera
Your formula is incorrect. The KS statistic does not use the AbsDiff column.
Instead you need three columns:
1. LowSn = (cumFreq-1)/5
2. DPlus = F(X) - LowSn
3. DMinus = Sn - F(X)
Then KS = max(DPlus, DMinus)
For more information, see What is Kolmogorov's D Statistic and especially the section "Compute the statistic manually".
Dear Rick_SAS
Sorted. Thank you very much.
S_pera
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.