[R] Trouble using Ecdf () from the Hmisc library

Prasenjit Kapat kapatp at gmail.com
Fri Apr 30 23:48:34 CEST 2010


Hello:

[Kindly Cc when replying]

The question in a nutshell is this: Is there a more robust alternative
to Ecdf ()?

The details:

I've used Ecdf () _a lot_ over the past few years and I have learned
to live with its warnings. But I am running short on time and patience
now [*] Here is a reproducible example:

> library (Hmisc)
> x <- read.csv ( file = 'http://www.stat.osu.edu/~pkapat/miscl/Data4Ecdf.csv')
> table (x[, c('X1','X2')])
    X2
X1    A  B
  6   0  1
  13  7 20
  15 13 26
  16 13 13
  17 10 19
  18 12 10

As you can see (X1=6,X2=A) is a degenerate cell and (X1=6,X2=B) is
"near" degenerate! So, errors/warnings are certainly expected while
dealing with these, as seen here:

> Ecdf (~Y|X2, groups=X1, data=x)
> Ecdf (~Y|X2, groups=X1, data=x, label.curves=FALSE)

Hence the question:
Is there a robust function which can ignore such degenerate (and/or
"near" degenerate) cells and be able to plot the rest.

Any help is certainly appreciated.
-- 
Prasenjit

PS: [*] Ow I could spend a day/two to hack panel.Ecdf and/or
prepanel.Ecdf for the purpose :( But making sure that the hacked code
is bug-free would be more time consuming ;)



More information about the R-help mailing list