# Measures of spread: range, SD and quartiles

> Two couriers with the same average delivery time, and why only one keeps the promise: measures of spread from range and variance to standard deviation (calculated step by step), quartiles, IQR and the coefficient of variation.

- Course: [Statistics for Product Managers and Marketers](https://productovi.com/courses/statistics-for-pm-and-marketers.md)
- Module: Describing data
- Lesson 2/24, ~48 min
- Source: https://productovi.com/courses/statistics-for-pm-and-marketers/spread

## Same average, very different experience

You're still on CatChow's product team, and today the question comes from operations: the shop works with two courier companies. Customers are promised delivery **within 36 hours**, and the operations lead wants to drop one courier to simplify contracts. She pulls the last 10 deliveries for each and reports: *"Both average exactly 24 hours. It doesn't matter which one we keep."*

It matters a lot. Averages tell you where the data is centred, but nothing about **how far individual values stray from that centre**. A courier who always takes 23–26 hours and one who takes anywhere from 14 to 38 hours have the same mean, but only one of them keeps the 36-hour promise every time.

This lesson is about **measures of spread** (also called measures of *variability*): range, variance, standard deviation, quartiles and the interquartile range, plus the coefficient of variation for comparing spread across different metrics. Along the way you'll calculate a standard deviation step by step. Download the deliveries and follow along.

![Two couriers on scooters carry cat-food boxes to the same house: one rides a straight narrow lane, the other weaves along a wide wobbly path.](https://productovi.com/courses/statistics-for-pm-and-marketers/inline/spread-illustration-2.webp)

*Both arrive on average at the same time, but only one is predictable.*

**Dataset (CSV):** [CatChow deliveries by courier](https://productovi.com/datasets/statistics-for-pm-and-marketers/spread/catchow-deliveries.csv)

The last 10 deliveries by each of two couriers. Synthetic data made for this course.

- `delivery_id`: Delivery number
- `courier`: Courier company: A or B
- `hours`: Hours from dispatch to delivery

**Delivery times: courier A vs courier B**

| Delivery time, hours | Courier A | Courier B |
| --- | --- | --- |
| 12–15 | 0 | 2 |
| 16–19 | 0 | 2 |
| 20–23 | 4 | 0 |
| 24–27 | 6 | 2 |
| 28–31 | 0 | 3 |
| 32–35 | 0 | 0 |
| 36–39 | 0 | 1 |

*Both couriers are centred on 24 hours. Courier A's deliveries sit in a tight cluster; courier B's are spread from 14 to 38 hours, and one breaks the 36-hour promise.*

## Range: the quickest look

The **range** is the largest value minus the smallest. Courier A: $26 - 21 = 5$ hours. Courier B: $38 - 14 = 24$ hours. Already the difference is obvious.

The range is easy to compute and easy to explain, but it depends on just **two values**, the two most extreme ones. One lost parcel that took 90 hours would change courier A's range from 5 to 69, even if the other nine deliveries were perfect. Use the range as a first glance, not as the final word.

## Deviations: how far is each value from the mean?

A better idea is to use **every** value. For each delivery, compute its **deviation**: the value minus the mean. For courier B, sorted, the deviations from 24 hours are:

| Hours | 14 | 14 | 18 | 18 | 24 | 24 | 30 | 30 | 30 | 38 |
|---|---|---|---|---|---|---|---|---|---|---|
| Deviation | −10 | −10 | −6 | −6 | 0 | 0 | +6 | +6 | +6 | +14 |

Why not simply average the deviations? Try it: they add up to exactly **zero**. That's not a coincidence. The mean is the balance point of the data, so the negative deviations always cancel the positive ones. To measure spread we need to get rid of the signs.

![A plank on an orange fulcrum holds cat-food cans at different distances on both sides and stays perfectly level, with a cat watching from below.](https://productovi.com/courses/statistics-for-pm-and-marketers/inline/spread-illustration-3.webp)

*The mean is the balance point: pushes to the left and right cancel out.*

$$
\sum_{i=1}^{n} (x_i - \bar{x}) = \sum_{i=1}^{n} x_i - n\bar{x} = 0
$$

*Deviations from the mean always sum to zero, because n times the mean equals the total.*

## Variance: the mean squared deviation

The standard trick is to **square** each deviation: squares are never negative, and big misses count much more than small ones (a deviation of 14 becomes 196). For courier B the squared deviations are 100, 100, 36, 36, 0, 0, 36, 36, 36 and 196, which add up to **576**.

Now average them, with one twist. When your data is a **sample** (10 deliveries, not every delivery the courier will ever make) you divide by $n - 1$ instead of $n$. Why? The sample mean is computed from the same 10 values, so it sits a little closer to them than the true long-run mean does. That makes the deviations look slightly too small, and dividing by $n - 1$ compensates. So the **sample variance** is $576 / 9 = 64$.

If you truly have the whole population (say, every order ever placed, and you only care about those orders), divide by $n$: $576 / 10 = 57.6$. In product analytics you almost always work with samples, so $n - 1$ is the default.

There is a catch: squaring also squares the units. Variance is **64 hours²**, and nobody can picture a squared hour.

$$
s^2 = \frac{1}{n-1}\sum_{i=1}^{n}(x_i - \bar{x})^2 \qquad \sigma^2 = \frac{1}{N}\sum_{i=1}^{N}(x_i - \mu)^2
$$

*Left: sample variance (divide by n − 1). Right: population variance (divide by N, deviations from the population mean μ).*

## Standard deviation: spread in normal units

Take the square root of the variance and you are back in the original units. That's the **standard deviation (SD)**: $\sqrt{64} = 8$ hours for courier B. Read it as *"a typical delivery is about 8 hours away from the average"*. Do the same for courier A and you'll get a much smaller number: that's your first quiz question.

For data that forms a roughly symmetric, bell-shaped hill, there is a handy rule of thumb: about **68%** of values fall within one SD of the mean, and about **95%** within two SDs. For courier B, "two SDs" is $24 \pm 16$, or 8 to 40 hours, and the 36-hour promise sits inside that band. Some late deliveries are to be expected, not a fluke. (Ten deliveries are too few to trust the percentages exactly, and in module 2 you'll see when this bell shape can be assumed.)

Always report spread next to the centre: **"24 ± 8 hours"** says far more than "24 hours on average".

![Two targets: on one, arrows cluster tightly around the centre; on the other, arrows are scattered widely. A cat with a bow stands between them.](https://productovi.com/courses/statistics-for-pm-and-marketers/inline/spread-illustration-4.webp)

$$
s = \sqrt{s^2} = \sqrt{\frac{1}{n-1}\sum_{i=1}^{n}(x_i - \bar{x})^2}
$$

*Sample standard deviation: the square root of the sample variance, in the same units as the data.*

> **In a spreadsheet**
>
> Sample versions: `=VAR.S(range)` and `=STDEV.S(range)` (in Google Sheets also `VAR` and `STDEV`). Population versions: `=VAR.P(range)` and `=STDEV.P(range)`. If a dashboard shows an SD, check which one it uses; with small samples the difference is noticeable.

## How to calculate standard deviation, step by step

Here is the whole calculation in one place, on courier B's 10 deliveries. It works the same for any metric: order values, session lengths, daily sign-ups.

1. **Find the mean.** Add the values and divide by how many there are: $240 / 10 = 24$ hours.
2. **Subtract the mean from each value** to get the deviations: −10, −10, −6, −6, 0, 0, +6, +6, +6, +14.
3. **Square each deviation:** 100, 100, 36, 36, 0, 0, 36, 36, 36, 196.
4. **Add up the squares:** 576.
5. **Divide by $n - 1$** (here 9) to get the sample variance: $576 / 9 = 64$ hours².
6. **Take the square root:** $\sqrt{64} = 8$ hours. That's the standard deviation.

If the 10 values were the whole population, step 5 would divide by $n = 10$ instead, giving a variance of 57.6 and an SD of about 7.6 hours.

**Variance vs standard deviation:** they carry the same information, since one is the square of the other. Variance is the convenient form for the maths inside tests and models; standard deviation is the one to report, because it is in the units of the data.

## How to find quartiles and the interquartile range

The median splits sorted data in half. **Quartiles** split it into quarters: Q1 has a quarter of the values below it, Q2 is the median, and Q3 has three quarters below it. A simple way to find them by hand: Q1 is the median of the lower half of the data, Q3 the median of the upper half.

Courier B, sorted: 14, 14, 18, 18, 24 | 24, 30, 30, 30, 38. The lower half is 14, 14, 18, 18, 24, so **Q1 = 18**. The upper half is 24, 30, 30, 30, 38, so **Q3 = 30**.

The **interquartile range (IQR)** is $Q_3 - Q_1 = 30 - 18 = 12$ hours: the width of the middle 50% of deliveries. Unlike the range and the SD, the IQR ignores the extremes completely. That lost 90-hour parcel wouldn't change it at all. That is why IQR is the spread partner of the median, and SD the partner of the mean.

Quartiles are special cases of **percentiles**: the 90th percentile is the value below which 90% of the data falls. Product teams use them all the time: "p90 delivery time is 30 hours", "p95 page load is 2.8 seconds". They describe the experience of your unluckiest customers, which the average hides.

$$
\text{IQR} = Q_3 - Q_1
$$

*Interquartile range: the spread of the middle 50% of the data.*

> **Why tools sometimes disagree on quartiles**
>
> There are several accepted ways to compute quartiles. Google Sheets and Excel's `QUARTILE` (same as `QUARTILE.INC`) interpolate between neighbouring values, while the halves method above does not. For the datasets in this lesson both give the same answer; on other data they may differ slightly. That's fine. Just use one method consistently when you compare groups.

## Comparing spread across metrics: the coefficient of variation

Is an SD of 8 big? It depends on the scale. 8 hours is a lot for a 24-hour delivery, but trivial for a 30-day subscription cycle. To compare spread across metrics with different units or sizes, divide the SD by the mean. That's the **coefficient of variation (CV)**, usually shown as a percentage.

Courier B: $8 / 24 \approx 33\%$. Now a marketing example: CatChow's daily ad spend averages \$1,000 with an SD of \$150 (CV 15%), while daily orders from ads average 30 with an SD of 9 (CV 30%). Spend is steady, yet results swing twice as much, relative to their size. That's a hint that something other than budget (day of week, creatives, stock-outs) drives the orders.

CV only makes sense for values measured from a true zero, like hours, money or counts. Don't use it for things like temperature or NPS, which can be negative.

$$
\text{CV} = \frac{s}{\bar{x}} \times 100\%
$$

*Coefficient of variation: SD as a share of the mean.*

## Measures of spread: which one to use when

| Measure | Uses | Robust to extremes? | Good for |
|---|---|---|---|
| Range | 2 values | No | A first glance, "best and worst case" |
| Variance | All values | No | Maths inside other methods (you'll meet it in tests and ANOVA) |
| Standard deviation | All values | No | Reporting spread with the mean: "24 ± 8 hours" |
| IQR / percentiles | Order of values | Yes | Skewed data, SLAs, reporting with the median |
| CV | SD and mean | No | Comparing spread across metrics on different scales |

Back to the couriers. Courier A: range 5 hours, and every delivery within the promise. Courier B: range 24 hours, SD 8 hours, IQR 12 hours, and 1 of 10 deliveries late. Same average, very different customer experience. The case task at the end asks you to make the call.

## Exercises

Answer them on the lesson page to get feedback.

1. Using the dataset **CatChow deliveries by courier**, compute the **sample standard deviation** of courier A's delivery times.

2. In the dataset **CatChow deliveries by courier**, what is the **interquartile range** of courier A's delivery times?

3. If delivery time is measured in hours, its variance is also measured in hours.

4. Put the steps for computing a sample standard deviation in the right order.

5. One parcel gets lost and arrives after 90 hours. Which measures of courier A's spread would change **a lot**? Select all that apply.

6. Daily ad spend: mean \$2,000, SD \$200. Daily sign-ups from ads: mean 50, SD 15. Which is more variable relative to its size?

7. Courier B's last 10 deliveries: mean 24 hours, SD 8 hours. Which sentence reads the SD **correctly**?

8. CatChow's new referral programme brought 12, 15, 9, 18 and 6 sign-ups in its first five weeks. What is the **sample standard deviation** of weekly sign-ups? Round to two decimals.

9. CatChow wants a delivery metric that shows how long its **unluckiest customers** wait, without being thrown off by a single lost parcel. Which one fits best?

10. A PM reports: *"Average checkout time is 40 seconds (SD 35 seconds)."* What does the large SD tell you, and which extra number would you ask for? Answer in 2–4 sentences.

11. Which courier should CatChow keep, and why? Back your answer with numbers from the dataset.

- Previous lesson: [Mean, median and mode: the typical value](https://productovi.com/courses/statistics-for-pm-and-marketers/typical-value.md)
- Next lesson: [Outliers and skewed data: how to find them](https://productovi.com/courses/statistics-for-pm-and-marketers/outliers-and-skew.md)

---
Productovi Learning. Free, no sign-up needed to read.
