Solved – Kolmogorv Smirnov Test in R

distributionskolmogorov-smirnov testruniform distribution

I want to proof the "Relative Age Effect" of a football team. I have a list of birth dates of the team members (about 20 numbers between 1 and 365, the day of the year).
I now want to use the KS-Test to test against a uniform distribution.

this is how I did it, but it looks very wrong to me:

ks.test(dates,"punif")

D = 1, p-value = 3.331e-16
alternative hypothesis: two-sided

almost all players are born in the first half of the year, yet the p-value seems far too low in my opinion.

Best Answer

Try:

ks.test(dates, "punif", 1, 365)

To understand why, try typing

?ks.test

and reading the last bit of the 'Details' section.