Lesson 39 of 46 · Data analysis

Standard deviation, quartiles and boxplots

Judge spread without long calculations: what standard deviation measures, how to find quartiles and the IQR, and what a boxplot can and cannot tell you.

About 22 minutes

In this lesson

  • Compute a standard deviation for a short list, and compare spreads of two lists without computing.
  • Predict how shifting or scaling data changes its standard deviation and interquartile range.
  • Find quartiles, the interquartile range and percentiles, and read a five-number summary or boxplot.

The idea

Spread: how far values sit from the centre

Two lists can share a mean and still look nothing alike: 28, 29, 30, 31, 32 and 10, 20, 30, 40, 50 both have mean 30, but the second is far more spread out. The range (greatest minus least) catches this, yet it depends on only two values. Standard deviation uses every value: it is a typical distance of the data from the mean.

Computing a standard deviation

For a list of nn values with mean xˉ\bar{x}:

  1. Find the mean.
  2. Subtract the mean from each value to get its deviation.
  3. Square each deviation (so negatives do not cancel positives).
  4. Average the squares. This average is the variance.
  5. Take the square root. That is the standard deviation.

σ=(x1−xˉ)2+(x2−xˉ)2+⋯+(xn−xˉ)2n\sigma = \sqrt{\frac{(x_1 - \bar{x})^2 + (x_2 - \bar{x})^2 + \cdots + (x_n - \bar{x})^2}{n}}

Some textbooks divide by n−1n - 1 instead of nn when the data are a sample. This course divides by nn throughout; when two lists of the same length are compared, the choice never changes which spread is larger.

For 3, 5, 7, 9, 11: the mean is 7; the deviations are −4,−2,0,2,4-4, -2, 0, 2, 4; the squares are 16, 4, 0, 4, 16, which add to 40; the variance is 405=8\frac{40}{5} = 8; and σ=8=22≈2.83\sigma = \sqrt{8} = 2\sqrt{2} \approx 2.83.

Reasoning about standard deviation without computing

Most comparison questions can be settled with these facts.

  • The standard deviation is never negative. It is 0 exactly when every value is the same.
  • The further the values sit from their mean, the larger it is. Pulling values towards the mean shrinks it; pushing them away grows it.
  • Adding the same number to every value does not change it: the whole list slides, but the distances to the mean stay the same. 13, 15, 17, 19, 21 has the same standard deviation as 3, 5, 7, 9, 11.
  • Multiplying every value by a positive number kk multiplies the standard deviation by kk. Tripling 3, 5, 7, 9, 11 gives a standard deviation of 3×22=62≈8.493 \times 2\sqrt{2} = 6\sqrt{2} \approx 8.49.
  • Adding a new value equal to the mean lowers the standard deviation (unless it is already 0), because a value with zero deviation joins the average of the squares.

Quartiles and the interquartile range

Quartiles split the ordered data into four parts with roughly equal numbers of values. Conventions differ slightly between textbooks, and for small lists they can give slightly different quartiles. This course always uses the halves method:

  • Q2Q_2 is the median of the whole list.
  • Split the ordered list into a lower half and an upper half. If the number of values is odd, leave the median out of both halves.
  • Q1Q_1 is the median of the lower half; Q3Q_3 is the median of the upper half.

For 2, 5, 7, 10, 12, 13, 18, 25 (eight values), the median is 10+122=11\frac{10 + 12}{2} = 11. The lower half 2, 5, 7, 10 gives Q1=5+72=6Q_1 = \frac{5 + 7}{2} = 6; the upper half 12, 13, 18, 25 gives Q3=13+182=15.5Q_3 = \frac{13 + 18}{2} = 15.5.

The interquartile range is IQR=Q3−Q1\text{IQR} = Q_3 - Q_1, here 15.5−6=9.515.5 - 6 = 9.5. It measures the spread of the middle half of the data, so, like the median, it hardly reacts to outliers. Shifting every value leaves the IQR unchanged; multiplying every value by a positive kk multiplies it by kk.

Percentiles

The ppth percentile is a value at or below which about p%p\% of the data lie. Q1Q_1, the median and Q3Q_3 are roughly the 25th, 50th and 75th percentiles. A percentile is a position in the data, not a percent score: being at the 90th percentile of a test means scoring at or above about 90% of test takers, whatever the raw mark.

Boxplots and the five-number summary

A boxplot draws five numbers: the minimum, Q1Q_1, the median, Q3Q_3 and the maximum. The box runs from Q1Q_1 to Q3Q_3 with a line at the median, and a whisker runs from each end of the box to the extreme value. (Some boxplots stop a whisker short and mark unusually distant values as separate points.) Read it as a table:

Minimum Q1Q_1 Median Q3Q_3 Maximum
12 17 22 30 41

Each of the four sections, whisker, half-box, half-box, whisker, holds about a quarter of the values, however long or short it looks. A long section means the values there are spread out, not that there are more of them. A boxplot shows the range and the IQR directly, but it does not show the mean, the standard deviation or the individual values.

Worked examples

Example 1: A standard deviation by hand, then a shortcut

Find the standard deviation of 6, 8, 10, 12, 14. Then give the standard deviation of 106, 108, 110, 112, 114 and of 3, 4, 5, 6, 7 without recomputing.

  1. Mean: 6+8+10+12+145=505=10\frac{6 + 8 + 10 + 12 + 14}{5} = \frac{50}{5} = 10.

  2. Deviations: −4,−2,0,2,4-4, -2, 0, 2, 4. Squares: 16, 4, 0, 4, 16, with sum 40.

  3. Variance: 405=8\frac{40}{5} = 8, so the standard deviation is 8=22≈2.83\sqrt{8} = 2\sqrt{2} \approx 2.83.

  4. The second list is the first plus 100 in every place: a shift, so the standard deviation stays 222\sqrt{2}.

  5. The third list is the first multiplied by 12\frac{1}{2} (6 becomes 3, 14 becomes 7): a scaling, so the standard deviation is halved to 2≈1.41\sqrt{2} \approx 1.41.

Answer

22≈2.832\sqrt{2} \approx 2.83 for the first two lists and 2≈1.41\sqrt{2} \approx 1.41 for the third. Thinking that the list with larger numbers (106 to 114) has a larger standard deviation is the usual mistake: size does not matter, spread does.

Example 2: Quartiles of an odd-length list

Eleven delivery times, in minutes, are 12, 15, 17, 18, 21, 22, 24, 27, 30, 33, 41. Using the halves method, find the five-number summary, the range and the interquartile range.

  1. The list is already in order and has 11 values, so the median is the 6th value: 22.

  2. With an odd count, leave the median out. Lower half: 12, 15, 17, 18, 21, whose median is Q1=17Q_1 = 17. Upper half: 24, 27, 30, 33, 41, whose median is Q3=30Q_3 = 30.

  3. Five-number summary: minimum 12, Q1=17Q_1 = 17, median 22, Q3=30Q_3 = 30, maximum 41.

  4. Range: 41−12=2941 - 12 = 29. Interquartile range: 30−17=1330 - 17 = 13.

Answer

Summary 12, 17, 22, 30, 41; range 29; IQR 13. Including the median in both halves (another convention) would give halves of six values and Q1=17+182=17.5Q_1 = \frac{17 + 18}{2} = 17.5, Q3=27+302=28.5Q_3 = \frac{27 + 30}{2} = 28.5, which is why this course always says which method it uses.

Example 3: What two boxplots do and do not say

Two groups of 80 students took the same test. Their boxplots give these five-number summaries.

Group Minimum Q1Q_1 Median Q3Q_3 Maximum
P 40 55 62 70 95
R 45 50 66 74 80

Compare the ranges and the IQRs, estimate how many students in P scored between 55 and 70, and say whether you can tell which group had the higher mean.

  1. Ranges: P has 95−40=5595 - 40 = 55; R has 80−45=3580 - 45 = 35. P has the wider range.

  2. IQRs: P has 70−55=1570 - 55 = 15; R has 74−50=2474 - 50 = 24. R's middle half is more spread out, even though its range is smaller.

  3. From Q1Q_1 to Q3Q_3 lies about half the data: roughly 12×80=40\frac{1}{2} \times 80 = 40 students in P.

  4. The mean is not one of the five numbers, and many different sets of scores fit the same summary. So the plots cannot tell you which mean is higher.

Answer

P has the larger range (55 against 35), R the larger IQR (24 against 15); about 40 students in P scored between 55 and 70; and which group had the higher mean cannot be determined. R's higher median (66 against 62) is the tempting but unjustified basis for saying R's mean is higher.

Common traps

  • Thinking a shift changes the spread

    Adding 50 to every value makes the numbers bigger but not more spread out; the standard deviation, range and IQR stay the same. Only scaling (multiplying) changes them. Before comparing two spreads, check whether one list is just the other moved along.

  • Judging spread by the size of the numbers

    A list of large numbers close together, such as 501, 502, 503, has a smaller standard deviation than 1, 5, 9. Look at the gaps between values, not at their size.

  • Reading a long whisker as more data

    Every section of a boxplot holds about a quarter of the values. A long whisker or a wide half-box means those values are spread over a wide interval, not that there are more of them.

  • Expecting a boxplot to show the mean

    The line inside the box is the median. A boxplot gives no mean and no standard deviation, so a statement about them usually "cannot be determined" from a boxplot alone.

Check yourself

Answer each question before you open its answer.

Question 1: Two spreads, no calculation

Quantitative Comparison

List S: 4, 8, 12, 16, 20

List T: 13, 15, 17, 19, 21

Quantity A Quantity B
The standard deviation of list S The standard deviation of list T
  1. A.Quantity A is greater.
  2. B.Quantity B is greater.
  3. C.The two quantities are equal.
  4. D.The relationship cannot be determined from the information given.
Show the answer

Answer: A. Quantity A is greater.

Working

Each value of T equals half the matching value of S plus 11 (42+11=13\frac{4}{2} + 11 = 13, …, 202+11=21\frac{20}{2} + 11 = 21). Halving halves the standard deviation and adding 11 leaves it alone, so T's standard deviation is half of S's. Directly: S has mean 12 and deviations ±8,±4,0\pm 8, \pm 4, 0, so σS=1605=32\sigma_S = \sqrt{\frac{160}{5}} = \sqrt{32}; T has mean 17 and deviations ±4,±2,0\pm 4, \pm 2, 0, so σT=405=8\sigma_T = \sqrt{\frac{40}{5}} = \sqrt{8}. Since 32=28\sqrt{32} = 2\sqrt{8}, S's standard deviation is larger.

Why the other options are wrong

  • B. List T has the larger numbers, but the size of the numbers does not matter; T's values are packed more tightly together.
  • C. Both lists are evenly spaced with five values, but the spacing differs (4 in S, 2 in T), and the spacing sets the spread.
  • D. Every value is given, so both standard deviations are fixed numbers; the comparison can always be settled.

What carries over

Compare spreads by the gaps between values; shifts do nothing, scaling multiplies.

Question 2: Interquartile range of ten values

Data Analysis: descriptive statistics

Ten plants grew the following amounts, in millimetres: 6, 9, 11, 14, 15, 18, 20, 23, 27, 31. Using the halves method from this lesson, what is the interquartile range?

  1. A.6.5
  2. B.12
  3. C.16.5
  4. D.23
  5. E.25
Show the answer

Answer: B. 12

Working

With ten values, the lower half is the first five, 6, 9, 11, 14, 15, whose median is Q1=11Q_1 = 11. The upper half is the last five, 18, 20, 23, 27, 31, whose median is Q3=23Q_3 = 23. The IQR is 23−11=1223 - 11 = 12.

Why the other options are wrong

  • A. This is Q3Q_3 minus the median (23−16.523 - 16.5), the upper half of the box only.
  • C. 16.5 is the median, 15+182\frac{15 + 18}{2}, not a measure of spread.
  • D. 23 is the third quartile itself; the IQR subtracts the first quartile from it.
  • E. 25 is the range, 31−631 - 6, which uses the extremes instead of the quartiles.

What carries over

With an even count, the halves are simply the first and last n/2n/2 values; take the median of each.

Question 3: What a boxplot guarantees

Data Analysis: tables and graphs

A boxplot of 200 commute times, in minutes, has this five-number summary.

Minimum Q1Q_1 Median Q3Q_3 Maximum
8 18 25 34 70

Which of the following statements is supported by the boxplot?

  1. A.The mean commute time is 25 minutes.
  2. B.About half of the commute times are between 18 and 34 minutes.
  3. C.More commute times lie between 34 and 70 minutes than between 25 and 34 minutes.
  4. D.The range of the commute times is 52 minutes.
  5. E.The interquartile range is 25 minutes.
Show the answer

Answer: B. About half of the commute times are between 18 and 34 minutes.

Working

The box runs from Q1=18Q_1 = 18 to Q3=34Q_3 = 34 and holds about the middle half of the data, so about half of the 200 times, roughly 100, lie between 18 and 34 minutes. The range is 62 and the IQR 16, the mean is not shown, and the upper whisker and the section from 25 to 34 each hold about a quarter of the values.

Why the other options are wrong

  • A. 25 is the median. The boxplot does not show the mean, and the long upper whisker suggests the mean is likely above the median anyway.
  • C. The upper whisker is longer, but each section of a boxplot holds about a quarter of the values; length shows spread, not count.
  • D. 52 is 70−1870 - 18, the maximum minus the first quartile. The range is 70−8=6270 - 8 = 62.
  • E. 25 is the median. The interquartile range is 34−18=1634 - 18 = 16.

What carries over

A boxplot tells you counts by quarters and gives the median, range and IQR; it says nothing exact about the mean.

Key points

  • Standard deviation is a typical distance from the mean; bigger gaps mean a bigger standard deviation.

  • Adding a constant leaves standard deviation, range and IQR unchanged; multiplying by k>0k > 0 multiplies them by kk.

  • Quartiles here use the halves method; IQR=Q3−Q1\text{IQR} = Q_3 - Q_1 covers the middle half of the data.

  • Each section of a boxplot holds about a quarter of the values, whatever its length.

  • A boxplot shows the median, not the mean.

All questions here are original and written for UniExamer; none comes from the test maker.

Written by the UniExamer team with AI assistance. Every worked example and check question was re-solved by an independent checker before publication. No subject expert has reviewed this lesson yet. If you find a mistake, write to support@uniexamer.com.

Esercitati su questo argomento

Domande nuove su questa abilità, con spiegazioni svolte. L’esercitazione richiede un Single Exam Pass o Plus.