R-alpha: ECDFs

Peter Dalgaard BSA p.dalgaard@kubism.ku.dk
22 Aug 1997 00:48:30 +0200


Kurt Hornik <hornik@ci.tuwien.ac.at> writes:

> 
> >>>>> Thomas Lumley writes:
> 
> > On Tue, 19 Aug 1997, Kurt Hornik wrote:
> >> 
> >> 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.
> 
> > The approx() function is supposed to do this (it currently only does
> > linear interpolation).  If the right and left continuous step
> > functions were added to approx then we could easily use approxfun to
> > define the ECDF as a function closure, making it automatically
> > available at any point you want. After all, the ECDF *is* a function.
> 
> Ah, very nice idea!
> 
> So, we'd have
> 
> 	ecdf(x)
> 
> return a FUNCTION of class (e.g.) "step" which would on the one hand
> have the right methods for it and on the other hand would allow us to
> evaluate it at new points right away?
> 
> Martin, Peter?
> 

Neat idea. And - hey! - someone has made it possible to assign classes
to a function now. I looked into that a while ago with a view to kill
off the antipedagogical habit that R and S has of dumping screenfulls
of gibberish on the unsuspecting newbie. At that time, it wasn't
possible so I dropped it, meaning to take it up on the list later on.

That would be like

print.function<-function(f)cat("Use 'show' to see content of function\n")
show<-unclass

Hmm. Do we want something like this? It clashes a little with other
uses of function classes, but not badly as far as I can see.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-