Descriptive Statistics › Measures of Spread
Machine Learning from ScratchAll chapters Descriptive Statistics › Measures of SpreadOne section · Sections in this chapter4 / 11 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
While central tendency measures locate the center of a distribution, measures of spread quantify how much data points vary around that center. Two datasets can have identical means but very different spreads, so center and scale should be examined together [5].
Variance and Standard Deviation
Population variance is the mean squared deviation from the population mean. For a random sample, the following corrected sample variance divides the sum of squared deviations by :
Where:
- : Sample variance
- : Individual observation
- : Sample mean
- : Number of observations
For , division by is commonly called Bessel's correction. Under an independent, identically distributed sampling model with finite variance, it makes an unbiased estimator of the population variance; it does not make an unbiased estimator of the population standard deviation [6]. For independent variables with finite variances, the variance of their sum equals the sum of their variances. Because variance has squared units, such as dollars squared, direct interpretation can be awkward.
Standard deviation addresses this interpretation issue by taking the square root of variance, returning to the original units:
Standard deviation expresses dispersion in the data's original units. Its distance interpretation is clearest for distributions that are roughly symmetric and not heavy-tailed. For a normal distribution, about 68% of probability lies within one population standard deviation of the mean, 95% within two, and 99.7% within three [7]. These percentages are approximations for data whose distribution is only approximately normal, not a distribution-free outlier rule.
You may notice that standard deviation is sometimes denoted as (sigma) and sometimes as . This distinction reflects whether we are working with a population or a sample:
- Population standard deviation (): A parameter of the population distribution. If every member of a finite population is observed, it can be calculated directly with the denominator; otherwise it may be estimated from a sample.
- Sample standard deviation (): A descriptive statistic calculated from sample observations. The familiar form is the square root of the unbiased sample-variance estimator, but itself is generally biased for .
Choose the denominator according to the estimand. Use the denominator to describe the variability of the observations in hand as a complete finite population, and use the variance estimator when estimating a common population variance from a random sample with unknown mean. State the convention when software defaults or the analytical goal could make it ambiguous [5], [6].
Range and Interquartile Range
The range is the simplest measure of spread, calculated as the difference between the maximum and minimum values:
While easy to compute and interpret, the range uses only two data points and is extremely sensitive to outliers. A single erroneous or extreme value can inflate the range dramatically, making it an unreliable measure of typical spread.
The interquartile range (IQR) is less sensitive to extreme values because it measures the spread of the middle 50% of the data:
Where:
- : First quartile (25th percentile)
- : Third quartile (75th percentile)
Because the IQR focuses on the central half of the ordered values, changing an already extreme tail value usually leaves it unchanged. The conventional inner-fence rule flags values below or above as potential outliers. A flag is a prompt for investigation, not a reason to delete an observation automatically [8].
For example, consider a dataset of daily website visits over a week: 120, 135, 142, 128, 155, 130, 138. We can calculate several descriptive measures of center and spread:
- Mean: (120 + 135 + 142 + 128 + 155 + 130 + 138) / 7 = 135.43
- Median (middle sorted value): 135
- Mode: No unique mode (all values occur once)
- Range: 155 - 120 = 35
- IQR: Q3 - Q1 = 142 - 128 = 14 (exclusive median-of-halves convention, omitting the overall median)
- Standard Deviation: 11.22
The mean and median are close, although that alone does not establish symmetry. The range is 35, the IQR is 14 under the exclusive median-of-halves convention, and the sample standard deviation is 11.22. Whether that spread is large or small depends on the scale and application.