When I look at ppoints I see: ppoints<-function (x) { n <- length(x) if (n == 1) n <- x (1:n - 0.5)/n } However Venables & Ripley (2nd ed, p 165) say ppoints() should return (i-1/2)/n for n>=11; (i-3/8)/(n+1/4) for n<=10. The version below should work as described: ppoints<-function (x) { n <- length(x) if (n <= 10) (1:n - 0.375)/(n + 0.25) else (1:n - 0.5)/n } Bill Simpson -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Thank you, Bill, for raising this point!>>>>> "Bill" == Bill Simpson <wsimpson@uwinnipeg.ca> writes:Bill> When I look at ppoints I see: Bill> ppoints<-function (x) Bill> { Bill> n <- length(x) Bill> if (n == 1) Bill> n <- x Bill> (1:n - 0.5)/n Bill> } Bill> However Venables & Ripley (2nd ed, p 165) say ppoints() should return Bill> (i-1/2)/n for n>=11; (i-3/8)/(n+1/4) for n<=10. Bill> The version below should work as described: Bill> ppoints<-function (x) Bill> { Bill> n <- length(x) Bill> if (n <= 10) Bill> (1:n - 0.375)/(n + 0.25) Bill> else Bill> (1:n - 0.5)/n Bill> } 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!) Martin -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._