>From the documentation to the quantile function:
...
`quantile(x,p)' as a function of `p' linearly interpolates the
points ( (i-1)/(n-1), ox[i] ), where `ox <- order(x)' (the ``order
statistics'') and `n <- length(x)'.
This gives `quantile(x, p) == (1-f)*ox[i] + f*ox[i+1]', where `r
<- 1 + (n-1)*p', `i <- floor(r)', `f <- r - i' and
`ox[n+1] : ox[n]'.
I think that should be ox <- x[ order(x) ] ! At least, then the formulae
give the same result as quantile itself!
RenE J.V. Bertin
College de France/LPPA
11, place Marcelin Berthelot
75005 Paris, France
_________________________________________________________________
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To:
r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._