R-alpha: ECDFs

Kurt Hornik Kurt.Hornik@ci.tuwien.ac.at
Tue, 19 Aug 1997 20:51:17 +0200


>>>>> Ross Ihaka writes:

> 	Kurt Hornik writes:
>> What's also needed is something to produce and plot empirical
>> distribution functions.  I thought I could write something for my
>> Biostat course last semester, but it never happened ...

> Have you had a look at the type="S" and type="s" options to plot?
> They produce two variants of step functions.  I didn't know about them
> until I started implementing our version graphics.  They are
> documented in "par".

I hadn't known about them either, but I think Martin's plot.step is
needed for plotting e.g. ECDFs.

Here's something what is needed for teaching elementary statistics:
Given a sample vector x, compute the corresponding ECDF, plot it, and
perhaps evaluate it at points other than the data points.

One solution might be to have a function "ecdf" which returns an obj of
class "step" (e.g., simply a list with the points where the jumps occur
and the corresponding values, and maybe if we want to be more general
than that info on whether the function is left- or right-continuous at
the point (or perhaps attains a different value).  (I.e., something of
the kind that Martin's plot.step uses ...)

This would more or less automagically take care of the plotting part.
We could also easily add print and summary methods.

The question is, how can we `easily' evaluate a step function at some
point?  Using `predict' does not seem to be the right thing ... any
suggestions?

-k
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-