Safekipedia

Interquartile range

Discoverer · ages 10+Adapted from Wikipedia
Boxplot (with an interquartile range) and a probability density function (pdf) of a Normal N(0,σ2) Population

In descriptive statistics, the interquartile range (IQR) is a measure of statistical dispersion, which shows how spread out the data is. It is also called the midspread, middle 50%, fourth spread, or H‑spread. It is found by subtracting the 25th percentile of the data from the 75th percentile.

Boxplot (with an interquartile range) and a probability density function (pdf) of a Normal N(0,σ2) Population

To calculate the IQR, the data set is split into quartiles, which are four even parts arranged in order from smallest to largest, using linear interpolation. The first part ends at Q1, the lower quartile, which matches the 25th percentile. The middle point is Q2, the median. The upper quartile, Q3, matches the 75th percentile. So, IQR = Q3 − Q1.

The IQR is an example of a trimmed estimator, which is defined as the 25% trimmed range. It improves the accuracy of statistics about a data set by dropping lower-contribution, outlying points. It is also used as a robust measure of scale. On a box plot, it can be clearly seen as the box.

For other uses of the abbreviation, see IQR (disambiguation).

Use

Unlike the total range, the interquartile range has a breakdown point of 25%, so it is often preferred to the total range. The IQR is used to build box plots, which are simple graphs that show a probability distribution. Businesses also use the IQR as a marker for their income 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 matching measure of central tendency. The IQR can be used to find outliers (see below), and it may also show the skewness of the data. The quartile deviation, or semi-interquartile range, is half the IQR.

Algorithm

The IQR is found by subtracting the first quartile, Q1, from the third quartile, Q3. Each quartile is a median. This works whether the number of values is even or odd.

The first quartile Q1 is the median of the smallest half of the values, and the third quartile Q3 is the median of the largest half. The second quartile Q2 is the same as the ordinary median.

Examples

The first example uses a table of 13 numbers, which follows the rules for an odd number of entries. For this data, the interquartile range is the third quartile (Q3) minus the first quartile (Q1), which gives 119 - 31 = 88.

The second example looks at a data set shown in a box plot. Its first quartile is 7, its median is 8.5, its third quartile is 9, and its interquartile range is 2. The lower and upper whiskers are set at 1.5 times the IQR beyond the quartiles, which gives 4 and 12. If no data point sits exactly at those values, the nearest data point closer to the middle is used instead, so the whiskers can have different lengths. The median, the smallest and largest values, and the first and third quartiles make up the Five-number summary.

ix[i]MedianQuartile
17Q2=87
(median of whole table)
Q1=31
(median of lower half, from row 1 to 6)
27
331
431
547
675
787
8115Q3=119
(median of upper half, from row 8 to 13)
9116
10119
11119
12155
13177

Distributions

The interquartile range of a continuous distribution can be worked out using the probability density function, which gives the cumulative distribution function. The lower quartile is the number where the area under the probability density function reaches 0.25, and the upper quartile is the number where it reaches 0.75. These quartiles can also be found with the quantile function. The interquartile range and median of some common distributions are shown below.

The interquartile range, mean, and standard deviation of a group of data can be used in a simple test to see if the data are normally distributed, or Gaussian. If the data are normally distributed, the standard score of the first quartile is about −0.67, and the standard score of the third quartile is about +0.67. If the actual quartiles are very different from these calculated values, the data are not normally distributed. However, this simple test can sometimes give a wrong result, so a better test, such as a Q–Q plot, is often recommended.

DistributionMedianIQR
Normalμ2 Φ−1(0.75)σ ≈ 1.349σ ≈ (27/20)σ
Laplaceμ2b ln(2) ≈ 1.386b
Cauchyμ2γ

Outliers

Box-and-whisker plot of 20 values. The whiskers reach the most extreme values within 1.5 IQR of the box; the value beyond the upper fence (Q3 + 1.5 IQR) is plotted as an outlier.

The interquartile range is often used to find outliers in data. Outliers are defined as values that fall below Q1 − 1.5 IQR or above Q3 + 1.5 IQR.

In a boxplot, the highest and lowest values within this limit are shown by lines called whiskers that stick out from the box. Sometimes there is an extra bar at the end of each whisker. Any outliers are shown as separate single points.

Quiz time!

5 questions about Interquartile range

Question 1 of 5

What does the interquartile range (IQR) show?

Keep exploring

This article is a child-friendly adaptation of the Wikipedia article on Interquartile range, available under CC BY-SA 4.0.

Images from Wikimedia Commons. Tap any image to view credits and license.