Tutorials › Introduction to Statistics › Deriving Tukey’s 1.5-IQR Fences

Comparing Groups and Handling Outliers · Tutorial 186 of 996

Deriving Tukey's 1.5-IQR Fences

Learn how the quartiles and interquartile range determine Tukey’s fences, and why the multiplier does not specify a probability.

Beginner 9 min read

What You'll Learn

  • Define the interquartile range and Tukey’s lower and upper fences.
  • Derive each fence algebraically from the corresponding quartile.
  • Calculate fence values from quartiles in several contexts and units.
  • Explain why the fences are not necessarily centered around the median.
  • Distinguish a descriptive flagging convention from a probability cutoff.

Why Define Fences From Quartiles?

A boxplot summarizes a distribution using its quartiles, and those same quartiles can define reference values for identifying observations far from the central half of the data. Tukey’s 1.5-IQR fences provide a consistent descriptive convention: start at each end of the interval from the first to the third quartile, then extend outward by one and a half interquartile ranges. Understanding how the formulas follow from that description makes the role of each term clear.

The fences are calculated from \(Q_1\) and \(Q_3\), the first and third quartiles. These quartiles can depend slightly on the percentile method used, so calculations should use quartiles obtained under one stated and consistent method. The formulas below do not prescribe a percentile method; they take the quartiles as given.

Definition: The interquartile range is \(IQR=Q_3-Q_1\), the distance between the third quartile and the first quartile. Tukey’s lower fence is \(Q_1-1.5(IQR)\), and the upper fence is \(Q_3+1.5(IQR)\). These are descriptive reference values measured in the same units as the original variable.

The factor 1.5 multiplies a spread, not a standard deviation and not a probability. The lower fence is placed 1.5 IQRs below \(Q_1\); the upper fence is placed 1.5 IQRs above \(Q_3\). The word “fence” refers to these calculated boundaries, not to a physical limit on what values can occur.

Deriving the Two Formulas

The central interval from \(Q_1\) to \(Q_3\) has width \(IQR\). To define a lower boundary, extend downward from \(Q_1\) by 1.5 times that width. Moving downward means subtracting the extension from \(Q_1\). To define an upper boundary, extend upward from \(Q_3\) by the same amount, so add the extension to \(Q_3\).

$$ \begin{aligned} \text{Lower fence} &= Q_1-1.5(IQR)\\ &= Q_1-1.5(Q_3-Q_1)\\ &= 2.5Q_1-1.5Q_3, \\[6pt] \text{Upper fence} &= Q_3+1.5(IQR)\\ &= Q_3+1.5(Q_3-Q_1)\\ &= 2.5Q_3-1.5Q_1. \end{aligned} $$

The first forms show the construction most directly: begin at the relevant quartile and extend outward. The expanded forms are algebraically equivalent, but are usually less intuitive for calculating the fences. In either form, the difference \(Q_3-Q_1\) is nonnegative because the third quartile is at least as large as the first.

The equations also show that the fences are not defined using the median and are not necessarily centered around it. In fact, their midpoint follows from adding the two fence formulas and dividing by two:

$$ \frac{[Q_1-1.5(IQR)]+[Q_3+1.5(IQR)]}{2} = \frac{Q_1+Q_3}{2}. $$

The outward extensions cancel when the midpoint is calculated. The midpoint is therefore the average of \(Q_1\) and \(Q_3\), which may or may not equal the median. This distinction matters: the fences are anchored to the quartiles, not constructed to be symmetric around the median.

Worked Example: Fences for Quiz Scores

Suppose a hypothetical class’s quiz-score summary, using a specified quartile method, gives \(Q_1=62\) points and \(Q_3=78\) points. Derive both fences.

First calculate the width between the quartiles:

$$ IQR=Q_3-Q_1=78-62=16\text{ points}. $$

The outward extension is:

$$ 1.5(IQR)=1.5(16)=24\text{ points}. $$

Subtract that extension from \(Q_1\) for the lower fence, and add it to \(Q_3\) for the upper fence:

$$ \begin{aligned} \text{Lower fence}&=62-24=38\text{ points},\\ \text{Upper fence}&=78+24=102\text{ points}. \end{aligned} $$

Thus, the fences are 38 and 102 points. The upper fence being above the quiz’s maximum possible score of 100 does not change the calculation: the formula is a descriptive reference based on the quartiles, not a claim that every value up to the fence is possible.

Worked Calculations and What They Show

A reliable calculation keeps the two operations distinct: find the IQR first, then extend from each quartile by 1.5 IQRs. Retaining units throughout helps prevent mixing the fence calculation with a different measure of spread.

Worked Example: Waiting Times With a Negative Lower Fence

For a hypothetical set of clinic waiting times, suppose \(Q_1=4\) minutes and \(Q_3=10\) minutes. Calculate the fences.

The IQR is:

$$ IQR=10-4=6\text{ minutes}. $$

One and a half IQRs is:

$$ 1.5(IQR)=1.5(6)=9\text{ minutes}. $$

The fences are therefore:

$$ \begin{aligned} \text{Lower fence}&=4-9=-5\text{ minutes},\\ \text{Upper fence}&=10+9=19\text{ minutes}. \end{aligned} $$

The lower fence is \(-5\) minutes. A negative fence is possible even though a negative waiting time is not possible in this setting. It is simply the result of extending below \(Q_1\) by the specified amount; it is not a proposed value for an actual waiting time.

The formulas also have a useful dimensional check. Since both quartiles are measured in the variable’s units, \(Q_3-Q_1\) has those same units. Multiplying the IQR by the number 1.5 preserves its units, and adding or subtracting that extension from a quartile gives a fence in the original units. For example, if quartiles are in minutes, fence values are in minutes; if they are in kilograms, fence values are in kilograms.

Worked Example: Fences Need Not Be Centered at the Median

Suppose a hypothetical measurement is summarized by \(Q_1=0\) hours, median \(=0.5\) hours, and \(Q_3=2\) hours. Calculate the fences and compare their midpoint with the median.

The IQR and extension are:

$$ IQR=2-0=2\text{ hours}, \qquad 1.5(IQR)=1.5(2)=3\text{ hours}. $$

Thus:

$$ \begin{aligned} \text{Lower fence}&=0-3=-3\text{ hours},\\ \text{Upper fence}&=2+3=5\text{ hours}. \end{aligned} $$

The midpoint of the fences is \((-3+5)/2=1\) hour, whereas the median is \(0.5\) hours. The fences are not centered around this median. This is consistent with the general result: their midpoint is \((Q_1+Q_3)/2=(0+2)/2=1\) hour. In another distribution the median could equal that midpoint, so the fences are not necessarily off-center either; their position relative to the median depends on the quartile values and median.

Why 1.5 Is a Flagging Convention, Not a Probability Cutoff

The multiplier 1.5 specifies how far beyond the quartiles to place the fences, in units of IQR. It does not by itself say that a certain percentage of observations should fall outside, nor does it give the probability that an observation will be outside. The IQR is a descriptive measure of spread. The rule makes no probability statement unless additional assumptions about a distribution and a sampling process are introduced.

The same multiplier can produce different proportions beyond the fences for different distributions. Even if two distributions have the same IQR, their values in the tails can behave differently. A distribution with a long tail on one side may extend farther in that direction than a more symmetric distribution. Thus, “1.5” is a chosen scale factor in a descriptive rule, not a universal conversion from a distance to a tail probability.

This also distinguishes the fence calculation from a standardized distance based on a model. The formula uses the observed quartiles and IQR; it does not calculate a standard error, a \(z\)-score, or a p-value. A fence is a data-summary reference value. Whether an observation is beyond a fence is a separate comparison, and any conclusion about the observation requires context rather than interpreting the multiplier as a probability.

A Short Algebraic Check

The expanded expressions provide a check on the signs in the construction. Starting from the lower fence, distribute the subtraction across the IQR:

$$ Q_1-1.5(Q_3-Q_1) =Q_1-1.5Q_3+1.5Q_1 =2.5Q_1-1.5Q_3. $$

For the upper fence, distribute the addition:

$$ Q_3+1.5(Q_3-Q_1) =Q_3+1.5Q_3-1.5Q_1 =2.5Q_3-1.5Q_1. $$

These expansions are useful for checking algebra, but the unexpanded equations remain the clearest way to avoid a sign error: subtract below \(Q_1\), add above \(Q_3\). If \(Q_1=Q_3\), then the IQR is zero and both fences equal that shared quartile. This follows directly from the formulas; it is not a reason to replace the stated rule with a different spread measure.

Common Mistakes

  • Using the wrong quartile as the starting point. The lower fence starts at \(Q_1\), while the upper fence starts at \(Q_3\). Subtract the extension from \(Q_1\) and add it to \(Q_3\).
  • Using 1.5 times a different spread. In this rule the multiplier applies to the IQR, \(Q_3-Q_1\), not to the standard deviation or the range.
  • Calling 1.5 a probability. It is a multiplier for extending the quartile interval. It does not mean a 1.5% tail, a 95% range, or any other probability level.
  • Assuming the fences are centered on the median. Their midpoint is \((Q_1+Q_3)/2\), not necessarily the median. They are defined from the quartiles and need not be centered around the median.
  • Treating a fence as a possible-value limit. A fence can be outside the range of possible values, as a negative lower fence is for nonnegative waiting times. It is a calculated reference, not a physical boundary.
Key takeaway: Calculate \(IQR=Q_3-Q_1\), then extend 1.5 IQRs below \(Q_1\) and above \(Q_3\). The resulting fences are descriptive cutoffs based on quartiles; the multiplier does not assign a probability to observations beyond them.

Check Your Understanding

Answer each question using the definitions and reasoning in this tutorial.

  1. If \(Q_1=18\) and \(Q_3=30\) seconds, what is the IQR, and how far is each fence from its starting quartile?
  2. For the quartiles in Question 1, write the lower- and upper-fence calculations, including their units.
  3. Why can a lower fence for a nonnegative variable be negative without making the calculation invalid?
  4. In general, what is the midpoint of the two fences, and why does that not guarantee that the fences are centered around the median?
  5. Does the multiplier 1.5 imply a fixed probability of observations lying beyond the fences? Explain what information the multiplier does provide.