This is basically just a regular boxplot
. For instance with the warpbreaks
data:
# load data
data(warpbreaks)
# model
amod <- aov(breaks ~ tension, data = warpbreaks)
tuk <- glht(amod, linfct = mcp(tension = "Tukey"))
# plot
plot(cld(tuk))
This is pretty much the same as
boxplot(breaks ~ tension, data = warpbreaks)
# OR
boxplot(split(warpbreaks$breaks, warpbreaks$tension))
boxplot
uses boxplot.stats
, which uses stats.fivenum
to calculate the necessary statistics. Notice that this differs slightly from the quantile
function with probs=c(0,.25, .5, .75, 1)
and na.rm=TRUE
. In its simplest form (no NA
's, length>0), fivenum
looks like this:
fivenum <- function (x)
{
x <- sort(x)
n <- length(x)
n4 <- floor((n + 3)/2)/2
d <- c(1, n4, (n + 1)/2, n + 1 - n4, n)
0.5 * (x[floor(d)] + x[ceiling(d)])
}