Skip to content
Back to formatted view

Raw Message

Message-ID: <x2isshzjyx.fsf@biostat.ku.dk>
Date: 2003-05-11T13:31:29Z
From: Peter Dalgaard
Subject: what does boxplot draw?
In-Reply-To: <3710.030511@eimb.ru>

Wladimir Eremeev <wl at eimb.ru> writes:

> Dear r-help,
> 
>    Unfortunately I cannot find in the documentation what determines
>    ranges of a 'box' in the box-and-whisker plot.
>    
>    It is said in "Simple R" (http://www.math.csi.cuny.edu/Statistics/R/simpleR)
>    that they are 1st and 3rd Qus usually.
> 
>    I tried to add to boxplot lines with (quantile(x,probs=0.25)), but
>    lines do not coincide with edges of boxes.

The full story is in help(boxplots.stats). It's all a bit quirky, but
faithful to the original reference by Tukey. It may be illustrative to
do something like

lapply(4:10,function(i)cbind(
     bxp=boxplot.stats(1:i)$stats,
      qu=quantile(1:i)))

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907