Skip to content
Prev 332472 / 398506 Next

Extracting values from a ecdf (empirical cumulative distribution function) curve

What 'y' values were you using?  inf_f maps probabilities (in [0,1]) to
values in the range of the orginal data, x, but it will have problems for
a probability below 1/length(x) because the original data didn't tell
you anything about the ecdf in that region.

   > X <- c(101, 103, 107, 111)
   > f <- ecdf(X)
   > inv_f <- inv_ecdf(f)
   > inv_f(seq(0, 1, by=1/8))
   [1]  NA  NA 101 102 103 105 107 109 111

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com