Re: [R] inverse cumulative distribution

From: Shiazy Fuzzy <shiazy_at_gmail.com>
Date: Mon, 04 Jun 2007 13:22:38 +0200

On 6/4/07, salcaraz_at_obelix.umh.es <salcaraz_at_obelix.umh.es> wrote:
> hi all:
>
> ecdf() is the empirical cumulative distribution function, but I need the
> INVERSE cumulative distribution.
>
> how can I calculate it?

Two ways:
1. eccdf <- function(x) { return( 1 - ecdf(x)(x) ) }   This returns an array of element, not an object (like ecdf) 2. Cut&Paste "ecdf" code (from R write "ecdf" and then Enter) into a new function "eccdf" (or whatever u want); in place of "cumsum(...)" write "1-cumsum(...)", and rename the class name "ecdf" in"eccdf" (or other). Note, doing "plot(eccdf(x))" you will not get similar result to "plot(ecdf(x))" since the last one call "plot.ecdf". By the way you can write a "plot.eccdf" function.

>
> thank you in advance
>
> /salva
>
> ______________________________________________
> R-help_at_stat.math.ethz.ch 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.
>



R-help_at_stat.math.ethz.ch 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. Received on Mon 04 Jun 2007 - 11:27:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 04 Jun 2007 - 11:31:57 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.