[R] ecdf function

Thomas Lumley tlumley at u.washington.edu
Fri Jan 16 23:11:29 CET 2004


On Fri, 16 Jan 2004, Maya Sanders wrote:

> I am trying to use the ecdf function to find p-values (using a vector of numbers to represent my new distribution and a test specific t-statistic value).  I am using :
> 1-ecdf(vector)(t-stat)
>
> vector<-c(5.386, 3.701717, 3.8289, 3.602, 4.469, 5.2087, 6.1613, 4.71181, 5.07716, 2.3517)
> ecdf(vector)(4.6604)
> [1] 0.5
>
>  R will only give me 1 significant digit after the decimal point and I
> am interested in more significant digits.  How would I be able to do
> this?

Add zeros: 0.5000000000000000000000000000000000000000000000

Your empirical CDF value at that point is 5/10, R just doesn't print
trailing zeroes.

	-thomas




More information about the R-help mailing list