ppoints

Prof Brian Ripley Prof Brian Ripley <ripley@stats.ox.ac.uk>
Thu, 3 Sep 1998 18:05:43 +0100 (BST)


> Date: Thu, 3 Sep 1998 18:29:06 +0200
> From: Martin Maechler <maechler@stat.math.ethz.ch>
> To: Bill Simpson <wsimpson@uwinnipeg.ca>
> CC: R-devel@stat.math.ethz.ch
> Subject: Re: ppoints
> 
> Thank you, Bill, for raising this point!
> 
> However, if changing ppoints(.) for compatibility
> we should do it properly.
> 
> e.g., the case
> 	ppoints(10)
> 
> should give the same as
> 
> 	ppoints(1:10).
> 
> Also,  S has the much nicer extra argument  'a'  with the default
> 
> 	if(is.null(a))
> 		a <- if(n > 10) 0.5 else 0.375
> 
> which leads to the behavior you cite below.
> 
> Maybe the S authors would forgive us we just used S' version ppoints()?
> (it's S, not S-plus!)

I just sent privately:

ppoints <- function (n, a = ifelse(n <= 10, 3/8, 1/2)) 
{
  if(length(n) > 1) n <- length(n)
  if(!n) return(numeric(0))
  (1:n - a)/(n + (1-a) - a)
}

which is I believe fully compatible with S (except for the mode of the
length-0 result) and not the same code as S as I wrote it by reading
S's help page.  (I know you can simplify the denominator, but I am
trying to explain the formula.)


Brian

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._