describe(deprecated)/quantile - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Home : Support : Online Help : describe(deprecated)/quantile

stats[describe]

 quantile
 Quantiles of a Statistical List

 Calling Sequence stats[describe, quantile[which](data, gap) describe[quantile[which, offset]](data, gap)

Parameters

 data - statistical list which - quantile required, a number between 0 and 1 offset - (optional, default = 0 ) offset added to the calculated position gap - (optional, default=false) The common size of gaps between classes.

Description

 • Important: The stats package has been deprecated. Use the superseding package Statistics instead.
 • The quantile function of the subpackage stats[describe, ...] finds the item in data that corresponds to the quantile specified by which. If the requested quantile falls between entries, it is interpolated.
 • The quantile can be describe as follows. Given a fraction r between 0 and 1. Sort the data. The r-th-quantile is a value that separates the data into 2 parts. One having the portion r of the sorted data which is less than the quantile value, the other have the 1-r portion of the data which is greater than the quantile value.
 • The precise position is computed as followed:  r*n+offset, where n is the total weight of the data list.
 • The quantile generalizes the concept of median, quartile, percentile etc.
 • To obtain the median, one has to use an offset of 1/2. This is because the median of two numbers is situated  midway between these numbers.
 • NOTE: the quantile and the quartile have similar spelling.
 • Missing data are ignored.
 • For information about the parameter gap, see describe[gaps].
 • The data must be numeric.
 • The command with(stats[describe],quantile) allows the use of the abbreviated form of this command.

Examples

Important: The stats package has been deprecated. Use the superseding package Statistics instead.

 > $\mathrm{with}\left(\mathrm{stats}\right):$
 > $\mathrm{data}≔\left[\mathrm{seq}\left(\frac{i}{7},i=1..60\right)\right]:$
 > ${\mathrm{describe}}_{{\mathrm{quantile}}_{\frac{1}{3}}}\left(\mathrm{data}\right)$
 $\frac{{20}}{{7}}$ (1)
 > $\mathrm{somequantiles}≔\left[\mathrm{seq}\left({\mathrm{describe}}_{{\mathrm{quantile}}_{\frac{i}{20}}},i=8..15\right)\right]:$
 > $\mathrm{somequantiles}\left(\mathrm{data}\right)$
 $\left[\frac{{24}}{{7}}{,}\frac{{27}}{{7}}{,}\frac{{30}}{{7}}{,}\frac{{33}}{{7}}{,}\frac{{36}}{{7}}{,}\frac{{39}}{{7}}{,}{6}{,}\frac{{45}}{{7}}\right]$ (2)
 > ${\mathrm{describe}}_{\mathrm{median}}\left(\left[10,20,30\right]\right)$
 ${20}$ (3)
 > ${\mathrm{describe}}_{{\mathrm{quantile}}_{\frac{1}{2},\frac{1}{2}}}\left(\left[10,20,30\right]\right)$
 ${20}$ (4)
 > ${\mathrm{describe}}_{\mathrm{median}}\left(\left[10,20,30,40\right]\right)$
 ${25}$ (5)
 > ${\mathrm{describe}}_{{\mathrm{quantile}}_{\frac{1}{2},\frac{1}{2}}}\left(\left[10,20,30,40\right]\right)$
 ${25}$ (6)
 > ${\mathrm{describe}}_{{\mathrm{quantile}}_{\frac{1}{2}}}\left(\left[10,20,30,40\right]\right)$
 ${20}$ (7)