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

Peter Ehlers ehlers at ucalgary.ca
Sat May 1 01:24:36 CEST 2010


On 2010-04-30 15:48, Prasenjit Kapat wrote:
> 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.

I don't know of any robust ecdf function, but I would
consider a data manipulation step before the call to Ecdf
to submit only valid data. (But you've probably already
tried that and found it too cumbersome.)

  -Peter Ehlers

>
> Any help is certainly appreciated.

-- 
Peter Ehlers
University of Calgary



More information about the R-help mailing list