Center and Spread

Study Sheet

Center and Spread

Mean, median, variance and standard deviation

Measures of Center

Concept
Mean and median

The mean xˉ=∑xin\bar x = \dfrac{\sum x_i}{n} is the fair-share average. The median is the middle value of the sorted list (the average of the two middle values when nn is even). The mode is the most frequent value.

The mean is what each value would be if the total were shared out equally; the median is the value with half the data on each side. Use the mean when the distribution is roughly symmetric and you want every value to count; use the median when the data is skewed or has outliers and you want a typical value. Newspapers report median house prices for exactly this reason: one mansion should not change what "typical" means.

Example
Compute both
051015202530354045median 15.5mean 18
The lone 42 drags the mean to the right of the median.

Data: 4,8,15,16,23,424, 8, 15, 16, 23, 42. Mean: the total 108108 shared among 66 values is 108/6=18108/6 = 18. Median: n=6n = 6 is even, so average the 33rd and 44th sorted values, (15+16)/2=15.5(15 + 16)/2 = 15.5. The mean is larger because the single value 4242 pulls the balance point toward it; the median only knows that 4242 is on the upper side.

Example
Mean from a frequency table

A team's goals per game over 1515 games: 00 goals 33 times, 11 goal 55 times, 22 goals 44 times, 33 goals twice, 44 goals once. Total goals =0⋅3+1⋅5+2⋅4+3⋅2+4⋅1=23= 0\cdot3 + 1\cdot5 + 2\cdot4 + 3\cdot2 + 4\cdot1 = 23, so the mean is 23/15≈1.5323/15 \approx 1.53. The median is the 88th value: the first 33 values are 00 and the next 55 (positions 44 to 88) are 11, so the median is 11.

Example
The missing value

Five test scores have mean 8484; four of them are 80,90,78,8580, 90, 78, 85. The mean fixes the total: 5⋅84=4205\cdot84 = 420. The four known scores add to 333333, so the fifth is 420−333=87420 - 333 = 87. Working with totals rather than averages is the key move in every "missing value" or "new average" problem.

Side note
Where it goes wrong

Taking the middle of the list as written instead of the sorted list. For 9,2,7,4,59, 2, 7, 4, 5 the middle entry is 77, but sorted the data are 2,4,5,7,92, 4, 5, 7, 9 and the median is 55.

Try it
Try it: which summary?

Nine employees earn (in thousands) 38,40,41,42,45,47,50,52,30038, 40, 41, 42, 45, 47, 50, 52, 300. Find the mean and median, and say which describes a typical salary.

Show the answer

Total 655655, mean 655/9≈72.8655/9 \approx 72.8; median (the 55th of 99 sorted values) =45= 45. The median — eight of the nine earn less than the mean, which is inflated by the one 300300.

Measures of Spread

Concept
Range, IQR, standard deviation

The range is max minus min. The interquartile range IQR=Q3−Q1\text{IQR} = Q_3 - Q_1 is the spread of the middle half. The standard deviation s=∑(xi−xˉ)2n−1s = \sqrt{\dfrac{\sum(x_i - \bar x)^2}{n - 1}} is the typical distance of a value from the mean.

Standard deviation is built from squared deviations, so it is in the same units as the data once the square root is taken, and it weights far-away values heavily. That makes it the natural partner of the mean: both are sensitive to outliers. The IQR is the partner of the median: both depend only on positions in the sorted list.

Example
Compute ss
12345678910mean 5−3−1−1−100+2+4
Each bar is one deviation from the mean 5; the standard deviation summarizes their squared lengths.

Data: 2,4,4,4,5,5,7,92, 4, 4, 4, 5, 5, 7, 9; mean 40/8=540/8 = 5. Deviations from the mean: −3,−1,−1,−1,0,0,2,4-3, -1, -1, -1, 0, 0, 2, 4 (they sum to 00, as they must). Squared: 9,1,1,1,0,0,4,169, 1, 1, 1, 0, 0, 4, 16, sum 3232. Sample variance 32/7≈4.5732/7 \approx 4.57, s≈2.14s \approx 2.14. (The population version divides by 88: σ=2\sigma = 2.)

Example
Same center, different spread

Set A: 48,49,50,51,5248, 49, 50, 51, 52. Set B: 30,40,50,60,7030, 40, 50, 60, 70. Both have mean and median 5050. Squared deviations sum to 4+1+0+1+4=104 + 1 + 0 + 1 + 4 = 10 for A and 400+100+0+100+400=1000400 + 100 + 0 + 100 + 400 = 1000 for B, so sA=10/4≈1.58s_A = \sqrt{10/4} \approx 1.58 and sB=1000/4≈15.81s_B = \sqrt{1000/4} \approx 15.81. B is ten times as spread out, and centre alone would never reveal it.

Example
Adding a value at the mean

Add a ninth value, 55, to the data 2,4,4,4,5,5,7,92, 4, 4, 4, 5, 5, 7, 9. The mean stays 55 and the sum of squared deviations stays 3232, but the divisor grows from 77 to 88: s=32/8=2s = \sqrt{32/8} = 2, down from 2.142.14. A value right at the centre makes the data look more concentrated.

Side note
Where it goes wrong

Forgetting to square the deviations (they would sum to zero), or dividing by nn when the data is a sample — the n−1n - 1 corrects for the fact that the sample mean sits closer to the sample than the true mean does.

Try it
Try it: a small standard deviation

Find the sample standard deviation of 3,5,73, 5, 7.

Show the answer

Mean 55; deviations −2,0,2-2, 0, 2; squared 4,0,44, 0, 4, sum 88. Divide by n−1=2n - 1 = 2: variance 44, so s=2s = \mathbf{2}.

Shifting and Scaling

Concept
Linear changes of units

Adding cc to every value shifts the mean and median by cc and leaves every measure of spread unchanged. Multiplying every value by kk multiplies the mean and median by kk and the standard deviation, IQR and range by ∣k∣|k|. So for y=kx+cy = kx + c: yˉ=kxˉ+c\bar y = k\bar x + c and sy=∣k∣sxs_y = |k|s_x.

Shifting slides the whole data set along the number line: the distances between values — which is all that spread measures — do not change. Scaling stretches those distances by the factor ∣k∣|k|, and the mean, being a sum divided by nn, follows along. The only way to change the shape of a distribution is a nonlinear transformation such as a logarithm; linear changes of units change only the labels on the axis.

Example
A bonus

Test scores have mean 7272 and standard deviation 88. The teacher adds 55 points to every score. New mean 72+5=7772 + 5 = 77; new standard deviation still 88, because every score moved by the same amount and no two scores got any closer or farther apart.

Example
Celsius to Fahrenheit

Temperatures in Celsius have mean 2020 and standard deviation 55. With F=1.8C+32F = 1.8C + 32: mean 1.8⋅20+32=681.8\cdot20 + 32 = 68; standard deviation 1.8⋅5=91.8\cdot5 = 9. The multiplier stretches the spread; the +32+32 shifts everything and so does not spread anything.

Example
Standardizing

For the data 2,4,4,4,5,5,7,92, 4, 4, 4, 5, 5, 7, 9 (mean 55, population SD 22), subtract the mean and divide by the SD: z=(x−5)/2z = (x - 5)/2 gives −1.5,−0.5,−0.5,−0.5,0,0,1,2-1.5, -0.5, -0.5, -0.5, 0, 0, 1, 2. By the rules, the new mean is (5−5)/2=0(5 - 5)/2 = 0 and the new SD is 2/2=12/2 = 1. Every data set standardizes to mean 00 and SD 11, which is why z-scores compare values from different scales.

Side note
Where it goes wrong

Letting the added constant into the spread: "SD in Fahrenheit =1.8⋅5+32=41= 1.8\cdot5 + 32 = 41". A standard deviation of 4141 °F would mean temperatures scattered over a huge range; the shift of 3232 moves every value equally and adds nothing to the spread.

Try it
Try it: a raise

Salaries have mean $50,000\$50{,}000 and standard deviation $8,000\$8{,}000. Everyone gets a 10%10\% raise plus a $2,000\$2{,}000 bonus. Find the new mean and standard deviation.

Show the answer

New salary =1.1x+2000= 1.1x + 2000. Mean 1.1⋅50000+2000=$57,0001.1\cdot50000 + 2000 = \mathbf{\$57{,}000}; standard deviation 1.1⋅8000=$8,8001.1\cdot8000 = \mathbf{\$8{,}800} (the bonus shifts but does not spread).

Why It Works

The deviations from the sample mean are not free: they must sum to zero, so only n−1n - 1 of them carry information — once n−1n - 1 are known, the last is forced. Dividing by n−1n - 1 instead of nn makes the sample variance an unbiased estimate of the population variance: averaged over all possible samples, it hits the true value exactly. Dividing by nn would systematically underestimate, because the sample mean is always at least as close to the sample points as the true mean is.