Range and interquartile range
The range is the simplest measure of dispersion: $\text{range} = \text{largest} - \text{smallest}$. It uses only the two extreme values, so a single outlier can distort it.
The quartiles divide ordered data into four equal parts: the first quartile $Q_1$, the median $Q_2$, and the third quartile $Q_3$. For $n$ ordered values, $Q_1$ is at position $\frac{1}{4}(n+1)$ and $Q_3$ at position $\frac{3}{4}(n+1)$. The interquartile range is the spread of the middle half:
Key formula
$\text{IQR} = Q_3 - Q_1$
Variance and standard deviation
These use every value, measuring how far each is from the mean $\bar{x}$. For $N$ values:
Key formula
$\sigma^2 = \frac{\sum (x-\bar{x})^2}{N} = \frac{\sum x^2}{N} - \bar{x}^2, \qquad \sigma = \sqrt{\sigma^2}$
The standard deviation $\sigma$ is the square root of the variance, giving a spread in the same units as the data.
Example
For $2, 4, 6, 8, 10$: mean $\bar{x}=6$. The squared deviations are $16, 4, 0, 4, 16$, summing to $40$. So $\sigma^2 = \frac{40}{5} = 8$ and $\sigma = \sqrt{8} = 2\sqrt{2}\approx 2.83$.
Effect of changing the data
- Adding the same constant $k$ to every value: range, IQR and standard deviation are unchanged.
- Multiplying every value by $k$: range, IQR and standard deviation are all multiplied by $k$ (variance by $k^2$).
Remember
Standard deviation is always $\geq 0$. It equals $0$ only when every value is identical.