In
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 a ...
, the interquartile range (IQR) is a measure of
statistical dispersion
In statistics, dispersion (also called variability, scatter, or spread) is the extent to which a distribution is stretched or squeezed. Common examples of measures of statistical dispersion are the variance, standard deviation, and interquartil ...
, 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 between the 75th and 25th
percentiles of the data.
To calculate the IQR, the data set is divided into quartiles, or four rank-ordered even parts via linear interpolation.
These quartiles are denoted by Q
1 (also called the lower quartile), ''Q''
2 (the
median), and ''Q''
3 (also called the upper quartile). The lower quartile corresponds with the 25th percentile and the upper quartile corresponds with the 75th percentile, so IQR = ''Q''
3 − ''Q''
1.
The IQR is an example of a
trimmed estimator, defined as the 25% trimmed
range, which enhances the accuracy of dataset statistics by dropping lower contribution, outlying points.
It is also used as a
robust measure of scale In statistics, robust measures of scale are methods that quantify the statistical dispersion in a sample of numerical data while resisting outliers. The most common such robust statistics are the ''interquartile range'' (IQR) and the ''median abs ...
It can be clearly visualized by the box on a
Box plot.
Use
Unlike total
range, the interquartile range has a
breakdown point of 25%, and is thus often preferred to the total range.
The IQR is used to build
box plots, simple graphical representations of a
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 phenomeno ...
.
The IQR is used in businesses as a marker for their
income
Income is the consumption and saving opportunity gained by an entity within a specified timeframe, which is generally expressed in monetary terms. Income is difficult to define conceptually and the definition may be different across fields. F ...
rates.
For a symmetric distribution (where the median equals the
midhinge, the average of the first and third quartiles), half the IQR equals the
median absolute deviation (MAD).
The
median is the corresponding measure of
central tendency
In statistics, a central tendency (or measure of central tendency) is a central or typical value for a probability distribution.Weisberg H.F (1992) ''Central Tendency and Variability'', Sage University Paper Series on Quantitative Applications ...
.
The IQR can be used to identify
outlier
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 ...
s (see
below
Below may refer to:
*Earth
* Ground (disambiguation)
* Soil
* Floor
* Bottom (disambiguation)
* Less than
*Temperatures below freezing
* Hell or underworld
People with the surname
* Ernst von Below (1863–1955), German World War I general
* Fr ...
). The IQR also may indicate the
skewness
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 unimo ...
of the dataset.
The quartile deviation or semi-interquartile range is defined as half the IQR.
Algorithm
The IQR of a set of values is calculated as the difference between the upper and lower quartiles, Q
3 and Q
1. Each quartile is a median
calculated as follows.
Given an even ''2n'' or odd ''2n+1'' number of values
:''first quartile Q
1'' = median of the ''n'' smallest values
:''third quartile Q
3'' = median of the ''n'' largest values
The ''second quartile Q
2'' is the same as the ordinary median.
Examples
Data set in a table
The following table has 13 rows, and follows the rules for the odd number of entries.
For the data in this table the interquartile range is IQR = Q
3 − Q
1 = 119 - 31 = 88.
Data set in a plain-text box plot
+−−−−−+−+
* , −−−−−−−−−−−, , , −−−−−−−−−−−,
+−−−−−+−+
+−−−+−−−+−−−+−−−+−−−+−−−+−−−+−−−+−−−+−−−+−−−+−−−+ number line
0 1 2 3 4 5 6 7 8 9 10 11 12
For the data set in this
box plot:
* lower (first) quartile ''Q''
1 = 7
* median (second quartile) ''Q''
2 = 8.5
* upper (third) quartile ''Q''
3 = 9
* interquartile range, IQR = ''Q''
3 - ''Q''
1 = 2
* lower 1.5*IQR whisker = ''Q''
1 - 1.5 * IQR = 7 - 3 = 4. (If there is no data point at 4, then the lowest point greater than 4.)
* upper 1.5*IQR whisker = ''Q''
3 + 1.5 * IQR = 9 + 3 = 12. (If there is no data point at 12, then the highest point less than 12.)
This means the 1.5*IQR whiskers can be uneven in lengths. The median, minimum, maximum, and the first and third quartile constitute the
Five-number summary.
Distributions
The interquartile range of a continuous distribution can be calculated by integrating the
probability density function
In probability theory, a probability density function (PDF), or density of a continuous random variable, is a function whose value at any given sample (or point) in the sample space (the set of possible values taken by the random variable) c ...
(which yields 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.
Ev ...
—any other means of calculating the CDF will also work). The lower quartile, ''Q''
1, is a number such that integral of the PDF from -∞ to ''Q''
1 equals 0.25, while the upper quartile, ''Q''
3, is such a number that the integral from -∞ to ''Q''
3 equals 0.75; in terms of the CDF, the quartiles can be defined as follows:
:
:
where CDF
−1 is the
quantile function
In probability and statistics, the quantile function, associated with a probability distribution of a random variable, specifies the value of the random variable such that the probability of the variable being less than or equal to that value e ...
.
The interquartile range and median of some common distributions are shown below
Interquartile range test for normality of distribution
The IQR,
mean
There are several kinds of mean in mathematics, especially in statistics. Each mean serves to summarize a given group of data, often to better understand the overall value ( magnitude and sign) of a given data set.
For a data set, the '' ari ...
, and
standard deviation of a population ''P'' can be used in a simple test of whether or not ''P'' is
normally distributed, or Gaussian. If ''P'' is normally distributed, then the
standard score
In statistics, the standard score is the number of standard deviations by which the value of a raw score (i.e., an observed value or data point) is above or below the mean value of what is being observed or measured. Raw scores above the me ...
of the first quartile, ''z''
1, is −0.67, and the standard score of the third quartile, ''z''
3, is +0.67. Given ''mean'' =
and ''standard deviation'' = σ for ''P'', if ''P'' is normally distributed, the first quartile
:
and the third quartile
:
If the actual values of the first or third quartiles differ substantially from the calculated values, ''P'' is not normally distributed. However, a normal distribution can be trivially perturbed to maintain its Q1 and Q2 std. scores at 0.67 and −0.67 and not be normally distributed (so the above test would produce a false positive). A better test of normality, such as
Q–Q plot would be indicated here.
Outliers

The interquartile range is often used to find
outlier
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 ...
s in data. Outliers here are defined as observations that fall below Q1 − 1.5 IQR or above Q3 + 1.5 IQR. In a boxplot, the highest and lowest occurring value within this limit are indicated by ''whiskers'' of the box (frequently with an additional bar at the end of the whisker) and any outliers as individual points.
See also
*
Interdecile range
*
Midhinge
*
Probable error
*
Robust measures of scale In statistics, robust measures of scale are methods that quantify the statistical dispersion in a sample of numerical data while resisting outliers. The most common such robust statistics are the ''interquartile range'' (IQR) and the ''median absol ...
References
External links
*
{{DEFAULTSORT:Interquartile Range
Scale statistics
Wikipedia articles with ASCII art