In
statistics, a quartile is a type of
quantile
In statistics and probability, quantiles are cut points dividing the range of a probability distribution into continuous intervals with equal probabilities, or dividing the observations in a sample in the same way. There is one fewer quantile th ...
which divides 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 a form of
order statistic
In statistics, the ''k''th order statistic of a statistical sample is equal to its ''k''th-smallest value. Together with rank statistics, order statistics are among the most fundamental tools in non-parametric statistics and inference.
Importan ...
. The three main quartiles are as follows:
* The first quartile (''Q''
1) is defined as the middle number between the smallest number (
minimum
In mathematical analysis, the maxima and minima (the respective plurals of maximum and minimum) of a function, known collectively as extrema (the plural of extremum), are the largest and smallest value of the function, either within a given r ...
) and the
median of the data set. It is also known as the ''lower'' or ''25th empirical'' quartile, as 25% of the data is below this point.
* The second quartile (''Q''
2) is the median of a data set; thus 50% of the data lies below this point.
* The third quartile (''Q''
3) is the middle value between the median and the highest value (
maximum
In mathematical analysis, the maxima and minima (the respective plurals of maximum and minimum) of a function, known collectively as extrema (the plural of extremum), are the largest and smallest value of the function, either within a given r ...
) of the data set. It is known as the ''upper'' or ''75th empirical'' quartile, as 75% of the data lies below this point.
Along with the minimum and maximum of the data (which are also quartiles), the three quartiles described above provide a
five-number summary
The five-number summary is a set of descriptive statistics that provides information about a dataset. It consists of the five most important sample percentiles:
# the sample minimum ''(smallest observation)''
# the lower quartile or ''first quart ...
of the data. This summary is important in statistics because it provides information about both the
center
Center or centre may refer to:
Mathematics
*Center (geometry), the middle of an object
* Center (algebra), used in various contexts
** Center (group theory)
** Center (ring theory)
* Graph center, the set of all vertices of minimum eccentrici ...
and the
spread
Spread may refer to:
Places
* Spread, West Virginia
Arts, entertainment, and media
* ''Spread'' (film), a 2009 film.
* ''$pread'', a quarterly magazine by and for sex workers
* "Spread", a song by OutKast from their 2003 album ''Speakerboxxx/T ...
of the data. Knowing the lower and upper quartile provides information on how big the spread is and if the dataset is
skewed
In probability theory and statistics, skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable about its mean. The skewness value can be positive, zero, negative, or undefined.
For a unimoda ...
toward one side. Since quartiles divide the number of data points evenly, 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 ...
is not the same between quartiles (i.e., ''Q''
3-''Q''
2 ≠ ''Q''
2-''Q''
1) and is instead known as 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 difference ...
(IQR). While the maximum and minimum also show the spread of the data, the upper and lower quartiles can provide more detailed information on the location of specific data points, the presence of
outliers in the data, and the difference in spread between the middle 50% of the data and the outer data points.
Definitions
Computing methods
Discrete distributions
For discrete distributions, there is no universal agreement on selecting the quartile values.
Method 1
# Use the
median to divide the ordered data set into two-halves.
#* If there is an odd number of data points in the original ordered data set, do not include the median (the central value in the ordered list) in either half.
#* If there is an even number of data points in the original ordered data set, split this data set exactly in half.
# The lower quartile value is the median of the lower half of the data. The upper quartile value is the median of the upper half of the data.
This rule is employed by the
TI-83 calculator
boxplot and "1-Var Stats" functions.
Method 2
# Use the
median to divide the ordered data set into two-halves.
#* If there are an odd number of data points in the original ordered data set, include the median (the central value in the ordered list) in both halves.
#* If there are an even number of data points in the original ordered data set, split this data set exactly in half.
# The lower quartile value is the median of the lower half of the data. The upper quartile value is the median of the upper half of the data.
The values found by this method are also known as "
Tukey's hinges"; see also
midhinge In statistics, the midhinge is the average of the first and third quartiles and is thus a measure of location.
Equivalently, it is the 25% trimmed mid-range or 25% midsummary; it is an L-estimator.
: \operatorname(X) = \overline = \frac = \frac ...
.
Method 3
# If there are even numbers of data points, then Method 3 starts off the same as Method 1 or Method 2 above and you can choose to include or not include the median as a datapoint. If you choose to include the median as a new datapoint, proceed to step 2 or 3 of Method 3 because you now have an odd number of datapoints.
# If there are (4''n''+1) data points, then the lower quartile is 25% of the ''n''th data value plus 75% of the (''n''+1)th data value; the upper quartile is 75% of the (3''n''+1)th data point plus 25% of the (3''n''+2)th data point.
# If there are (4''n''+3) data points, then the lower quartile is 75% of the (''n''+1)th data value plus 25% of the (''n''+2)th data value; the upper quartile is 25% of the (3''n''+2)th data point plus 75% of the (3''n''+3)th data point.
Method 4
If we have an ordered dataset
, we can interpolate between data points to find the
th empirical
quantile
In statistics and probability, quantiles are cut points dividing the range of a probability distribution into continuous intervals with equal probabilities, or dividing the observations in a sample in the same way. There is one fewer quantile th ...
if
is in the
quantile. If we denote the integer part of a number
by
, then the empirical quantile function is given by,
,
where
and
.
To find the first, second, and third quartiles of the dataset we would evaluate
,
, and
respectively.
Example 1
Ordered Data Set: 6, 7, 15, 36, 39, 40, 41, 42, 43, 47, 49
Example 2
Ordered Data Set: 7, 15, 36, 39, 40, 41
As there are an even number of data points, the first three methods all give the same results.
Continuous probability distributions
![NormalCDFQuartile3](https://upload.wikimedia.org/wikipedia/commons/3/3c/NormalCDFQuartile3.svg)
If we define a
continuous probability distribution
In probability theory and statistics, a probability distribution is the mathematical function that gives the probabilities of occurrence of different possible outcomes for an experiment. It is a mathematical description of a random phenomenon ...
s as
where
is a
real valued random variable, its
cumulative distribution function (CDF) is given by,
.
The
CDF gives the probability that the random variable
is less than the value
. Therefore, the first quartile is the value of
when
, the second quartile is
when
, and the third quartile is
when
. The values of
can be found with the
quantile function where
for the first quartile,
for the second quartile, and
for the third quartile. The quantile function is the inverse of the cumulative distribution function if the cumulative distribution function is
monotonically increasing
In mathematics, a monotonic function (or monotone function) is a function between ordered sets that preserves or reverses the given order. This concept first arose in calculus, and was later generalized to the more abstract setting of orde ...
.
Outliers
There are methods by which to check for
outliers
In statistics, an outlier is a data point that differs significantly from other observations. An outlier may be due to a variability in the measurement, an indication of novel data, or it may be the result of experimental error; the latter are ...
in the discipline of statistics and statistical analysis. Outliers could be a result from a shift in the location (mean) or in the scale (variability) of the process of interest. Outliers could also be evidence of a sample population that has a non-normal distribution or of a contaminated population data set. Consequently, as is the basic idea of
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 ...
, when encountering an
outlier, we have to explain this value by further analysis of the cause or origin of the outlier. In cases of extreme observations, which are not an infrequent occurrence, the typical values must be analyzed. In the case of quartiles, 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 difference ...
(IQR) may be used to characterize the data when there may be extremities that skew the data; 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 difference ...
is a relatively
robust statistic
Robust statistics are statistics with good performance for data drawn from a wide range of probability distributions, especially for distributions that are not normal. Robust statistical methods have been developed for many common problems, su ...
(also sometimes called "resistance") compared to 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 ...
and
standard deviation. There is also a mathematical method to check for outliers and determining "fences", upper and lower limits from which to check for outliers.
After determining the first and third quartiles and the interquartile range as outlined above, then fences are calculated using the following formula:
:
:
![Boxplot outliers example](https://upload.wikimedia.org/wikipedia/commons/b/b8/Boxplot_outliers_example.jpg)
where ''Q''
1 and ''Q''
3 are the first and third quartiles, respectively. The lower fence is the "lower limit" and the upper fence is the "upper limit" of data, and any data lying outside these defined bounds can be considered an outlier. Anything below the Lower fence or above the Upper fence can be considered such a case. The fences provide a guideline by which to define an
outlier, which may be defined in other ways. The fences define a "range" outside which an outlier exists; a way to picture this is a boundary of a fence, outside which are "outsiders" as opposed to outliers. It is common for the lower and upper fences along with the outliers to be represented by a
boxplot. For a boxplot, only the vertical heights correspond to the visualized data set while horizontal width of the box is irrelevant. Outliers located outside the fences in a boxplot can be marked as any choice of symbol, such as an "x" or "o". The fences are sometimes also referred to as "whiskers" while the entire plot visual is called a "box-and-whisker" plot.
When spotting an outlier in the data set by calculating the interquartile ranges and boxplot features, it might be simple to mistakenly view it as evidence that the population is non-normal or that the sample is contaminated. However, this method should not take place of a
hypothesis test
A statistical hypothesis test is a method of statistical inference used to decide whether the data at hand sufficiently support a particular hypothesis.
Hypothesis testing allows us to make probabilistic statements about population parameters.
...
for determining normality of the population. The significance of the outliers vary depending on the sample size. If the sample is small, then it is more probable to get interquartile ranges that are unrepresentatively small, leading to narrower fences. Therefore, it would be more likely to find data that are marked as outliers.
Computer software for quartiles
Excel:
The Excel function ''QUARTILE(array, quart)'' provides the desired quartile value for a given array of data, using Method 3 from above. In the ''Quartile'' function, array is the dataset of numbers that is being analyzed and quart is any of the following 5 values depending on which quartile is being calculated.
MATLAB:
In order to calculate quartiles in Matlab, the function ''quantile(A,p)'' can be used. Where A is the vector of data being analyzed and p is the percentage that relates to the quartiles as stated below.
See also
*
Five-number summary
The five-number summary is a set of descriptive statistics that provides information about a dataset. It consists of the five most important sample percentiles:
# the sample minimum ''(smallest observation)''
# the lower quartile or ''first quart ...
*
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 ...
*
Box plot
In descriptive statistics, a box plot or boxplot is a method for graphically demonstrating the locality, spread and skewness groups of numerical data through their quartiles. In addition to the box on a box plot, there can be lines (which are ca ...
*
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 difference ...
*
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 ...
*
Quantile
In statistics and probability, quantiles are cut points dividing the range of a probability distribution into continuous intervals with equal probabilities, or dividing the observations in a sample in the same way. There is one fewer quantile th ...
References
{{reflist
External links
Quartile – from MathWorldIncludes references and compares various methods to compute quartiles
– From MathForum.org
Quartiles calculator– simple quartiles calculator
– An example how to calculate it
Summary statistics
4 (number)