[R] Extracting x-values from an ecdf

Benjamin Zuckerberg bzuckerb at syr.edu
Fri Nov 16 19:08:48 CET 2007

Dear R users,

Quick question on the use of ecdf for producing a cumulative  
distribution function.

After having produced a cumulative distribution using ecdf, I would  
like to extract the exact x-value for a given percentile.  For example  
I can ascertain the 1st and 3rd quartile using the summary function:

cawa.cdp <- ecdf(cawaocc$LEFF80)
plot(cawa.cdp, ylab="Fn(x)")

But, I would like write a function so that I can produce multiple  
ecdfs for >100 separate distributions and then extract the x-value (in  
this case LEFF80) for a given percentile (e.g., 80) for each separate  
distribution.  Then I could produce an average x-value for all the  
distributions for a given percentile.  I hope this is not too  
confusing.  Thank you for the help!
Benjamin Zuckerberg
Doctoral Candidate
State University of New York
College of Environmental Science and Forestry
Illick 244A, 1 Forestry Drive
Syracuse, New York 13210
Tele: (315) 470-6985
E-mail: bzuckerb at syr.edu

More information about the R-help mailing list