# percentile of a given value: is there a "reverse" quantile function?

5 messages
Open this post in threaded view
|
Report Content as Inappropriate

## percentile of a given value: is there a "reverse" quantile function?

 Dear all, I am familiar with obtaining the value corresponding to a chosen probability via the quantile function. Now I am facing the opposite problem I have a value an want to know it's corresponding percentile in the distribution. So is there a function for this as well? Thank you for your support in advance, Felix ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: percentile of a given value: is there a "reverse" quantile function?

 ?ecdf Best, Stephan On 03.03.2012 13:37, drflxms wrote: > Dear all, > > I am familiar with obtaining the value corresponding to a chosen > probability via the quantile function. > Now I am facing the opposite problem I have a value an want to know it's > corresponding percentile in the distribution. So is there a function for > this as well? > > Thank you for your support in advance, Felix > > ______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code. > ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: percentile of a given value: is there a "reverse" quantile function?

 In reply to this post by drflxms On Mar 3, 2012, at 13:37 , drflxms wrote: > Dear all, > > I am familiar with obtaining the value corresponding to a chosen > probability via the quantile function. > Now I am facing the opposite problem I have a value an want to know it's > corresponding percentile in the distribution. So is there a function for > this as well? For a single value, mean(x <= a) will do. Otherwise check ecdf(). > x <- rnorm(100) > mean(x <= 2) [1] 0.97 > ecdf(x)(2) [1] 0.97 > ecdf(x)(-3:3) [1] 0.00 0.01 0.14 0.48 0.80 0.97 1.00 if you need values for your original data points, rank(x)/length(x) should do (bar missing value issues). > > Thank you for your support in advance, Felix > > ______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code. -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: [hidden email]  Priv: [hidden email] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

## Re : percentile of a given value: is there a "reverse" quantile function?

 In reply to this post by drflxms Hi Felix, Have a look at ?pnorm and ?qnorm. And at ?Distributions Regards, Pascal ----- Mail original ----- De : drflxms <[hidden email]> À : [hidden email] Cc : Envoyé le : Samedi 3 mars 2012 21h37 Objet : [R] percentile of a given value: is there a "reverse" quantile function? Dear all, I am familiar with obtaining the value corresponding to a chosen probability via the quantile function. Now I am facing the opposite problem I have a value an want to know it's corresponding percentile in the distribution. So is there a function for this as well? Thank you for your support in advance, Felix ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code. ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.