[Rd] fivenum accuracy (PR#13164)

Duncan Murdoch murdoch at stats.uwo.ca
Wed Oct 15 12:23:46 CEST 2008


On 14/10/2008 5:30 PM, dleong at analogic.com wrote:
> Full_Name: David Leong
> Version: 2.7.2
> OS: Windows XP
> Submission from: (NULL) (12.187.86.2)
> 
> 
> It appears for the fivenum function, there is a strait average between two
> ranked samples. This should be a linear interpolation between ranks.

Not according to the documentation.  This is not a bug.

If you want quantiles, use the quantile function.  fivenum() is 
documented to give Tukey's five number summary (minimum, lower-hinge, 
median, upper-hinge, maximum).

Duncan Murdoch

> For the following data set
> 
> #data
> CaCO3<-c(130.8,129.9,131.5,131.2,129.5,132.7,131.5,127.8,133.7,132.2,134.8,131.7,133.9,129.8,131.4,128.8,132.7,132.8,131.4,131.3)
> 
> fivenum reports 127.80 130.35 131.45 132.70 134.80
> 
> 130.35 should be 130.125. The other are correct.
> 
> For the 20 points, the rank is (20+1)/4=5.25 so the weighting factor is 0.25 not
> 0.5.
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list