documentation error for quantile (PR#1660)

rjvbertin@hotmail.com rjvbertin@hotmail.com
Wed, 12 Jun 2002 23:01:59 +0200 (MET DST)


>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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._