Dear Statalists,
I would like to test whether two samples can be assumed to come from the same population based on their distribution. I thought of the KS test and educated myself with the corresponding stata manual.
Now I'm confused for two reasons.
First, the D-value in the second row (-0.1667) implies the largest difference between the cumulative functions of group 2 compared to group 1 is minus 0.1667 while doing the math myself and also checking it in the graph is 1/12.
Second, the insignificant p-value in the second row must be due to the low sample size. Hence, increasing the sample size by multiplying the two samples a few times should make the p-value significant at some point. However, what happens is that the p-value in the first row becomes soon significant. Following the manual, the testable null hypothesis in the first row is whether "group 1 contains smaller values than for group 2" which is clearly the base but rejected by the test.
Third, I tried to reproduce example 1 in https://www.real-statistics.com/non-...-smirnov-test/ but neither the D-value nor the corresponding p-value match.
It would be great if you can clarify. Thanks a lot,
Frieder
I would like to test whether two samples can be assumed to come from the same population based on their distribution. I thought of the KS test and educated myself with the corresponding stata manual.
Now I'm confused for two reasons.
First, the D-value in the second row (-0.1667) implies the largest difference between the cumulative functions of group 2 compared to group 1 is minus 0.1667 while doing the math myself and also checking it in the graph is 1/12.
Second, the insignificant p-value in the second row must be due to the low sample size. Hence, increasing the sample size by multiplying the two samples a few times should make the p-value significant at some point. However, what happens is that the p-value in the first row becomes soon significant. Following the manual, the testable null hypothesis in the first row is whether "group 1 contains smaller values than for group 2" which is clearly the base but rejected by the test.
Third, I tried to reproduce example 1 in https://www.real-statistics.com/non-...-smirnov-test/ but neither the D-value nor the corresponding p-value match.
It would be great if you can clarify. Thanks a lot,
Frieder
Comment