MathematicsGrade 6–9

Mean, median and box plots

One outlier pulls the mean away while the median barely moves. Dragging single data points shows which value is how robust.

Loading simulation …

What is it about?

A maths test, pocket money or the long jump produce many single values – the raw data. To describe them, we sum them up in a few statistics.

Mean (arithmetic mean): add all values and divide by their number nn.

xˉ=x1+x2+…+xnn\bar{x} = \frac{x_1 + x_2 + \ldots + x_n}{n}

For the points of class 7a this gives xˉ=29515≈19.67\bar{x} = \frac{295}{15} \approx 19.67 points. You can picture the mean as the balance point: put the points on the number line as equally heavy balls, and the line balances exactly at the mean (red triangle).

Median (middle value): put the values in order of size (ordered list). The median is exactly in the middle. With n=15n = 15 values it is the 88th value. With an even number there are two middle values; the median is their mean, so for n=12n = 12 it is 6th value+7th value2\frac{6\text{th value} + 7\text{th value}}{2}. At least half of the values are less than or equal to the median, at least half are greater than or equal to it.

Quartiles: The median splits the ordered list into a lower and an upper half (with an odd count the median itself belongs to neither half). The lower quartile Q1Q_1 is the median of the lower half, the upper quartile Q3Q_3 the median of the upper half. Example: for 1,2,…,91, 2, \ldots, 9 the median is 55 and the lower half is 1,2,3,41, 2, 3, 4. So Q1=2+32=2.5Q_1 = \frac{2 + 3}{2} = 2.5 and Q3=7+82=7.5Q_3 = \frac{7 + 8}{2} = 7.5. Some textbooks and programs define the quartiles slightly differently – for small data sets the values may then differ a little.

Spread: The range is maximum−minimum\text{maximum} - \text{minimum}, the interquartile range is Q3−Q1Q_3 - Q_1.

The box plot shows the five values minimum, Q1Q_1, median, Q3Q_3 and maximum at a glance: the box goes from Q1Q_1 to Q3Q_3, the line inside the box is the median, and the whiskers reach to the minimum and maximum. Box and whiskers split the data roughly into four quarters – the box holds about the middle half of the values.

Outliers: Values that lie more than 1.51.5 times the interquartile range outside the box are often marked as outliers. The whiskers then stop at the last value inside. A single outlier can shift the mean a lot – but hardly the median: for 1,2,3,4,1001, 2, 3, 4, 100 the mean is xˉ=1105=22\bar{x} = \frac{110}{5} = 22, but the median is 33.

Try it

  1. Drag the point with the largest value far to the right. What happens to the mean, what to the median? Load example
  2. Press Step by step and watch the box plot grow out of the ordered list.
  3. One child gets €90 of pocket money. Why is the mean above almost all other values? Turn outlier marking on and off. Pocket money
  4. There are 1212 long-jump values. Where is the median in the ordered list? Tap the number line to add a 13th value – what changes? Long jump
  5. Compare classes 7a and 7b: median and mean are the same. How can you still see a big difference? Comparison
  6. For the way to school, the right whisker is much longer than the left one. What does that tell you about the data? Way to school
  7. Can you make median and mean exactly equal? And can you make the mean larger than Q3Q_3? Own data

Tasks

Task 1: Statistics of the test

Order the points of class 7a and find minimum, Q1Q_1, median, Q3Q_3, maximum and mean. Load task

Show solution

Ordered: 9,12,14,16,17,18,19,20,21,22,23,24,25,27,289, 12, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28. Median: 88th value =20= 20. Lower half 9…199 \ldots 19 (7 values), Q1=16Q_1 = 16; upper half 21…2821 \ldots 28, Q3=24Q_3 = 24. Minimum 99, maximum 2828. Mean 29515≈19.67\frac{295}{15} \approx 19.67. Show in simulation

Task 2: Even count

Find the median and the quartiles of the 1212 jump distances in autumn. Load task

Show solution

Ordered: 2.9,3.1,3.2,3.4,3.5,3.6,3.7,3.8,3.9,4.0,4.1,4.42.9, 3.1, 3.2, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.4. Median =3.6+3.72=3.65 m= \frac{3.6 + 3.7}{2} = 3.65\,\text{m}. Lower half: 6 values, Q1=3.2+3.42=3.3 mQ_1 = \frac{3.2 + 3.4}{2} = 3.3\,\text{m}. Upper half: Q3=3.9+4.02=3.95 mQ_3 = \frac{3.9 + 4.0}{2} = 3.95\,\text{m}. Show in simulation

Task 3: The outlier

Work out mean and median of the pocket money – once with and once without the €90. Which statistic describes the “typical” pocket money better? Load task

Show solution

With: xˉ=35511≈€32.27\bar{x} = \frac{355}{11} \approx €32.27, median €25. Without: xˉ=26510=€26.50\bar{x} = \frac{265}{10} = €26.50, median 25+252=€25\frac{25 + 25}{2} = €25. The median does not change at all, the mean changes by almost €6. Here the median describes the “typical” pocket money better. Outlier limit: Q3+1.5⋅(Q3−Q1)=35+1.5⋅15=57.5Q_3 + 1.5 \cdot (Q_3 - Q_1) = 35 + 1.5 \cdot 15 = 57.5 – the €90 lie above it. Show in simulation

Task 4: Reading a box plot

In the way-to-school box plot, Q1=11Q_1 = 11, median =15= 15, Q3=22.5Q_3 = 22.5 and maximum =45= 45 minutes. Which statements are true? (a) About half need at most 1515 minutes. (b) About a quarter need more than 22.522.5 minutes. (c) There are more children between 22.522.5 and 4545 minutes than between 1111 and 1515. Load task

Show solution

(a) and (b) are true. (c) is false: each of the two sections holds about a quarter of the values. The long whisker only shows that the values are further apart there, not that there are more of them. Show in simulation

Task 5: Comparing two classes

In the test, both classes have median 2020 and mean 19.6719.67. Compare the interquartile ranges. In which class would extra lessons for the weaker students be more urgent? Load task

Show solution

7a: Q3−Q1=24−16=8Q_3 - Q_1 = 24 - 16 = 8; 7b: 27−13=1427 - 13 = 14. In 7b the results are spread much more widely: a quarter of the class has at most 1313 points (in 7a: at most 1616). Extra lessons would probably be more urgent there. Show in simulation

Task 6: Make up data

Make up five values with median 1010 and mean 2020. Check your answer by typing the values into “Own data”. Load task

Show solution

The middle value must be 1010, the sum 5⋅20=1005 \cdot 20 = 100. For example 5,8,10,12,655, 8, 10, 12, 65 – the large value pulls the mean up. Show in simulation

Ideas for the classroom

  • Use: About grade 7, statistics of data: comparing mean and median, range and quartiles, drawing and interpreting box plots. Dragging a single point may be a good way in; “Step by step” can accompany the construction on the board.
  • Own data: The class could collect its own data (way to school, hours of sleep, long jump) and type it into the “Values” field. Comparison mode shows two surveys side by side.
  • Quartiles: The simulation takes the quartiles as medians of the two halves (with an odd count the median is left out). Another common convention takes as Q1Q_1 the smallest value up to which at least a quarter of the values reach (for 1,…,91, \ldots, 9 that is 33 instead of 2.52.5). If your textbook uses another convention, a short note can avoid confusion.
  • Outliers with few values: For 1,2,3,4,1001, 2, 3, 4, 100 the box is very wide (Q1=1.5Q_1 = 1.5, Q3=52Q_3 = 52). So the 1.51.5 rule does not mark the 100100 as an outlier – but it still shifts the mean a lot. Try it
  • Common stumbling blocks:
    • The median is read from the unordered raw data.
    • With an even count only one of the two middle values is taken.
    • A long whisker or a wide box is read as “more values” – correct is: the same number of values, just more spread out.
    • Mean and median are treated as the same; with skewed data or outliers they differ clearly.
    • The box is taken as the range of “all normal values”; but it only holds about the middle half.