Measures of Dispersion
Dispersion (variability/spread) measures how far the data values are scattered from the centre. Two datasets can share an identical mean yet be completely different:
Set A: 48, 49, 50, 51, 52 mean = 50, very tight
Set B: 10, 30, 50, 70, 90 mean = 50, hugely spread
Reporting only the mean would hide the entire difference — which is why every summary must pair a measure of centre with a measure of spread.
1. Range
Range = Maximum value − Minimum value
Coefficient of Range = (Max − Min) / (Max + Min)
Simplest measure, but uses only two values and is completely determined by the extremes.
Example. Marks 45, 52, 68, 74, 81 → Range = 81 − 45 = 36
2. Quartile Deviation (Semi-Interquartile Range)
Q1 = lower quartile (25th percentile)
Q3 = upper quartile (75th percentile)
IQR = Q3 − Q1
Quartile Deviation (QD) = (Q3 − Q1) / 2
Coefficient of QD = (Q3 − Q1) / (Q3 + Q1)
The IQR covers the middle 50% of the data and completely ignores extreme values — making it the natural companion to the median, and the basis of the box plot and outlier fences.
3. Mean Deviation (Average Deviation)
Σ|x − x̄|
MD (mean) = ──────────
n
Σ|x − Median|
MD (median) = ─────────────── (this version is the minimum possible MD)
n
Worked example. Data: 2, 4, 6, 8, 10 → x̄ = 6
|2-6| + |4-6| + |6-6| + |8-6| + |10-6| = 4 + 2 + 0 + 2 + 4 = 12
MD = 12 / 5 = 2.4
4. Variance and Standard Deviation
The most important measures in all of statistics.
POPULATION SAMPLE
Σ(x − μ)² Σ(x − x̄)²
σ² = ─────────── s² = ───────────
N n − 1
σ = √σ² s = √s²
Divisor n−1 (Bessel's correction) makes the sample variance an
UNBIASED estimator of the population variance.
Shortcut / computational formula:
Σx² ( Σx )²
σ² = ───── − ───────
N N
Worked example. Data: 2, 4, 6, 8, 10 (treat as population)
| x | x − μ | (x − μ)² |
|---|---|---|
| 2 | −4 | 16 |
| 4 | −2 | 4 |
| 6 | 0 | 0 |
| 8 | 2 | 4 |
| 10 | 4 | 16 |
| Σx = 30 | Σ = 0 | Σ = 40 |
μ = 30 / 5 = 6
σ² = 40 / 5 = 8
σ = √8 = 2.828
As a SAMPLE instead:
s² = 40 / (5 − 1) = 10
s = √10 = 3.162
Verify with the shortcut formula:
Σx² = 4 + 16 + 36 + 64 + 100 = 220
σ² = 220/5 − (30/5)² = 44 − 36 = 8 ✓
Properties of standard deviation:
- σ ≥ 0 always; σ = 0 only when every value is identical
- Same unit as the original data (variance is in squared units — its main drawback)
- Adding a constant to every value leaves σ unchanged
- Multiplying every value by a constant c multiplies σ by |c|
- It is the measure minimised by the mean, and it underpins the normal distribution, z-scores, correlation and regression
5. Coefficient of Variation (CV)
σ
CV = ─── × 100 %
x̄
CV is unit-free, so it is the correct tool for comparing variability between datasets with different units or very different means.
Worked example. Which is more consistent?
| Mean | SD | CV | |
|---|---|---|---|
| Batsman A | 50 runs | 10 runs | (10/50)×100 = 20% |
| Batsman B | 30 runs | 9 runs | (9/30)×100 = 30% |
Batsman B has the smaller standard deviation but the larger CV — relative to his own average he is less consistent. Lower CV = more consistent/stable.
The Empirical Rule (68–95–99.7)
For an approximately normal distribution:
This is exactly why |z| > 3 is the standard outlier threshold — such values occur in under 0.3% of normal data.
Skewness and Kurtosis — Shape Measures
| Measure | What it describes | Interpretation |
|---|---|---|
| Skewness | Asymmetry of the distribution | 0 = symmetric; > 0 = right/positive tail; < 0 = left/negative tail |
| Kurtosis | "Tailedness" / peakedness | 3 (excess 0) = normal (mesokurtic); > 3 = heavy tails (leptokurtic); < 3 = light tails (platykurtic) |
Karl Pearson's coefficient of skewness:
Mean − Mode 3(Mean − Median)
Sk = ───────────── or Sk = ─────────────────
σ σ
Full Python Walkthrough
import pandas as pd
import numpy as np
data = pd.Series([2, 4, 6, 8, 10])
print("Range: ", data.max() - data.min()) # 8
print("Variance (sample):", data.var()) # 10.0 (ddof=1 default)
print("Variance (pop): ", data.var(ddof=0)) # 8.0
print("Std dev (sample): ", round(data.std(), 3)) # 3.162
print("Std dev (pop): ", round(data.std(ddof=0), 3)) # 2.828
Q1, Q3 = data.quantile(0.25), data.quantile(0.75)
print("Q1:", Q1, "Q3:", Q3, "IQR:", Q3 - Q1) # Q1: 4.0 Q3: 8.0 IQR: 4.0
print("Quartile Deviation:", (Q3 - Q1) / 2) # 2.0
print("Mean Absolute Deviation:", (data - data.mean()).abs().mean()) # 2.4
print("CV:", round(data.std() / data.mean() * 100, 2), "%") # 52.7 %
print("Skewness:", round(data.skew(), 3)) # 0.0 (perfectly symmetric)
print("Kurtosis (excess):", round(data.kurtosis(), 3)) # -1.2
# Same mean, very different spread — the whole point of dispersion
A = pd.Series([48, 49, 50, 51, 52])
B = pd.Series([10, 30, 50, 70, 90])
summary = pd.DataFrame({
"Set A": [A.mean(), A.std(), A.max() - A.min(), A.std() / A.mean() * 100],
"Set B": [B.mean(), B.std(), B.max() - B.min(), B.std() / B.mean() * 100],
}, index=["Mean", "Std Dev", "Range", "CV %"]).round(2)
print(summary)
# Set A Set B
# Mean 50.00 50.00 <- identical
# Std Dev 1.58 31.62 <- 20x difference
# Range 4.00 80.00
# CV % 3.16 63.25
# describe() gives centre + spread + quartiles in one call
df = pd.DataFrame({"marks": [45, 52, 68, 74, 81, 68, 90, 33]})
print(df.describe().round(2))
# marks
# count 8.00
# mean 63.88
# std 18.83
# min 33.00
# 25% 50.25
# 50% 68.00
# 75% 75.75
# max 90.00
Absolute vs Relative Dispersion
| Basis | Absolute measure | Relative measure |
|---|---|---|
| Unit | Same as the data | Unit-free (ratio or %) |
| Comparison across datasets | Only if units and scale match | Always valid |
| Examples | Range, QD, MD, SD, variance | Coefficient of range, coefficient of QD, CV |
Centre plus spread describes one variable. The next lesson moves to two variables at once — correlation.