Re: [R] R function for percentrank

2007-12-06 Thread Martin Maechler
MS == Marc Schwartz [EMAIL PROTECTED] on Wed, 05 Dec 2007 12:43:50 -0600 writes: [] MS Martin, MS Thanks for the corrections. In hindsight, now seeing the intended use of MS ecdf() in the fashion you describe above, it is now clear that my MS approach in

Re: [R] R function for percentrank

2007-12-06 Thread Gabor Grothendieck
On Dec 6, 2007 6:11 AM, Martin Maechler [EMAIL PROTECTED] wrote: MS == Marc Schwartz [EMAIL PROTECTED] on Wed, 05 Dec 2007 12:43:50 -0600 writes: [] MS Martin, MS Thanks for the corrections. In hindsight, now seeing the intended use of MS ecdf() in the fashion

Re: [R] R function for percentrank

2007-12-05 Thread Martin Maechler
I'm coming late to this, but this *does* need a correction just for the archives ! MS == Marc Schwartz [EMAIL PROTECTED] on Sat, 01 Dec 2007 13:33:21 -0600 writes: MS On Sat, 2007-12-01 at 18:40 +, David Winsemius wrote: David Winsemius [EMAIL PROTECTED] wrote in

Re: [R] R function for percentrank

2007-12-05 Thread Marc Schwartz
On Wed, 2007-12-05 at 18:42 +0100, Martin Maechler wrote: I'm coming late to this, but this *does* need a correction just for the archives ! MS == Marc Schwartz [EMAIL PROTECTED] on Sat, 01 Dec 2007 13:33:21 -0600 writes: MS On Sat, 2007-12-01 at 18:40 +, David Winsemius

Re: [R] R function for percentrank

2007-12-02 Thread John Kane
Ah so ! Thank you . --- Gabor Grothendieck [EMAIL PROTECTED] wrote: Its a bit tricky if you want to get it to work exactly the same as Excel even in the presence of runs but in terms of the R approx function I think percentrank corresponds to ties = min if the value is among those

[R] R function for percentrank

2007-12-01 Thread tom soyer
Hi, Does anyone know if R has a built-in function that is equvalent to Excel's percentrank, i.e., returns the rank of a value in a data set as a percentage of the data set? Thanks, -- Tom [[alternative HTML version deleted]] __

Re: [R] R function for percentrank

2007-12-01 Thread David Winsemius
David Winsemius [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: tom soyer [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: John, The Excel's percentrank function works like this: if one has a number, x for example, and one wants to know the percentile of this number in a given

Re: [R] R function for percentrank

2007-12-01 Thread Marc Schwartz
On Sat, 2007-12-01 at 18:40 +, David Winsemius wrote: David Winsemius [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: tom soyer [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: John, The Excel's percentrank function works like this: if one has a number, x for

Re: [R] R function for percentrank

2007-12-01 Thread John Kane
--- David Winsemius [EMAIL PROTECTED] wrote: tom soyer [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: John, The Excel's percentrank function works like this: if one has a number, x for example, and one wants to know the percentile of this number in a given data set,

Re: [R] R function for percentrank

2007-12-01 Thread Gabor Grothendieck
Its a bit tricky if you want to get it to work exactly the same as Excel even in the presence of runs but in terms of the R approx function I think percentrank corresponds to ties = min if the value is among those in the table and ties = ordered otherwise so: percentrank - function(table, x