Box Plot Statistics






do.conf, do.out



The two ‘hinges’ are versions of the first and third quartile, i.e., close to quantile(x, c(1,3)/4). The hinges equal the quartiles for odd \(n\) (where n <- length(x)) and differ for even \(n\). Whereas the quartiles only equal observations for n %% 4 == 1 (\(n\equiv 1 \bmod 4\)), the hinges do so additionally for n %% 4 == 2 (\(n\equiv 2 \bmod 4\)), and are in the middle of two observations otherwise.



List with named components as follows:




the number of non-NA observations in the sample.







Tukey, J. W. (1977). Exploratory Data Analysis. Section 2C.

McGill, R., Tukey, J. W. and Larsen, W. A. (1978). Variations of box plots. The American Statistician, 32, 12--16. 10.2307/2683468.



Chambers, J. M., Cleveland, W. S., Kleiner, B. and Tukey, P. A. (1983). Graphical Methods for Data Analysis. Wadsworth & Brooks/Cole.

See Also

fivenum, boxplot, bxp.

  • boxplot.stats
library(grDevices) # NOT RUN { require(stats) x <- c(1:100, 1000) (b1 <- boxplot.stats(x)) (b2 <- boxplot.stats(x, do.conf = FALSE, do.out = FALSE)) stopifnot(b1 $ stats == b2 $ stats) # do.out = FALSE is still robust boxplot.stats(x, coef = 3, do.conf = FALSE) ## no outlier treatment: boxplot.stats(x, coef = 0) boxplot.stats(c(x, NA)) # slight change : n is 101 (r <- boxplot.stats(c(x, -1:1/0))) stopifnot(r$out == c(1000, -Inf, Inf)) # } # NOT RUN { <!-- %% extended example (for the NG of Rdoc): --> # } # NOT RUN { # }

Community examples

Looks like there are no examples yet.