[R] ks.test ; impossible to calculate exact exact value with ex-aequos

Rui Barradas ruipb@rr@d@@ @ending from @@po@pt
Mon Dec 10 23:34:19 CET 2018


Hello,

That is a warning, not an error.
And it documented. In ?ks.test, section Details, the relevant part is


The presence of ties always generates a warning, since continuous 
distributions do not generate them. If the ties arose from rounding the 
tests may be approximately valid, but even modest amounts of rounding 
can have a significant effect on the calculated statistic.


It then adds, three paragraphs down:

Exact p-values are not available for the two-sample case if one-sided or 
in the presence of ties.


You can use exact = FALSE but it will still issue a warning.

ks.test(a, b, exact = FALSE)

	Two-sample Kolmogorov-Smirnov test

data:  a and b
D = 0.58333, p-value = 0.0337
alternative hypothesis: two-sided

Warning message:
In ks.test(a, b, exact = FALSE) :
   p-value will be approximate in the presence of ties



Hope this helps,

Rui Barradas
Às 21:17 de 10/12/2018, Fatma Ell escreveu:
> Dear all,
> 
> I'm trying to use ks.test in order to compare two curve. I've 0 values i
> think this is why I have the follonwing warnings :impossible to calculate
> exact exact value with  ex-aequos
> 
> 
> a=c(3.02040816326531, 7.95918367346939, 10.6162790697674, 4.64150943396226,
> 1.86538461538462, 1.125, 1.01020408163265, 1.2093023255814,
> 0.292452830188679,
> 0, 0, 0)
> b=c(2.30769230769231, 4.19252873563218, 5.81924882629108, 6.2248243559719,
> 5.02682926829268, 4.50728862973761, 3.61741424802111, 5.05479452054795,
> 3.68095238095238, 1.875, 5.25, 0)
> 
> ks.test(a,b)
> 
> data:  a and b
> D = 0.58333, p-value = 0.0337
> alternative hypothesis: two-sided
> 
> Warning message:
> In ks.test(a, b) :
> impossible to calculate exact exact value with ex-aequos
> 
> Does the p-value is correct ? Otherwise, how to solve this issue ?
> 
> Thanks a lot.
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list