Re: [R] getting percentiles by factor

2011-03-10 Thread David Winsemius
On Mar 10, 2011, at 11:08 AM, Paolo Cavatore wrote: Hi David, thanks for your comment...I managed to sort it out. Below the final code...paolo # myExample <- data.frame(Ret=seq(-2, 2.5, by=0.5),PE=seq(10,19),Sectors=rep(c("Financial","Industrial"),5)) myExa

Re: [R] getting percentiles by factor

2011-03-10 Thread Paolo Cavatore
Hi David, thanks for your comment...I managed to sort it out. Below the final code...paolo # myExample <- data.frame(Ret=seq(-2, 2.5, by=0.5),PE=seq(10,19),Sectors=rep(c("Financial","Industrial"),5)) myExample <- na.omit(myExample) myecdf2 <- function(x, column, s

Re: [R] getting percentiles by factor

2011-03-10 Thread David Winsemius
On Mar 10, 2011, at 3:37 AM, Paolo Cavatore wrote: Hello, I'm trying to get percentiles (PERCENTRANK for excel users) by factor in the following data.frame: myExample <- data.frame(Ret=seq(-2, 2.5, by=0.5),PE=seq(10,19),Sectors=rep(c("Financial","Industrial"),5)) myExample <- na.omit(myExa

[R] getting percentiles by factor

2011-03-10 Thread Paolo Cavatore
Hello, I'm trying to get percentiles (PERCENTRANK for excel users) by factor in the following data.frame: myExample <- data.frame(Ret=seq(-2, 2.5, by=0.5),PE=seq(10,19),Sectors=rep(c("Financial","Industrial"),5)) myExample <- na.omit(myExample) Thanks to Patrick I I managed to put together the f