Descriptive Statistics: Boxplots, IQR and Outlier Detection, STAT 350 Exam 1 -- Study Notes
offline

Source: STAT 350 Exam 1, Purdue University

Tags: boxplot, box-and-whisker, IQR, interquartile range, outlier, inner fence, 1.5 IQR rule, five-number summary, quartile, whisker, sample mean, data correction

Difficulty: Introductory | Prerequisites: None beyond basic arithmetic.


Big Picture

Before fitting any probability model, you need to see what your data look like. Boxplots compress a dataset into five key numbers (minimum, Q₁, median, Q₃, maximum) and flag potential outliers. These notes cover how to read and construct a boxplot, how to compute the IQR and inner fences, and how data corrections affect the components of a boxplot. This is typically the first topic in STAT 350 and the easiest to score on, but students lose marks by confusing population-level fences (calculated from the distribution) with sample-level fences (calculated from the data).


TL;DR

A boxplot shows the median, quartiles, whiskers, and any points beyond the fences. The IQR is Q₃ - Q₁, and the 1.5 IQR rule flags values below Q₁ - 1.5·IQR or above Q₃ + 1.5·IQR as potential outliers. When a data point changes, only the components that depend on it will change.


Key Terms

Five-number summary

The minimum, first quartile (Q₁), median, third quartile (Q₃), and maximum of a dataset. These five values define the structure of a boxplot.

Boxplot (box-and-whisker plot)

A graphical summary showing the box from Q₁ to Q₃, a line at the median, whiskers extending to the most extreme non-outlier values, and individual points plotted beyond the whiskers.

Interquartile range (IQR)

Q₃ - Q₁, the range of the middle 50% of the data. Think of it as a measure of spread that is resistant to outliers.

Inner fences

Lower inner fence = Q₁ - 1.5 · IQR. Upper inner fence = Q₃ + 1.5 · IQR. Points outside these fences are flagged as potential outliers and plotted individually on the boxplot.

Whiskers

The lines extending from the box to the most extreme data points that fall within the inner fences. The whiskers do not extend to the fences themselves, only to actual data values.

Outlier (in the boxplot sense)

Any data point that falls outside the inner fences. These are plotted as individual dots or symbols beyond the whiskers.

Sample mean

The arithmetic average of the data, x̄ = Σxᵢ / n. Unlike the median and quartiles, the mean is sensitive to every data value, so changing any single observation changes the mean.


Core Content

Components of a Boxplot

A standard boxplot has these graphical elements:

  • The box, spanning from Q₁ to Q₃.

  • A line inside the box at the median.

  • The lower whisker, from Q₁ down to the smallest data point at or above the lower inner fence.

  • The upper whisker, from Q₃ up to the largest data point at or below the upper inner fence.

  • Individual points plotted for any observations outside the fences.

Some software adds a symbol for the mean (e.g. a diamond or cross), but this is not part of the standard five-number summary.

Effect of Correcting a Data Point

When one value in the dataset changes, the effect on the boxplot depends on where the old and new values sit relative to the quartiles and fences.

Exam example (Q2.1): A value is corrected from 37.24 to 27.24 in a dataset of 100 observations.

The question asks which two graphical components remain unchanged. Because 27.24 replaces 37.24 (both likely in the upper portion of the data but within or near the box), the components that stay the same depend on whether the quartiles shift. With n = 100, changing a single point near the upper end is unlikely to move Q₁ or the median, but it could affect Q₃, the upper whisker, the maximum, the mean, and the number of explicit outlier points.

The answer is D (the number of explicit points) because both 37.24 and 27.24 likely fall within the whisker range, so the outlier count does not change. Q₃ also remains unchanged if the corrected value stays on the same side of the third quartile. The answer given is A and D (Q₃ and the number of explicit points remain unchanged).

Computing Population-Level Inner Fences

When the underlying distribution is known (e.g. Normal), you can compute the theoretical Q₁ and Q₃ from the distribution and then apply the 1.5 IQR rule to the population fences.

Exam example (Problem 3c): X ~ N(118, 10). From Problem 3b, Q₁ = 111.3, Q₃ = 124.7, IQR = 13.4.

  • Lower inner fence: 111.3 - 1.5(13.4) = 111.3 - 20.1 = 91.2

  • Upper inner fence: 124.7 + 1.5(13.4) = 124.7 + 20.1 = 144.8

Given the sample: 88, 89, 108, 111, 115, 115, 116, 124, 130, 134

  • Points below 91.2: 88 and 89. These are potential outliers.

  • Points above 144.8: none.

  • Two points fall outside the population-level inner fences.

IQR Behaviour across Distribution Families

This was tested in Q3d. The key insight for each family:

  • Exponential: IQR = (ln 3) / λ = ln(3) · E[X]. Proportional to the mean.

  • Normal: IQR ≈ 1.34σ. Depends on σ only, not μ.

  • Uniform(0, b): IQR = b/2 = E[X]. Equals the mean.

  • Uniform(a, b): IQR = (b-a)/2. The mean is (a+b)/2. Two different (a, b) pairs can produce the same mean but different IQRs (e.g. Uniform(0, 10) and Uniform(3, 7) have mean 5 but IQR 5 vs. 2). So the IQR is not determined by the mean alone.


Formulas

Item

Formula

IQR

Q₃ - Q₁

Lower inner fence

Q₁ - 1.5 · IQR

Upper inner fence

Q₃ + 1.5 · IQR

Sample mean

x̄ = (Σ xᵢ) / n


Real-World Applications

Quality-control engineers use boxplots and the 1.5 IQR rule to flag manufacturing defects. If a batch of components shows measurements outside the inner fences, those units are pulled for inspection. The population-level fence calculation (using a known distribution rather than sample quartiles) is used when the process parameters are well-established and the goal is to screen individual observations against a known standard.


Common Misconceptions

  • Students confuse the whisker endpoint with the fence. The whisker extends to the most extreme data point within the fence, not to the fence value itself. If no data point sits exactly at the fence, the whisker stops at the nearest data point inside it.

  • The sample mean is not a standard graphical component of a boxplot. Some software overlays it, but the basic boxplot only shows the five-number summary plus outliers.

  • Students sometimes apply the 1.5 IQR rule using sample quartiles when the problem asks for population-level fences (or vice versa). Read the problem carefully: "population level inner fences" means use the distribution's theoretical Q₁ and Q₃.

  • Changing one data value in a large dataset often does not change the median or quartiles, but it always changes the mean. Students sometimes assume the mean is resistant.


Why It Matters / Exam Flags

⚠️ Q2.1 (3 points): Understanding which boxplot components change when a data point is corrected. Requires knowing what each graphical element depends on.

⚠️ Problem 3c (4 points): Computing population-level inner fences from a normal distribution and identifying outliers in a sample. Students must use the population Q₁ and Q₃ (from the normal model), not sample quartiles.

⚠️ Q3d (3 points): Knowing whether IQR is determined by the mean for each distribution family.


Quick Self-Test

  1. True or false: The upper whisker of a boxplot always extends to the maximum value in the dataset.

  1. Fill in the blank: The lower inner fence is Q₁ minus ___ times the IQR.

  1. True or false: Changing one data point in a dataset of 500 observations will always change the sample mean.

  1. Fill in the blank: For a Uniform(0, 20) distribution, the IQR is ___.

  1. True or false: A data point exactly at the inner fence is considered an outlier.

Answers: 1. False (it extends to the most extreme value within the upper inner fence; values beyond become individual points). 2. 1.5. 3. True. 4. 10. 5. No, it is at the boundary. Points must be strictly beyond the fence to be flagged.


Practice Q&A

Q: A dataset has Q₁ = 20 and Q₃ = 50. What are the inner fences?

A: IQR = 30. Lower fence = 20 - 1.5(30) = -25. Upper fence = 50 + 1.5(30) = 95.

Q: In a sample of 100 values, one observation changes from 85 to 75. Both values are between Q₁ and Q₃. Does the median change?

A: No. Both the old and new values are inside the box, so the ordered position of the middle values is unaffected.

Q: For X ~ N(100, 16), compute the population IQR and inner fences.

A: z₀.₂₅ = -0.67, z₀.₇₅ = 0.67. Q₁ = 100 - 0.67(16) = 89.28. Q₃ = 100 + 0.67(16) = 110.72. IQR = 21.44. Lower fence = 89.28 - 1.5(21.44) = 57.12. Upper fence = 110.72 + 1.5(21.44) = 142.88.

Q: Why is the IQR for Uniform(2, 8) not determined by the mean alone?

A: Uniform(2, 8) has mean 5 and IQR = 3. But Uniform(0, 10) also has mean 5 and IQR = 5. Same mean, different IQR, so the mean alone does not determine the IQR.


Connections to Other Topics

The IQR and fence calculations here depend directly on the normal distribution percentile calculations covered in the normal distribution notes. The population-level approach (using theoretical quartiles from a named distribution) bridges descriptive statistics and probability models. In later chapters, boxplots will be used to compare groups in ANOVA-style problems. The resistance of the median and quartiles to outliers (vs. the sensitivity of the mean) connects to discussions of robust statistics.


Related Terms / Search Tags

boxplot, box-and-whisker, five-number summary, Q1, Q3, median, IQR, interquartile range, inner fence, outer fence, 1.5 IQR rule, outlier, whisker, sample mean, resistant statistic, robust, population fence, STAT 350 Purdue, Exam 1