STAT5002 Chap.2 Numerical Summaries of Centre and Spread
Numerical Summaries of Centre and Spread
Graphs show the shape of a variable; numerical summaries compress it into a few numbers that are easy to report and compare. Two families of summary are built here and used throughout the unit: a measure of centre and a matching measure of spread. To get the sample mean, add every value and divide by the number of values.
Each value sits a deviation away from the mean, and because those deviations always sum to zero, the data balance exactly at the mean. For the sample median, order the data and take the middle, with one rule for odd and another for even sample sizes.
A single extreme value can drag the mean a long way while barely moving the median, which is why the median is called robust, and the gap between them signals shape: a mean above the median suggests a right tail, below it a left tail. Spread starts from the deviations. Their plain average is useless because it is always zero, so the standard deviation takes the root mean square: square the gaps, average them, take the root.
Dividing by n gives the population SD, while the sample SD divides by n minus 1 and is what sd() in R returns; the two are linked by the factor square root of (n minus 1)/n. Its square is the variance. Standard units, or z scores, express a value as a number of SDs above or below the mean.
The ordered side brings quartiles, the interquartile range Q3 minus Q1, and the thresholds 1.5 IQR beyond the quartiles that flag outliers on a boxplot. Summaries are reported in pairs, mean with SD or median with IQR, and the chapter finishes by packaging repeated calculations into your own R function.
What this chapter covers
- 01
What a numerical summary keeps and what it throws away
- 02
Sample mean, deviations and the balancing point
- 03
Sample median for odd and even sample sizes
- 04
Robustness: how one extreme value moves the mean and the median
- 05
Reading skewness from the mean and median
- 06
Why the average deviation is always zero
- 07
Spread as the root mean square of the gaps
- 08
Population SD versus sample SD, and the square root of (n minus 1)/n
- 09
Variance as the squared SD
- 10
Standard units for comparing values across data sets
- 11
Boxplot thresholds 1.5 IQR beyond the quartiles
- 12
Reporting in pairs and writing a summary function in R
Worked example · free
Summarising eight ride share fares
- +1Mean = 120/8 = 15 dollars.
- +1With n = 8 (even) the median averages the 4th and 5th ordered values: (12 + 14)/2 = 13 dollars.
- +1Squared deviations from 15 sum to 300, so the sample SD is the square root of 300/7, which is 6.547 dollars.
- +1Standard units of the top fare: (30 minus 15)/6.547 = 2.29, so it lies about 2.3 SDs above the mean.
- +1IQR = 15.5 minus 11.75 = 3.75; the upper threshold is 15.5 + 1.5 times 3.75 = 21.125, and 30 exceeds it, so the top fare is an outlier.
- +1The mean (15) sits above the median (13), a sign of right skew driven by the outlier, so report the robust pair (median, IQR) = (13, 3.75).
Key terms
- Sample mean
- The sample mean is the sum of the observations divided by their number, and it is the point at which the data balance.
- Sample median
- The middle value of the ordered data, or the average of the two middle values when n is even.
- Robust statistic
- A robust statistic is a summary that changes little when extreme or erroneous values are added, as the median and IQR do.
- Standard deviation
- The standard deviation is the root mean square of the deviations from the mean, dividing by n for a population and by n minus 1 for a sample.
- Variance
- The variance is the square of the standard deviation, with population and sample versions to match.
- Standard units
- Standard units are the number of standard deviations a value lies above or below the mean, found as (value minus mean)/SD.
- Interquartile range
- The interquartile range is the spread of the middle half of the ordered data, Q3 minus Q1, and it is the length of a boxplot's box.
Numerical Summaries of Centre and Spread FAQ
Why does R's sd() give a different answer from my calculator?
R's sd() divides the sum of squared deviations by n minus 1, the sample version. A calculator set to the population version divides by n. Multiply the R value by the square root of (n minus 1)/n to convert.
When should I use the median instead of the mean?
Prefer the median when the data are skewed or contain outliers, because a few extreme values pull the mean towards the tail while the median stays near the bulk. For roughly symmetric data the mean is fine and both are often reported.
How do I find outliers using the IQR?
Compute Q1, Q3 and IQR = Q3 minus Q1, then the lower threshold Q1 minus 1.5 IQR and upper threshold Q3 plus 1.5 IQR. Any value outside those limits counts as an outlier on the boxplot.
What does a z score of minus 1.5 mean?
The value sits one and a half standard deviations below the mean of its data set. Because z scores remove units and scale, they let you compare positions across different data sets.
Why is the average deviation from the mean always zero?
Deviations above the mean exactly cancel those below it, since the mean is the balancing point. Squaring before averaging removes the cancellation, which is how the standard deviation is built.
Exam move
Pick a list of six to ten numbers of your own and run the full routine by hand: mean, ordered list and median, deviations that you check sum to zero, squared deviations, then both SDs. Confirm in R with mean(), median() and sd(), and convert sd() to the population SD with the square root of (n minus 1)/n. Next, add one extreme value and recompute the mean and median to feel robustness.
For the ordered side, read summary() output, compute IQR and both thresholds, and decide which points are outliers, remembering that a threshold beyond the data is clamped to the minimum or maximum. Practise standard units by comparing two scores from different groups. Finally, write a short R function that returns your mean and SD together, so the one-object return rule sticks.
Working through Numerical Summaries of Centre and Spread in STAT5002? Sia is AskSia’s AI Statistics tutor — ask any STAT5002 Numerical Summaries of Centre and Spread question and get a clear, step-by-step explanation grounded in how STAT5002 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.
STAT5003 Computational Statistical Methods · DATA2002 Data Analytics: Learning from Data · QBUS5001 Foundation in Data Analytics for Business