Sitonce
Country: US
Show exams for United States Hong Kong
Sign in

Interquartile Range and Resistance to Outliers

Updated 5 min read
Key takeaway

The interquartile range is IQR = Q3 − Q1.

More key points
  • It measures the spread of the middle half of an ordered data set.
  • Because it uses the first and third quartiles rather than the smallest and largest observations, it is less sensitive to extreme values than the full range.
On this page7 sections
  1. Calculate the IQR
  2. Compare IQR with the full range
  3. Use IQR to flag possible outliers
  4. Read IQR on a box plot
  5. Common errors
  6. Compare IQR with range and standard deviation
  7. Exam takeaway

The interquartile range (IQR) describes how spread out the middle 50% of an ordered data set is. First arrange the values from least to greatest. The first quartile, Q1, marks the lower quarter; the third quartile, Q3, marks the point below which about three quarters of the data lie. Subtract: IQR = Q3 − Q1.

Calculate the IQR

Consider the ordered scores 2, 4, 5, 7, 8, 9, 12, 14. The lower half is 2, 4, 5, 7; its median is Q1 = (4 + 5)/2 = 4.5. The upper half is 8, 9, 12, 14; its median is Q3 = (9 + 12)/2 = 10.5. The IQR is 10.5 − 4.5 = 6. The middle half of the data spans six score points.

Quartile conventions can differ when a data set has an odd number of observations. Some procedures include the overall median in both halves; others exclude it. Use the convention provided by the question, a calculator, or the course materials. Once Q1 and Q3 are established, the IQR calculation is always Q3 minus Q1.

For an odd-sized example, take 1, 3, 4, 6, 8, 10, 14. The overall median is 6. If the convention excludes that median when splitting the halves, the lower half is 1, 3, 4 and Q1 = 3; the upper half is 8, 10, 14 and Q3 = 10; IQR = 7. If a stated procedure includes the median in each half, quartiles may differ. This is why a numeric question's specified convention matters more than memorizing a single rule for every calculator or textbook.

Compare IQR with the full range

The full range is maximum minus minimum. It uses only the two most extreme observations, so one unusually high or low value can change it substantially. The IQR uses quartiles and reflects the middle portion of the data. If a data set gains one very large value, its range may grow dramatically while Q1 and Q3—and therefore the IQR—change little.

For example, scores 10, 11, 12, 13, 14 have range 14 − 10 = 4. If a score of 100 is added, the range becomes 100 − 10 = 90. The IQR gives more information about the cluster of ordinary scores and less weight to the isolated extreme. This resistance makes IQR useful for describing spread when a distribution is skewed or contains outliers.

Use IQR to flag possible outliers

A common rule identifies potential outliers using fences. The lower fence is Q1 − 1.5(IQR), and the upper fence is Q3 + 1.5(IQR). Values outside those limits are flagged for investigation. They may be errors, unusual but valid observations, or evidence that the distribution has a long tail. The rule marks candidates; it does not prove that a value should be deleted.

Suppose Q1 = 12 and Q3 = 20. Then IQR = 8. The lower fence is 12 − 12 = 0 and the upper fence is 20 + 12 = 32. An observation of 35 is above the upper fence and would be flagged. Check the original record and context before deciding what to do with it.

Read IQR on a box plot

In a standard box-and-whisker plot, the left or lower edge of the box is Q1 and the right or upper edge is Q3, depending on the axis orientation. The length of the box represents the IQR. The line inside the box is the median. Whiskers may extend to minimum and maximum values or to the most distant values within the 1.5-IQR fences, depending on the plotting convention. Read the legend or description before interpreting whisker endpoints.

A longer box indicates a wider middle 50% spread; a shorter box indicates a more tightly clustered middle half. The IQR does not show the data's center by itself, so pair it with the median. Two groups can have the same IQR but different medians, or the same median and different IQRs.

When comparing two box plots on the same scale, compare both the medians and box lengths. A higher median indicates a higher center, while a longer box indicates a wider middle-half spread. The boxes do not show every observation or guarantee that values are evenly distributed inside each quartile. A box can be short even when one or more extreme observations lie far out along a whisker.

Common errors

  • Subtracting Q1 from Q3 in reverse order.
  • Using the minimum and maximum instead of the quartiles.
  • Calling IQR the middle 50 percent of observations rather than the numerical width covering them.
  • Assuming an observation outside a fence is automatically invalid.
  • Using a different quartile convention from the one specified.
  • Reading the median line as a quartile on a box plot.

Compare IQR with range and standard deviation

The range uses only the minimum and maximum, so changing either extreme changes the range directly. Standard deviation uses every deviation from the mean and is sensitive to extreme values. IQR uses Q1 and Q3, the boundaries of the middle half, so one isolated extreme often has little effect. These measures describe different parts of the distribution and should not be substituted without considering the question.

A large IQR means the central half is spread out; it does not by itself prove that outliers exist. A small IQR can occur alongside a long tail. Read the plot or data to understand shape, and use the 1.5×IQR fences only as a conventional screening rule, not a definition that every field must use.

Exam takeaway

Order the data, find Q1 and Q3, then calculate Q3 − Q1. Interpret the result as the width of the middle half. Unlike the range, IQR is relatively resistant to extreme values; use it with the median to describe a skewed distribution and with fences to flag possible outliers for review.

Common questions

What does the interquartile range measure?

The numerical spread of the middle 50% of ordered observations, from Q1 to Q3.

Why is IQR more resistant to an outlier than range?

Range uses the minimum and maximum directly; IQR depends on quartiles and usually changes less when one extreme value is added.

Does a value beyond an IQR fence have to be removed?

No. It is flagged for investigation. Check whether it is an error or a valid unusual observation.

What is the IQR formula?

IQR = Q3 − Q1.