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 >

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> a

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 +000

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]> wrot

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

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 =

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 g

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

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 numbe

Re: [R] R function for percentrank

2007-12-01 Thread David Winsemius
"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, dataset, one would type =percentrank(dataset,x) in > Exc

Re: [R] R function for percentrank

2007-12-01 Thread tom soyer
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, dataset, one would type =percentrank(dataset,x) in Excel to calculate the percentile. So for example, if the data set is c(1:10), and

Re: [R] R function for percentrank

2007-12-01 Thread John Kane
I don't see one but that means nothing. I think you can write such a function in a few minutes Will something like this work or am I missunderstanding what Excel's percentrank does ? aa <- rnorm(25); aa # data vector percentrank <- function(x) { var <- sort(x) p.rank <- 1:length(var)/lengt

[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]] __ R-help@r-proj