[R] "reverse" quantile function
dwinsemius at comcast.net
Fri Jun 16 00:46:36 CEST 2017
> On Jun 15, 2017, at 12:37 PM, Andras Farkas via R-help <r-help at r-project.org> wrote:
> Dear All,
> we have:
> res<-t(apply(z, 1, quantile, probs=c(0.3)))
> my goal is to do a 'reverse" of the function here that produces "res" on a data frame, ie: to get the answer 0.3 back for the percentile location when I have "res" available to me... For a single vector this would be done using ecdf something like this:
> x <- rnorm(100)
> #then I know this value:
> #so do this step
> #to get 0.33 back...
> any suggestions on how I could to that for a data frame?
Can't you just used ecdf and quantile ecdf?
# See ?ecdf page for both functions
> lapply( lapply(z, ecdf), quantile, 0.33)
Alameda, CA, USA
More information about the R-help