# Kstable not fully correlated with p-value in KS-test

I have done Kolmogorov-Smirnov (ks-test) between 2 groups and I got the following values:

Description Kstable p-val
A1 0.64091 0
A9 0.64546 0
B67 0.74318 2.92E-20
B1 0.68636 2.14E-19
A6 0.62046 8.55E-15
B1 0.61364 7.66E-14

From what I remember, Kstable score going in a negative correlation with p-value and when it's higher - the pvalue has a lower score. A1 and A9 has pvalue lower than 2.92E-20 but their kstable is not higher than B67. I thought B67 had fewer patients in the that column, but it wasn't the reason. What could cause a lower Kstable and "greater p-value"?

• Please explain what a "Kstable" is. If it's a test statistic, then at a minimum you need to report the sample sizes. Are they all the same or do they differ?
– whuber
Sep 20, 2021 at 16:18
• It's a test statistic value according to docs.scipy.org/doc/scipy/reference/generated/…. The samples are different (n = 32 vs n= 340) Sep 21, 2021 at 19:48
• Differences in sample size alone explain your observations: the p-value depends strongly on the sample size. BTW, I searched your reference for "kstable" but could not find a single instance.
– whuber
Sep 21, 2021 at 21:01
• They related it to "statistic" I guess it's the test statistic. From previous ks tests I have made, it was always negatively correlated with the p-value but this time there are 2 deviants. At first I thought it's because A1 and A9 groups has multiple "zeros" but it's not the case the "n" is same for all groups Sep 22, 2021 at 14:28