qboxplot.stats: Helper Function For 'qboxplot'

Description Usage Arguments Value Examples

View source: R/qboxplot.stats.R

Description

Produce quantile-based box-and-whisker plot(s) of the given (grouped) values.

Usage

1
qboxplot.stats(x, probs, qtype, range, output="all")

Arguments

x

a numeric vector of data values from which to calculate the requested statistics.

probs

numeric vector of values in [0,1] specifying the percentiles of the upper hinge, the midpoint (usually the median) and the lower hinge.

qtype

an integer between 1 and 9 indicating which one of the nine quantile algorithms to use (see quantile).

output

limit the output to "quantiles", "outliers" or "n" (see below), or, if set to "all" (the default), outputs a list containing all three.

range

this determines how far the plot whiskers extend out from the box. If range is positive, the whiskers extend to the most extreme data point which is no more than range times the difference in the value of the upper hinge and the value of the lower hinge from the box. A value of zero causes the whiskers to extend to the data extremes.

Value

List with the following components:

quantiles

a matrix, each column contains the extreme of the lower whisker, the lower hinge, the median, the upper hinge and the extreme of the upper whisker for one group/plot.

outliers

a vector with the number of observations in each group.

n

the values of any data points which lie beyond the extremes of the whiskers.

Examples

1
2
3
x = runif(100)
stats = qboxplot.stats(x, probs=c(0.4,0.5,0.6), qtype=7, range=1.5)
stats

Example output

$quantiles
[1] 0.04008562 0.37046287 0.50688141 0.59756746 0.92386866

$outliers
[1] 0.94612795 0.01577551 0.95200619 0.94973380

$n
[1] 100

qboxplot documentation built on May 2, 2019, 8:35 a.m.