Descriptive Statistics › Measures of Spread

Michael BrenndoerferUpdated December 25, 20254 min read
Machine Learning from ScratchAll chapters
Part 1 of 9Statistics 101
Chapter 2Descriptive Statistics › Measures of Spread
Reading section 4 of 11 · Measures of Spread · 4 minSection 4 of 11 · 4 min

Book contents

Section 4 of 11 · 4 min read

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 n−1n-1:

s2=1n−1∑i=1n(xi−xˉ)2s^2 = \frac{1}{n-1} \sum_{i=1}^n (x_i - \bar{x})^2

Where:

  • s2s^2: Sample variance
  • xix_i: Individual observation
  • xˉ\bar{x}: Sample mean
  • nn: Number of observations

For n≥2n \geq 2, division by n−1n-1 is commonly called Bessel's correction. Under an independent, identically distributed sampling model with finite variance, it makes s2s^2 an unbiased estimator of the population variance; it does not make ss 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:

s=s2=1n−1∑i=1n(xi−xˉ)2s = \sqrt{s^2} = \sqrt{\frac{1}{n-1} \sum_{i=1}^n (x_i - \bar{x})^2}

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.

Population vs. Sample Standard Deviation: σ vs. s

You may notice that standard deviation is sometimes denoted as σ\sigma (sigma) and sometimes as ss. This distinction reflects whether we are working with a population or a sample:

  • Population standard deviation (σ\sigma): A parameter of the population distribution. If every member of a finite population is observed, it can be calculated directly with the NN denominator; otherwise it may be estimated from a sample.
  • Sample standard deviation (ss): A descriptive statistic calculated from sample observations. The familiar n−1n-1 form is the square root of the unbiased sample-variance estimator, but ss itself is generally biased for σ\sigma.

Choose the denominator according to the estimand. Use the NN denominator to describe the variability of the observations in hand as a complete finite population, and use the n−1n-1 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:

Range=xmax−xmin\text{Range} = x_{\text{max}} - x_{\text{min}}

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:

IQR=Q3−Q1\text{IQR} = Q_3 - Q_1

Where:

  • Q1Q_1: First quartile (25th percentile)
  • Q3Q_3: 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 Q1−1.5×IQRQ_1 - 1.5 \times \text{IQR} or above Q3+1.5×IQRQ_3 + 1.5 \times \text{IQR} 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.