
An extension of standard boxplots which draws k letter statistics. Conventional boxplots (Tukey 1977) are useful displays for conveying rough information about the central 50% of the data and the extent of the data.
LVboxplot(x, ...)# S3 method for formula
LVboxplot(formula, alpha = 0.95, k = NULL, perc = NULL,
horizontal = TRUE, xlab = NULL, ylab = NULL, col = "grey30",
bg = "grey90", width = 0.9, width.method = "linear",
median.col = "grey10", ...)
# S3 method for numeric
LVboxplot(x, alpha = 0.95, k = NULL, perc = NULL,
horizontal = TRUE, xlab = NULL, ylab = NULL, col = "grey30",
bg = "grey90", width = 0.9, width.method = "linear",
median.col = "grey10", ...)
numeric vector of data
passed onto plot
a plotting formula of the form y ~ x
, where x
is a string or factor. The values of y
will be split into groups
according to their values on x
and separate letter value box plots
of y
are drawn side by side in the same display.
if supplied, depth k is calculated such that (1-alpha
)100
intervals of an LV statistic do not extend into
neighboring LV statistics.
number of letter value statistics used
if supplied, depth k is adjusted such that perc
percent
outliers are shown
display horizontally (TRUE) or vertically (FALSE)
x axis label
y axis label
vector of colours to use
background colour
maximum height/width of box
one of 'linear', 'height' or 'area'. Methods 'height' and 'area' ensure that these dimension are proportional to the number of observations within each box.
colour of the line for the median
For moderate-sized data sets (
The letter-value box plot addresses both these shortcomings: it conveys
more detailed information in the tails using letter values, only out to the
depths where the letter values are reliable estimates of their
corresponding quantiles (corresponding to tail areas of roughly
n <- 10
oldpar <- par()
par(mfrow=c(4,2), mar=c(3,3,3,3))
for (i in 1:4) {
x <- rexp(10 ^ (i + 1))
boxplot(x, col = "grey", horizontal = TRUE)
title(paste("Exponential, n = ", length(x)))
LVboxplot(x, col = "grey", xlab = "")
}
par(mfrow=oldpar$mfrow, mar=oldpar$mar)
with(ontime, LVboxplot(sqrt(TaxiIn + TaxiOut) ~ UniqueCarrier, horizontal=FALSE))
Run the code above in your browser using DataLab