Reputation: 3587
I am trying to run a KS test on a vector to check if its follows a Poisson distribution
require("MASS")
Data <- rpois(100000, 20)
distFit<-fitdistr(Data,"Poisson")
ks.test(Data,"ppois",lambda=distFit$estimate)
unfortunately I get the following message once I run ks.test in the next step
Warning message: In ks.test(Data, "ppois", lambda = distFit$estimate) : ties should not be present for the Kolmogorov-Smirnov test
Any idea how to fix this?
Upvotes: 0
Views: 5200
Reputation: 1464
you could apply the jitter
function to your data to break ties ... have a look at ?jitter
to find out if it fits your needs
Upvotes: 2