Topic contents

Lesson 3

Central tendency and measures of position

From average levels and ordered positions to boxplots: the same data set can have different representative values.

Why can three representative values differ?

Consider a set of student scores. Adjust the rightmost student's score and see whether the mean, median, and mode all change.

Scores of 10 students: 60, 65, 70, 70, 75, 80, 85, 90, 90, 95

Arithmetic mean
78.0
Median
77.5
Mode
70, 90
How do we calculate the median of ungrouped data?

Step 1: sort the n observations in ascending order as x₍₁₎ ≤ ⋯ ≤ x₍ₙ₎. Step 2: check whether the sample size n is odd or even.

First sort the data in ascending order; denote the i-th value by x(i).
Odd n:
Me=x(n+12)Me={x}_{(\frac{n+1}{2})}
Even n:
Me=x(n2)+x(n2+1)2Me=\frac{{x}_{(\frac{n}{2})}+{x}_{(\frac{n}{2}+1)}}{2}

Here n=10 (even); the 5th and 6th sorted values are 75 and 80.

Me=75+802=77.5Me=\frac{75+80}{2}=77.5

If n=9 (odd), take the 5th sorted value directly.

Sorting determines the middle position. You cannot simply take the middle item of unsorted data.
Think about it: when one score becomes extremely large, why does the mean change substantially while the median changes less? Why might the mode remain unchanged?
60708090Score (points)Arithmetic mean 78.0Median 77.560657070758085909095
Mean, median, and mode
The mean uses every numerical value; the median depends on the middle position after sorting; the mode is the most frequent value. A data set can have no mode or more than one mode.

Arithmetic mean: unweighted and weighted means

Unweighted arithmetic mean: every observation has equal weight.

xˉ=∑xin\bar{x}=\frac{\sum {x}_{i}}{n}

Weighted arithmetic mean: different data values have different frequencies.

xˉ=∑fixi∑fi\bar{x}=\frac{\sum {f}_{i}{x}_{i}}{\sum {f}_{i}}
Think about it: what would adding the three group means and dividing by 3 ignore?
Score or class midpoint xᵢFrequency fᵢfᵢxᵢ
606360
7510750
904360
Total201470
General formula → numerical substitution → result:
xˉ=60×6+75×10+90×46+10+4=147020=73.50\bar{x}=\frac{60\times6+75\times10+90\times4}{6+10+4}=\frac{1470}{20}=73.50

73.50

The unweighted mean of the three groups is 75; with unequal frequencies, the weighted mean generally differs from 75.

051060 · Frequency (students): 66075 · Frequency (students): 107590 · Frequency (students): 490
Arithmetic mean
For data grouped into class intervals, the class midpoint (the midpoint of the two class limits) often represents the values in that class, so the resulting mean is an approximation.

Geometric mean: why can't we simply average growth rates arithmetically?

Suppose a measure rises and falls over two successive periods. Change the growth rates and observe the total change after two periods and the compound average growth rate.

Arithmetic mean growth rate
15.00%
Geometric mean growth rate
9.54%
Final level (initial 100)
120.00
Why can't a 50% increase followed by a 20% decrease simply be described as an average growth rate of 15% over the two periods?
G=(∏t=1nxt)1nG={(\prod _{t=1}^{n}{x}_{t})}^{\frac{1}{n}}
Geometric mean: the n-th root of the product of positive numbers.
gˉ=[∏t=1n(1+gt)]1n−1\bar{g}={[\prod _{t=1}^{n}(1+{g}_{t})]}^{\frac{1}{n}}-1
Numerical substitution:
gˉ=(1+(0.50))(1+(−0.20))−1=9.54%\bar{g}=\sqrt{(1+(0.50))(1+(-0.20))}-1=9.54\%
100×(1+(0.50))×(1+(−0.20))=120.00100\times(1+(0.50))\times(1+(-0.20))=120.00
InitialPeriod 1Period 2050100150Level index0, 1001, 1502, 120
Geometric mean
A geometric-mean growth rate applies to successive compound changes; each period's growth factor 1+g must be greater than 0. It is not a universal average for every measure.

Mode and median: from raw data to data grouped into class intervals

The following frequency table groups scores into classes of width 10 points. Drag each class frequency and observe how the modal and median classes change.

Class interval [lower limit, upper limit)Frequency fLess-than cumulative frequency
50—6044
60—70812
70—801426
80—901036
90—100440
Total40—
Think about it: why are the median and mode calculated from grouped data usually approximations?

① Grouped-data median estimate Me: find the median class, then estimate its position within the class

Examine the cumulative frequencies: the class spanning 70–80 points is the first to reach or exceed N/2=20.0. The cumulative count before it is 12; a further within-class count of 8.0 is needed to reach the median position.

Lower limit of median class + (median's relative position within the class) × class width

General formula:

Me=L+N/2−FpriorfmhMe=L+\frac{N/2-F_{\mathrm{prior}}}{f_m}h

Numerical substitution:

Me=70+20.0−1214×10=75.71Me=70+\frac{20.0-12}{14}\times10=75.71

75.71

Intuitively, move about 57.1% of the class width from its lower limit. This assumes an approximately uniform distribution within the class, so it is an approximation.

② Grouped-data mode estimate Mo: find the highest-frequency class, then estimate using neighboring frequencies

The highest-frequency class is 70–80 points (student count: 14); the preceding class has a count of 8, and the following class a count of 10.

Lower limit of modal class + (preceding frequency difference ÷ sum of both frequency differences) × class width

General formula:

Mo=L+Δ1Δ1+Δ2hMo=L+\frac{\Delta_1}{\Delta_1+\Delta_2}h

Δ₁=14−8=6; Δ₂=14−10=4; L=70; h=10.

Numerical substitution:

Mo=70+66+4×10=76.00Mo=70+\frac{6}{6+4}\times10=76.00

76.00

This interpolation estimate uses equal class widths and changes in neighboring class frequencies; it is not the exact mode found directly from the raw data.
0510155060708090100Score (points)
Grouped median and mode
This page uses equal class widths and interpolation assuming a uniform distribution within each class. The mode formula uses differences between adjacent frequencies. When classes tie for the highest frequency or other conditions fail, it does not force a single interpolated mode.

Quantiles and percentiles: sort first, then locate positions

Quartiles divide sorted data into four parts; the median is the 50th percentile. Here, 12 scores illustrate how positions are determined.

12 sorted scores: 52, 58, 62, 66, 70, 73, 76, 79, 82, 85, 89, 98

Q1 (25th percentile)
64.0
Q2 (median)
74.5
Q3 (75th percentile)
83.5
Locate positions after sorting: n=12. Use the first 6 values for Q1, the middle two for Q2, and the last 6 for Q3.
Q1=62+662=64.0Q_1=\frac{62+66}{2}=64.0
Q2=73+762=74.5Q_2=\frac{73+76}{2}=74.5
Q3=82+852=83.5Q_3=\frac{82+85}{2}=83.5
Must Q1 and the median change when the highest score changes? Why?
6080100Score (points)Q1 64.0Q2 74.5Q3 83.5525862667073767982858998
Quantiles and percentiles
This page uses the median-of-halves method: take the median of the lower half and of the upper half to calculate quartiles (n=12). Software may use different percentile definitions and interpolation rules; small differences do not necessarily indicate calculation errors.
Other percentiles: generally, the p-th percentile indicates a position at or below which approximately p% of observations lie. State the sorting and interpolation rules before giving an exact value.

Boxplot: how does a separate data set change the box and outliers?

This page uses a separate set of 12 scores, independent of the preceding quantile example. First adjust the spread of the middle 11 scores, then adjust the 12th, potentially extreme value.

Current 12 values (sorted): 52.0, 58.0, 62.0, 66.0, 70.0, 73.0, 76.0, 79.0, 82.0, 85.0, 89.0, 98.0

Median Q2
74.5
Interquartile range IQR = Q3 − Q1
19.5
Number of outliers
0

Five-number summary: minimum 52.0, Q1 64.0, median 74.5, Q3 83.5, maximum 98.0.

Outlier fences: lower Q1−1.5×IQR=34.75; upper Q3+1.5×IQR=112.75.
Whisker endpoints: 52.0 and 98.0; no outliers.

Why does adjusting the middle scores widen or narrow the box, while adjusting only the extreme value may leave the box unchanged?
50100150Score (points)Score (points)
Boxplots and position
This page's boxplot: Q1 and Q3 define the left and right edges of the box, with the median drawn inside. Whiskers extend to the most distant actual observations within the 1.5×IQR fences; observations beyond the fences appear separately as outliers. Quartiles use the median-of-halves method.

References and calculation conventions

NIST/SEMATECH e-Handbook: Box Plot

See the “Box plots with fences” section for the interquartile range, 1.5×IQR fences, and why whisker endpoints correspond to actual observations rather than necessarily coinciding with the fences.

This lesson's quantiles and boxplots use the median-of-halves method to calculate quartiles; software does not use one universal percentile algorithm. Other interpolation rules may produce different Q1, Q3, IQR, and outlier classifications. Check the quartile and boxplot conventions before comparing outputs.