HOME

TheInfoList



OR:

In
statistics Statistics (from German language, German: ', "description of a State (polity), state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data. In applying statistics to a s ...
and
probability Probability is a branch of mathematics and statistics concerning events and numerical descriptions of how likely they are to occur. The probability of an event is a number between 0 and 1; the larger the probability, the more likely an e ...
, quantiles are cut points dividing the
range Range may refer to: Geography * Range (geographic), a chain of hills or mountains; a somewhat linear, complex mountainous or hilly area (cordillera, sierra) ** Mountain range, a group of mountains bordered by lowlands * Range, a term used to i ...
of a
probability distribution In probability theory and statistics, a probability distribution is a Function (mathematics), function that gives the probabilities of occurrence of possible events for an Experiment (probability theory), experiment. It is a mathematical descri ...
into continuous intervals with equal probabilities or dividing the
observations Observation in the natural sciences is an act or instance of noticing or perceiving and the acquisition of information from a primary source. In living beings, observation employs the senses. In science, observation can also involve the perceptio ...
in a sample in the same way. There is one fewer quantile than the number of groups created. Common quantiles have special names, such as ''
quartile In statistics, quartiles are a type of quantiles which divide the number of data points into four parts, or ''quarters'', of more-or-less equal size. The data must be ordered from smallest to largest to compute quartiles; as such, quartiles are ...
s'' (four groups), '' deciles'' (ten groups), and ''
percentile In statistics, a ''k''-th percentile, also known as percentile score or centile, is a score (e.g., a data point) a given percentage ''k'' of all scores in its frequency distribution exists ("exclusive" definition) or a score a given percentage ...
s'' (100 groups). The groups created are termed halves, thirds, quarters, etc., though sometimes the terms for the quantile are used for the groups created, rather than for the cut points. -quantiles are values that partition a
finite set In mathematics, particularly set theory, a finite set is a set that has a finite number of elements. Informally, a finite set is a set which one could in principle count and finish counting. For example, is a finite set with five elements. Th ...
of values into
subset In mathematics, a Set (mathematics), set ''A'' is a subset of a set ''B'' if all Element (mathematics), elements of ''A'' are also elements of ''B''; ''B'' is then a superset of ''A''. It is possible for ''A'' and ''B'' to be equal; if they a ...
s of (nearly) equal sizes. There are partitions of the -quantiles, one for each
integer An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
satisfying . In some cases the value of a quantile may not be uniquely determined, as can be the case for the
median The median of a set of numbers is the value separating the higher half from the lower half of a Sample (statistics), data sample, a statistical population, population, or a probability distribution. For a data set, it may be thought of as the “ ...
(2-quantile) of a uniform probability distribution on a set of even size. Quantiles can also be applied to
continuous Continuity or continuous may refer to: Mathematics * Continuity (mathematics), the opposing concept to discreteness; common examples include ** Continuous probability distribution or random variable in probability and statistics ** Continuous ...
distributions, providing a way to generalize
rank statistics In statistics Statistics (from German language, German: ', "description of a State (polity), state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data. In applying s ...
to continuous variables (see
percentile rank In statistics, the percentile rank (PR) of a given score is the percentage of scores in its frequency distribution that are less than that score. Formulation Its mathematical formula is : PR = \frac \times 100, where ''CF''—the cumulative fr ...
). When the
cumulative distribution function In probability theory and statistics, the cumulative distribution function (CDF) of a real-valued random variable X, or just distribution function of X, evaluated at x, is the probability that X will take a value less than or equal to x. Ever ...
of a
random variable A random variable (also called random quantity, aleatory variable, or stochastic variable) is a Mathematics, mathematical formalization of a quantity or object which depends on randomness, random events. The term 'random variable' in its mathema ...
is known, the -quantiles are the application of the''
quantile function In probability and statistics, the quantile function is a function Q: ,1\mapsto \mathbb which maps some probability x \in ,1/math> of a random variable v to the value of the variable y such that P(v\leq y) = x according to its probability distr ...
'' (the
inverse function In mathematics, the inverse function of a function (also called the inverse of ) is a function that undoes the operation of . The inverse of exists if and only if is bijective, and if it exists, is denoted by f^ . For a function f\colon ...
of the
cumulative distribution function In probability theory and statistics, the cumulative distribution function (CDF) of a real-valued random variable X, or just distribution function of X, evaluated at x, is the probability that X will take a value less than or equal to x. Ever ...
) to the values .


Quantiles of a population

As in the computation of, for example,
standard deviation In statistics, the standard deviation is a measure of the amount of variation of the values of a variable about its Expected value, mean. A low standard Deviation (statistics), deviation indicates that the values tend to be close to the mean ( ...
, the estimation of a quantile depends upon whether one is operating with a
statistical population In statistics, a population is a set of similar items or events which is of interest for some question or experiment. A statistical population can be a group of existing objects (e.g. the set of all stars within the Milky Way galaxy) or a hyp ...
or with a sample drawn from it. For a population, of discrete values or for a continuous population density, the -th -quantile is the data value where the cumulative distribution function crosses . That is, is a -th -quantile for a variable if : or, equivalently, and : where is the probability function. For a finite population of equally probable values indexed from lowest to highest, the -th -quantile of this population can equivalently be computed via the value of . If is not an integer, then round up to the next integer to get the appropriate index; the corresponding data value is the -th -quantile. On the other hand, if is an integer then any number from the data value at that index to the data value of the next index can be taken as the quantile, and it is conventional (though arbitrary) to take the average of those two values (see
Estimating quantiles from a sample Estimation (or estimating) is the process of finding an estimate or approximation, which is a value that is usable for some purpose even if input data may be incomplete, uncertain, or unstable. The value is nonetheless usable because it is de ...
). If, instead of using integers and , the "-quantile" is based on a
real number In mathematics, a real number is a number that can be used to measure a continuous one- dimensional quantity such as a duration or temperature. Here, ''continuous'' means that pairs of values can have arbitrarily small differences. Every re ...
with then replaces in the above formulas. This broader terminology is used when quantiles are used to parameterize continuous probability distributions. Moreover, some software programs (including
Microsoft Excel Microsoft Excel is a spreadsheet editor developed by Microsoft for Microsoft Windows, Windows, macOS, Android (operating system), Android, iOS and iPadOS. It features calculation or computation capabilities, graphing tools, pivot tables, and a ...
) regard the minimum and maximum as the 0th and 100th percentile, respectively. However, this broader terminology is an extension beyond traditional statistics definitions.


Examples

The following two examples use the Nearest Rank definition of quantile with rounding. For an explanation of this definition, see
percentile In statistics, a ''k''-th percentile, also known as percentile score or centile, is a score (e.g., a data point) a given percentage ''k'' of all scores in its frequency distribution exists ("exclusive" definition) or a score a given percentage ...
s.


Even-sized population

Consider an ordered population of 10 data values , 6, 7, 8, 8, 10, 13, 15, 16, 20 What are the 4-quantiles (the "quartiles") of this dataset? So the first, second and third 4-quantiles (the "quartiles") of the dataset , 6, 7, 8, 8, 10, 13, 15, 16, 20 are , 9, 15 If also required, the zeroth quartile is 3 and the fourth quartile is 20.


Odd-sized population

Consider an ordered population of 11 data values , 6, 7, 8, 8, 9, 10, 13, 15, 16, 20 What are the 4-quantiles (the "quartiles") of this dataset? So the first, second and third 4-quantiles (the "quartiles") of the dataset , 6, 7, 8, 8, 9, 10, 13, 15, 16, 20 are , 9, 15 If also required, the zeroth quartile is 3 and the fourth quartile is 20.


Relationship to the mean

For any population probability distribution on finitely many values, and generally for any probability distribution with a mean and variance, it is the case that \mu - \sigma\cdot\sqrt \le Q(p) \le \mu + \sigma\cdot\sqrt\,, where is the value of the -quantile for (or equivalently is the -th -quantile for ), where is the distribution's
arithmetic mean In mathematics and statistics, the arithmetic mean ( ), arithmetic average, or just the ''mean'' or ''average'' is the sum of a collection of numbers divided by the count of numbers in the collection. The collection is often a set of results fr ...
, and where is the distribution's
standard deviation In statistics, the standard deviation is a measure of the amount of variation of the values of a variable about its Expected value, mean. A low standard Deviation (statistics), deviation indicates that the values tend to be close to the mean ( ...
. In particular, the median is never more than one standard deviation from the mean. The above formula can be used to bound the value in terms of quantiles. When , the value that is standard deviations above the mean has a lower bound \mu + z \sigma \ge Q\left(\frac\right)\,,\mathrm z \ge 0. For example, the value that is standard deviation above the mean is always greater than or equal to , the median, and the value that is standard deviations above the mean is always greater than or equal to , the fourth quintile. When , there is instead an upper bound \mu + z \sigma \le Q\left(\frac\right)\,,\mathrm z \le 0. For example, the value for will never exceed , the first decile.


Estimating quantiles from a sample

One problem which frequently arises is estimating a quantile of a (very large or infinite) population based on a finite sample of size . Modern statistical packages rely on a number of techniques to
estimate Estimation (or estimating) is the process of finding an estimate or approximation, which is a value that is usable for some purpose even if input data may be incomplete, uncertain, or unstable. The value is nonetheless usable because it is de ...
the quantiles. Hyndman and Fan compiled a
taxonomy image:Hierarchical clustering diagram.png, 280px, Generalized scheme of taxonomy Taxonomy is a practice and science concerned with classification or categorization. Typically, there are two parts to it: the development of an underlying scheme o ...
of nine algorithms used by various software packages. All methods compute , the estimate for the -quantile (the -th -quantile, where ) from a sample of size by computing a real valued index . When is an integer, the -th smallest of the values, , is the quantile estimate. Otherwise a rounding or interpolation scheme is used to compute the quantile estimate from , , and . (For notation, see
floor and ceiling functions In mathematics, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least integer greater than or eq ...
). The first three are piecewise constant, changing abruptly at each data point, while the last six use linear interpolation between data points, and differ only in how the index used to choose the point along the piecewise linear interpolation curve, is chosen.
Mathematica Wolfram (previously known as Mathematica and Wolfram Mathematica) is a software system with built-in libraries for several areas of technical computing that allows machine learning, statistics, symbolic computation, data manipulation, network ...
,
Matlab MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementat ...
, R and
GNU Octave GNU Octave is a scientific programming language for scientific computing and numerical computation. Octave helps in solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly ...
programming languages support all nine sample quantile methods. SAS includes five sample quantile methods,
SciPy SciPy (pronounced "sigh pie") is a free and open-source Python library used for scientific computing and technical computing. SciPy contains modules for optimization, linear algebra, integration, interpolation, special functions, fast Fourier ...
and
Maple ''Acer'' is a genus of trees and shrubs commonly known as maples. The genus is placed in the soapberry family Sapindaceae.Stevens, P. F. (2001 onwards). Angiosperm Phylogeny Website. Version 9, June 2008 nd more or less continuously updated si ...
both include eight, EViews and Julia include the six piecewise linear functions,
Stata Stata (, , alternatively , occasionally stylized as STATA) is a general-purpose Statistics, statistical software package developed by StataCorp for data manipulation, visualization, statistics, and automated reporting. It is used by researchers ...
includes two, Python includes two, and
Microsoft Excel Microsoft Excel is a spreadsheet editor developed by Microsoft for Microsoft Windows, Windows, macOS, Android (operating system), Android, iOS and iPadOS. It features calculation or computation capabilities, graphing tools, pivot tables, and a ...
includes two. Mathematica, SciPy and Julia support arbitrary parameters for methods which allow for other, non-standard, methods. The estimate types and interpolation schemes used include: Notes: *R‑1 through R‑3 are piecewise constant, with discontinuities. *R‑4 and following are piecewise linear, without discontinuities, but differ in how is computed. *R‑3 and R‑4 are not symmetric in that they do not give when . *Excel's PERCENTILE.EXC and Python's default "exclusive" method are equivalent to R‑6. *Excel's PERCENTILE and PERCENTILE.INC and Python's optional "inclusive" method are equivalent to R‑7. This is R's and Julia's default method. *Packages differ in how they estimate quantiles beyond the lowest and highest values in the sample, i.e. and . Choices include returning an error value, computing linear extrapolation, or assuming a constant value. Of the techniques, Hyndman and Fan recommend R-8, but most statistical software packages have chosen R-6 or R-7 as the default. The
standard error The standard error (SE) of a statistic (usually an estimator of a parameter, like the average or mean) is the standard deviation of its sampling distribution or an estimate of that standard deviation. In other words, it is the standard deviati ...
of a quantile estimate can in general be estimated via the bootstrap. The Maritz–Jarrett method can also be used.


The asymptotic distribution of the sample median

The sample median is the most examined one amongst quantiles, being an alternative to estimate a
location parameter In statistics, a location parameter of a probability distribution is a scalar- or vector-valued parameter x_0, which determines the "location" or shift of the distribution. In the literature of location parameter estimation, the probability distr ...
, when the expected value of the distribution does not exist, and hence the sample mean is not a meaningful estimator of a population characteristic. Moreover, the sample median is a more robust estimator than the sample mean. One peculiarity of the sample median is its asymptotic distribution: when the sample comes from a continuous distribution, then the sample median has the anticipated Normal asymptotic distribution, : \text \sim \mathcal\left(\mu=m, \sigma^2=\frac\right) This extends to the other quantiles, : \text \sim \mathcal\left(\mu=x_p, \sigma^2=\frac\right) where is the value of the distribution density at the -th population quantile (x_p=F^(p)). But when the distribution is discrete, then the distribution of the sample median and the other quantiles fails to be Normal (see examples in https://stats.stackexchange.com/a/86638/28746). A solution to this problem is to use an alternative definition of sample quantiles through the concept of the "mid-distribution" function, which is defined as : F_\text(x) = P(X\le x) - \frac 12P(X=x) The definition of sample quantiles through the concept of mid-distribution function can be seen as a generalization that can cover as special cases the continuous distributions. For discrete distributions the sample median as defined through this concept has an asymptotically Normal distribution, see Ma, Y., Genton, M. G., & Parzen, E. (2011). Asymptotic properties of sample quantiles of discrete distributions. Annals of the Institute of Statistical Mathematics, 63(2), 227–243.


Approximate quantiles from a stream

Computing approximate quantiles from data arriving from a stream can be done efficiently using compressed data structures. The most popular methods are t-digest and KLL. These methods read a stream of values in a continuous fashion and can, at any time, be queried about the approximate value of a specified quantile. Both algorithms are based on a similar idea: compressing the stream of values by summarizing identical or similar values with a weight. If the stream is made of a repetition of 100 times v1 and 100 times v2, there is no reason to keep a sorted list of 200 elements, it is enough to keep two elements and two counts to be able to recover the quantiles. With more values, these algorithms maintain a trade-off between the number of unique values stored and the precision of the resulting quantiles. Some values may be discarded from the stream and contribute to the weight of a nearby value without changing the quantile results too much. The t-digest maintains a
data structure In computer science, a data structure is a data organization and storage format that is usually chosen for Efficiency, efficient Data access, access to data. More precisely, a data structure is a collection of data values, the relationships amo ...
of bounded size using an approach motivated by ''k''-means clustering to group similar values. The KLL algorithm uses a more sophisticated "compactor" method that leads to better control of the error bounds at the cost of requiring an unbounded size if errors must be bounded relative to . Both methods belong to the family of ''data sketches'' that are subsets of
Streaming Algorithms In computer science, streaming algorithms are algorithms for processing data streams in which the input is presented as a sequence of items and can be examined in only a few passes, typically one-pass algorithm, just one. These algorithms are desi ...
with useful properties: t-digest or KLL sketches can be combined. Computing the sketch for a very large vector of values can be split into trivially parallel processes where sketches are computed for partitions of the vector in parallel and merged later. The algorithms described so far directly approximate the empirical quantiles without any particular assumptions on the data, in essence the data are simply numbers or more generally, a set of items that can be ordered. These algorithms are computer science derived methods. Another class of algorithms exist which assume that the data are realizations of a random process. These are statistics derived methods, sequential nonparametric estimation algorithms in particular. There are a number of such algorithms such as those based on stochastic approximation or Hermite series estimators. These statistics based algorithms typically have constant update time and space complexity, but have different error bound guarantees compared to computer science type methods and make more assumptions. The statistics based algorithms do present certain advantages however, particularly in the non-stationary streaming setting i.e. time-varying data. The algorithms of both classes, along with some respective advantages and disadvantages have been recently surveyed.


Discussion

Standardized test results are commonly reported as a student scoring "in the 80th percentile", for example. This uses an alternative meaning of the word percentile as the ''interval'' between (in this case) the 80th and the 81st scalar percentile. This separate meaning of percentile is also used in peer-reviewed scientific research articles. The meaning used can be derived from its context. If a distribution is symmetric, then the median is the mean (so long as the latter exists). But, in general, the median and the mean can differ. For instance, with a random variable that has an
exponential distribution In probability theory and statistics, the exponential distribution or negative exponential distribution is the probability distribution of the distance between events in a Poisson point process, i.e., a process in which events occur continuousl ...
, any particular sample of this random variable will have roughly a 63% chance of being less than the mean. This is because the exponential distribution has a long tail for positive values but is zero for negative numbers. Quantiles are useful measures because they are less susceptible than means to long-tailed distributions and outliers. Empirically, if the data being analyzed are not actually distributed according to an assumed distribution, or if there are other potential sources for outliers that are far removed from the mean, then quantiles may be more useful descriptive statistics than means and other moment-related statistics. Closely related is the subject of
least absolute deviations Least absolute deviations (LAD), also known as least absolute errors (LAE), least absolute residuals (LAR), or least absolute values (LAV), is a statistical optimality criterion and a statistical optimization technique based on minimizing the su ...
, a method of regression that is more robust to outliers than is least squares, in which the sum of the absolute value of the observed errors is used in place of the squared error. The connection is that the mean is the single estimate of a distribution that minimizes expected squared error while the median minimizes expected absolute error.
Least absolute deviations Least absolute deviations (LAD), also known as least absolute errors (LAE), least absolute residuals (LAR), or least absolute values (LAV), is a statistical optimality criterion and a statistical optimization technique based on minimizing the su ...
shares the ability to be relatively insensitive to large deviations in outlying observations, although even better methods of
robust regression In robust statistics, robust regression seeks to overcome some limitations of traditional regression analysis. A regression analysis models the relationship between one or more independent variables and a dependent variable. Standard types of re ...
are available. The quantiles of a random variable are preserved under increasing transformations, in the sense that, for example, if is the median of a random variable , then is the median of , unless an arbitrary choice has been made from a range of values to specify a particular quantile. (See quantile estimation, above, for examples of such interpolation.) Quantiles can also be used in cases where only ordinal data are available.


Other quantifications

Values that divide sorted data into equal subsets other than four have different names. *The only 2-quantile is called the
median The median of a set of numbers is the value separating the higher half from the lower half of a Sample (statistics), data sample, a statistical population, population, or a probability distribution. For a data set, it may be thought of as the “ ...
*The 3-quantiles are called tertiles or terciles → T *The 4-quantiles are called
quartile In statistics, quartiles are a type of quantiles which divide the number of data points into four parts, or ''quarters'', of more-or-less equal size. The data must be ordered from smallest to largest to compute quartiles; as such, quartiles are ...
s → Q; the difference between upper and lower quartiles is also called the
interquartile range In descriptive statistics, the interquartile range (IQR) is a measure of statistical dispersion, which is the spread of the data. The IQR may also be called the midspread, middle 50%, fourth spread, or H‑spread. It is defined as the differen ...
, midspread or middle fifty → IQR = . *The 5-quantiles are called quintiles or
pentile PenTile matrix is a family of patented subpixel matrix schemes used in Electronic visual display, electronic device displays. PenTile is a trademark of Samsung. PenTile matrices are used in AMOLED and LCD displays. These Pixel geometry, subpixel l ...
s → QU *The 6-quantiles are called
sextile Sextile may refer to * Sextile (astrological aspect), an astrological aspect ** its corresponding Unicode character , a horizontally-aligned six-pointed asterisk * Sextile (band), an American post-punk band {{Disambiguation ...
s → S *The 7-quantiles are called septiles → SP *The 8-quantiles are called octiles → O *The 10-quantiles are called deciles → D *The 12-quantiles are called duo-deciles or dodeciles → DD *The 16-quantiles are called hexadeciles → H *The 20-quantiles are called ventiles, vigintiles, or demi-deciles → V *The 100-quantiles are called
percentile In statistics, a ''k''-th percentile, also known as percentile score or centile, is a score (e.g., a data point) a given percentage ''k'' of all scores in its frequency distribution exists ("exclusive" definition) or a score a given percentage ...
s or centiles → P * The 1000-quantiles have been called permilles or milliles, but these are rare and largely obsolete


See also

*
Flashsort Flashsort is a distribution sorting algorithm showing linear computational complexity for uniformly distributed data sets and relatively little additional memory requirement. The original work was published in 1998 by Karl-Dietrich Neubert. Co ...
– sort by first bucketing by quantile *
Interquartile range In descriptive statistics, the interquartile range (IQR) is a measure of statistical dispersion, which is the spread of the data. The IQR may also be called the midspread, middle 50%, fourth spread, or H‑spread. It is defined as the differen ...
*
Descriptive statistics A descriptive statistic (in the count noun sense) is a summary statistic that quantitatively describes or summarizes features from a collection of information, while descriptive statistics (in the mass noun sense) is the process of using and an ...
* Expectile – related to expectations in a way analogous to that in which quantiles are related to medians *
Quartile In statistics, quartiles are a type of quantiles which divide the number of data points into four parts, or ''quarters'', of more-or-less equal size. The data must be ordered from smallest to largest to compute quartiles; as such, quartiles are ...
*
Q–Q plot In statistics, a Q–Q plot (quantile–quantile plot) is a probability plot, a List of graphical methods, graphical method for comparing two probability distributions by plotting their ''quantiles'' against each other. A point on the plot ...
*
Quantile function In probability and statistics, the quantile function is a function Q: ,1\mapsto \mathbb which maps some probability x \in ,1/math> of a random variable v to the value of the variable y such that P(v\leq y) = x according to its probability distr ...
* Quantile normalization * Quantile regression * Quantization *
Summary statistics In descriptive statistics, summary statistics are used to summarize a set of observations, in order to communicate the largest amount of information as simply as possible. Statisticians commonly try to describe the observations in * a measure of ...
*
Tolerance interval A tolerance interval (TI) is a statistical interval within which, with some confidence level, a specified sampling (statistics), sampled proportion of a population falls. "More specifically, a tolerance interval provides limits within which at l ...
(" confidence intervals for the ''p''th quantile")


References


Further reading

*


External links

* {{Authority control Summary statistics Theory of probability distributions