7  Measures of Dispersion

Two datasets can share exactly the same mean and still tell very different stories. A class where every student scores close to 65 and a class where scores range from 20 to 100 both average out the same, but they are nowhere near equally consistent. Measures of dispersion quantify that spread, describing how tightly or loosely observations cluster around the center. This chapter covers the range, quartile deviation, mean deviation, variance, standard deviation, and coefficient of variation, for both raw data and the grouped frequency table carried forward from the last two chapters.

7.1 Range

The range is the simplest measure of dispersion: the difference between the maximum and minimum values in a dataset.

\[\text{Range} = \text{Maximum} - \text{Minimum}\]

It is easy to compute and understand, but it uses only two values from the entire dataset and is highly sensitive to a single extreme outlier.

Example

For the seven test marks 58, 62, 58, 74, 65, 58, 70, the range is \(74 - 58 = 16\).

7.2 Quartile Deviation

Quartiles divide an ordered dataset into four equal parts. \(Q_1\) (the first quartile) marks the point below which 25% of the data falls, and \(Q_3\) (the third quartile) marks the point below which 75% falls. The quartile deviation, also called the semi-interquartile range, is half the distance between them.

\[\text{Quartile Deviation} = \frac{Q_3 - Q_1}{2}\]

Because it is based on the middle 50% of the data, quartile deviation is far less affected by extreme outliers than the range.

The full distance \(Q_3 - Q_1\), without dividing by two, is called the Interquartile Range (IQR) and is exactly what a box plot’s box represents, a chart type covered in a later visualization module of this book.

7.3 Mean Deviation

The mean deviation (or mean absolute deviation) is the average of the absolute differences between each observation and the mean, ignoring whether each difference is positive or negative.

\[\text{Mean Deviation} = \frac{\sum |x_i - \bar{x}|}{n}\]

Taking the absolute value matters: without it, positive and negative deviations from the mean always cancel out to exactly zero, which is precisely why variance and standard deviation, covered next, square the deviations instead.

Example

For 58, 62, 58, 74, 65, 58, 70, the mean is 63.57. The mean deviation is:

\[\frac{|58-63.57|+|62-63.57|+|58-63.57|+|74-63.57|+|65-63.57|+|58-63.57|+|70-63.57|}{7} \approx 5.22\]

7.4 Variance and Standard Deviation

Variance measures the average of the squared deviations from the mean. Squaring removes the cancellation problem of the mean deviation and gives larger weight to bigger deviations. The standard deviation is simply the square root of the variance, which brings the measure back into the original units of the data, making it far easier to interpret than variance alone.

  • Population Variance: \(\sigma^2 = \dfrac{\sum (x_i - \mu)^2}{N}\), used when the data represents the entire population of interest.
  • Sample Variance: \(s^2 = \dfrac{\sum (x_i - \bar{x})^2}{n-1}\), used when the data is a sample drawn from a larger population. Dividing by \(n-1\) instead of \(n\) corrects for the tendency of a sample to slightly underestimate the true population variance.
  • Standard Deviation: \(\sigma = \sqrt{\sigma^2}\) for a population, \(s = \sqrt{s^2}\) for a sample.

Mixing up the population (\(N\)) and sample (\(n-1\)) denominators is one of the most common errors in statistics. As a rule of thumb, if your data is every observation you care about, use the population formula; if it is a sample meant to represent a larger group, use the sample formula. R’s var() and sd() functions, and Python’s statistics.variance(), use the sample formula (\(n-1\)) by default.

7.5 Dispersion for Grouped Data

Just as with central tendency, dispersion measures can be computed from a grouped frequency table using class marks in place of individual observations. Continuing with the same 30-student marks distribution from Chapters 4 and 5:

Class Interval Class Mark (\(x\)) Frequency (\(f\)) Cumulative Frequency
30–40 35 2 2
40–50 45 4 6
50–60 55 6 12
60–70 65 6 18
70–80 75 5 23
80–90 85 4 27
90–100 95 3 30

Grouped Variance: \(\sigma^2 = \dfrac{\sum f_i (x_i - \bar{x})^2}{N}\), using the grouped mean \(\bar{x} = 65.67\) computed in Chapter 5.

Grouped Quartiles: found the same way as the grouped median in Chapter 5, but locating the class containing the \(\frac{N}{4}\)-th observation for \(Q_1\) and the \(\frac{3N}{4}\)-th observation for \(Q_3\), then applying the same interpolation formula.

Example

Using the grouped mean of 65.67, the grouped variance works out to approximately 292.89, giving a grouped standard deviation of \(\sqrt{292.89} \approx\) 17.11. Note this is somewhat larger than the ungrouped standard deviation of the same 30 raw marks (about 15.87 for the population figure), because replacing each observation with its class midpoint adds a small amount of extra spread.

For the quartiles, \(\frac{N}{4} = 7.5\) falls in the 50–60 class (cumulative frequency reaches 12 there), giving \(Q_1 = 50 + \frac{7.5-6}{6} \times 10 = 52.5\). And \(\frac{3N}{4} = 22.5\) falls in the 70–80 class (cumulative frequency reaches 23 there), giving \(Q_3 = 70 + \frac{22.5-18}{5} \times 10 = 79.0\). The quartile deviation is \(\frac{79.0 - 52.5}{2} = 13.25\).

7.6 Coefficient of Variation

Standard deviation is expressed in the same units as the data, which makes it impossible to directly compare the variability of two datasets measured in different units, or with very different means. The coefficient of variation (CV) solves this by expressing standard deviation as a percentage of the mean.

\[CV = \frac{\sigma}{\bar{x}} \times 100\%\]

A lower CV indicates more consistency relative to the average; a higher CV indicates more relative variability.

CV is exactly the tool for comparing, say, the variability of employee salaries (measured in thousands of rupees) against the variability of employee tenure (measured in years); standard deviation alone cannot make that comparison meaningfully, but CV can, because it strips away the units.

7.7 Choosing a Measure of Dispersion

  • Range: A quick, rough indicator, useful for a first glance but distorted by a single outlier.
  • Quartile Deviation: Robust to outliers, pairs naturally with the median for skewed data.
  • Mean Deviation: Rarely used in advanced statistics but conceptually simple and robust.
  • Variance and Standard Deviation: The workhorse measures, required for most further statistical techniques such as hypothesis testing and regression, covered later in this book.
  • Coefficient of Variation: The right choice whenever you need to compare variability across datasets with different units or vastly different means.

A standard deviation on its own tells you little without its corresponding mean. A standard deviation of 10 is enormous for data centered around a mean of 15, and negligible for data centered around a mean of 10,000. Always report the mean and the CV alongside the standard deviation when comparing variability across groups.

Recap

Central tendency and dispersion together are the two pillars of descriptive statistics: one number for where the data sits, one number for how spread out it is. Both extend cleanly from raw data to grouped frequency tables, which is exactly why Chapters 4 through 6 of this book were built as one continuous worked example. The next modules in this book build on these same foundations toward measures of shape, inferential statistics, and visualization.


Summary

Concept Description
Core Idea
Dispersion The collection of statistics that describe how spread out or varied the values in a dataset are
Range-Based Measures
Range The difference between the maximum and minimum values, the simplest and most outlier-sensitive measure
Quartiles The three values that divide an ordered dataset into four equal parts
Quartile Deviation Half the distance between the first and third quartiles, robust to outliers
Interquartile Range (IQR) The full distance between the first and third quartiles, the width of a box plot's box
Mean Deviation The average absolute distance of each observation from the mean
Variance and Standard Deviation
Population Variance Average squared deviation from the mean, dividing by N, used for a full population
Sample Variance Average squared deviation from the mean, dividing by n minus 1, used for a sample
Population Standard Deviation Square root of the population variance, expressed in the original units of measurement
Sample Standard Deviation Square root of the sample variance, the most widely reported spread statistic
n vs n-1 Denominator Sample variance corrects for the tendency of a sample to underestimate true population variance
Grouped Data
Grouped Variance Variance computed from class marks and frequencies using the grouped mean
Grouped Quartiles Quartiles located in a grouped frequency table using the same interpolation method as the grouped median
Comparing Variability
Coefficient of Variation (CV) Standard deviation expressed as a percentage of the mean, enabling comparison across different units or means
Choosing a Measure
When to Use Range Best for a quick first look, though a single outlier distorts it heavily
When to Use Quartile Deviation Best for skewed data or when the range is distorted by outliers
When to Use Variance and SD Required for most further statistical modelling, hypothesis testing, and regression
When to Use CV Best when comparing variability across datasets with different units or very different means