Re: [R] ks.test or other Kolmogorov-Smirnov code

2013-09-30 Thread William Dunlap
 If the ecdf is to be read as y=Pr(xx_i), for each x_i , well at which x_i
 does D occur?

The definition is Pr(x = x_i), but that doesn't matter much here.

You know the maximum occurs at one of the points in union(x, y) so
you can find it by comparing the ecdf's at each of those points:
 f - function(x, y) {
 xy - union(x, y)
 d - abs(ecdf(x)(xy) - ecdf(y)(xy))
 xy[ d == max(d) ]
}

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
 Behalf
 Of sitterlyb
 Sent: Monday, September 30, 2013 10:39 AM
 To: r-help@r-project.org
 Subject: [R] ks.test or other Kolmogorov-Smirnov code
 
 Can any of the tools available provide where the supremum happens?
 
 So classically D = sup|F1 - F2| or something to that affect, and then we use
 D to figure out significance.
 
 If the ecdf is to be read as y=Pr(xx_i), for each x_i , well at which x_i
 does D occur?
 
 Sorry for the repetition just trying to give all the context of what I'm
 asking.
 
 Thanks in advance.
 
 
 
 --
 View this message in context: http://r.789695.n4.nabble.com/ks-test-or-other-
 Kolmogorov-Smirnov-code-tp4677290.html
 Sent from the R help mailing list archive at Nabble.com.
 
 __
 R-help@r-project.org mailing list
 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.

__
R-help@r-project.org mailing list
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.


Re: [R] ks.test or other Kolmogorov-Smirnov code

2013-09-30 Thread sitterlyb
sweet, I didn't know ecdf could be use like that!

Thanks!



--
View this message in context: 
http://r.789695.n4.nabble.com/ks-test-or-other-Kolmogorov-Smirnov-code-tp4677290p4677306.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
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.