Skip to content

Bug in boxplot.stats?

2 messages · Trenkler, Dietrich, Brian Ripley

#
Is this a bug?
+ 90, 80, 60, 39, 90, 85, 140, 100, 80, 80)
[1]  60  78  80  90 100
[1]  7.8  7.8  8.0  9.0 10.0

I suppose  the way the numbers in 0.1*xx are internally stored may
cause this problem:
[1] "7.9000000000000004"

Version:
 platform = i386-pc-mingw32
 arch = x86
 os = Win32
 system = x86, Win32
 status =
 major = 1
 minor = 3.1
 year = 2001
 month = 08
 day = 31
 language = R

Windows NT 4.0 (build 1381) Service Pack 6                         

   --- D.Trenkler ---

****************************************************************************
*****
   Dr. Dietrich Trenkler        (dtrenkler at nts6.oec.uni-osnabrueck.de)      
   Statistik / Empirische Wirtschaftsforschung
   Universitaet Osnabrueck
   Rolandstrasse 8                                Phone: +49(0) 541-969-2753
   D-49069 Osnabrueck                          Fax  : +49(0) 541-969-2744
   GERMANY
****************************************************************************
*****



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
It's just rounding errors.  60 is exactly 1.5x the IQR from 78.
Look at the whole output:

$stats
[1]  60  78  80  90 100

$n
[1] 18

$conf
[1] 75.53109 84.46891

$out
[1]  50 120  39 140

vs

$stats
[1]  7.8  7.8  8.0  9.0 10.0

$n
[1] 18

$conf
[1] 7.553109 8.446891

$out
[1]  5.0 12.0  6.0  3.9 14.0

Given that a point is sitting exactly on the boundary, it's arbitrary
whether it gets put inside or outside, and decided by rounding errors.
On Tue, 25 Sep 2001, Trenkler, Dietrich wrote:

            
No.