[R] data vector to corresonding percentile ranks
dwinsemius at comcast.net
Fri Dec 23 18:23:33 CET 2011
On Dec 23, 2011, at 10:28 AM, Steve Jones wrote:
> I have a problem where I need to calculate the corresponding cohort
> percentile ranks for each of several variables.
> Essentially, what I need is a function that will calculate the
> distribution-free percentiles from each variable's data vector,
> returning a
> corresponding vector of percentiles:
> I tried to make ecdf() perform this task but was unsuccessful.
Unsuccessful? How? Seems like a reasonable strategy:
x <- rnorm(1000)
xCdist <- ecdf(x)
Seems to give sensible results.
> I'd be grateful for any help or advice...
My advice would be to post what code you were trying so that you can
get help understand what difficulties you need to overcome.
David Winsemius, MD
West Hartford, CT
More information about the R-help