[R] Choice of notch size in R

Peter Dalgaard p.dalgaard at biostat.ku.dk
Mon Apr 21 08:08:44 CEST 2008


Alex Reynolds wrote:
> Is there a way to modify the choice of notch size [1] in R's boxplot  
> routine from outlining a 5% significance region, to say 1% or lower?
>   
Not easily. If you look inside boxplots.stats you'll find the hardcoded 
constant 1.58, and the documentation has the following text:

     The notches (if requested) extend to '+/-1.58 IQR/sqrt(n)'. This
     seems to be based on same calculations as the formula with 1.57 in
     Chambers _et al._ (1983, p. 62), given in McGill _et al._ (1978,
     p. 16).  They are based on asymptotic normality of the median and
     roughly equal sample sizes for the two medians being compared, and
     are said to be rather insensitive to the underlying distributions
     of the samples.  The idea appears to be to give roughly a 95%
     confidence interval for the difference in two medians.

Judging from the wording, either the theory is unclear, or the author of 
the help page was not up to speed. My bets are on the former, but as 
things stand, the best way forward is to reproduce the calculations 
leading up to 1.58 and substitute 0.05 by 0.01 in the appropriate place.
> Thanks,
> Alex
>
> [1] McGill, Tukey, and Larsen. "Variations of Box Plots", The American  
> Statistician, Vol. 32, No. 1, 12-16.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>   


-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907



More information about the R-help mailing list