Re: [R] Finding percentile of a value from an empirical distribution

2012-01-10 Thread Robert A'gata
Thank you. That's easier than I thought. On Wed, Jan 11, 2012 at 12:06 AM, Jorge I Velez wrote: > Hi Robert, > > Try > > set.seed(123) > x <- seq(100) > x <- sample(x, 1000, replace = TRUE) > f <- ecdf(x) > f(10) > # [1] 0.099 > f(71) > # [1] 0.716 > > See ?ecdf for more information. > > HTH, > J

Re: [R] Finding percentile of a value from an empirical distribution

2012-01-10 Thread Jorge I Velez
Hi Robert, Try set.seed(123) x <- seq(100) x <- sample(x, 1000, replace = TRUE) f <- ecdf(x) f(10) # [1] 0.099 f(71) # [1] 0.716 See ?ecdf for more information. HTH, Jorge.- On Tue, Jan 10, 2012 at 11:52 PM, Robert A'gata <> wrote: > Hello, > > I am not sure how to do this in R. Any suggesti

Re: [R] Finding percentile of a value from an empirical distribution

2012-01-10 Thread R. Michael Weylandt
Look at ?ecdf Michael On Jan 10, 2012, at 11:52 PM, "Robert A'gata" wrote: > Hello, > > I am not sure how to do this in R. Any suggestion would be > appreciated. I have a vector of values from where I build an empirical > CDF. For example: > >> x <- seq(1,100) >> x <- sample(x,1000,replace=T

[R] Finding percentile of a value from an empirical distribution

2012-01-10 Thread Robert A'gata
Hello, I am not sure how to do this in R. Any suggestion would be appreciated. I have a vector of values from where I build an empirical CDF. For example: > x <- seq(1,100) > x <- sample(x,1000,replace=T) > quantile(x,probs=seq(0,1,.05)) 0% 5%10%15%20%25%30%35%