An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20111223/3f222465/attachment.pl>
data vector to corresonding percentile ranks
3 messages · Steve Jones, Sarah Goslee, David Winsemius
I'm not sure I understand the question, but does quantile() do what you want?
On Fri, Dec 23, 2011 at 10:28 AM, Steve Jones <sjones64 at jhmi.edu> 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: e.g.: percentile.my.data<-/function/(my.data) I tried to make ecdf() perform this task but was unsuccessful. I'd be grateful for any help or advice...
Sarah Goslee http://www.functionaldiversity.org
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: e.g.: percentile.my.data<-/function/(my.data) I tried to make ecdf() perform this task but was unsuccessful.
Unsuccessful? How? Seems like a reasonable strategy: set.seed(123) x <- rnorm(1000) xCdist <- ecdf(x) Seems to give sensible results. > x[1] [1] -0.7104066 > 100*xCdist(x[1]) [1] 23.4 > x[2] [1] 0.2568837 > 100*xCdist(x[2]) [1] 60
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