THE SPREAD LAB — an interactive notebook
The Spread Lab: Variance, Covariance, Correlation & Coefficient of Variation
Every process wobbles. Here's how to measure it.
Variance, standard deviation, coefficient of variation and its cousins, covariance, and correlation are usually taught as separate formulas to memorize. They're really one idea, asked several different ways: how far do things drift from where we expect them, and do two things drift together? Drag the slider below to feel it before we name it.
Variance — the average squared distance from the mean
Imagine a machine cutting bolts to a target length of 50 mm. No machine is perfect — every bolt lands a little off target. Variance asks: on average, how far off, once you square each miss (so a miss to the left and a miss to the right don't cancel out)?
Notice the units on variance: mm². Squared millimeters aren't something you can picture holding a caliper up to — that awkwardness is the whole reason the next quantity exists.
Standard deviation undoes the squaring. CV undoes the units.
Take the square root of variance and you're back in millimeters — that's standard deviation, the "typical distance from the mean" in plain units. But a std dev of 2mg and a std dev of 2kg are not equally impressive. Coefficient of variation asks the fairer question: how big is that spread relative to the average?
CV is often multiplied by 100 and reported as a percentage.
CV has cousins — and each one trusts the data differently
CV isn't the only way to express spread "relative to something." Four more live in the same family, each built from a different raw material — the full range, just the middle 50%, average distance instead of squared distance, or CV itself renamed for a lab bench. Where they disagree is how much a single wild reading can shake them.
Identical math to CV — just always expressed as a percentage.
That ordering isn't a coincidence. Quartile coefficient of dispersion only looks at Q1 and Q3 — the middle 50% of the data — so one extreme syringe usually doesn't even change which readings sit at those positions. Coefficient of mean deviation averages every distance once, so the outlier counts, but only once. Coefficient of range and RSD both key off the single most extreme reading (or its squared distance, for RSD) — exactly the reading that just broke.
Covariance — variance's formula, aimed at two variables
Variance multiplies each deviation by itself. Covariance multiplies the deviation of X by the deviation of a second variable, Y, at the same moment. If they tend to be above their means together (or below together), the products are positive. If one's up while the other's down, the products are negative.
Correlation — covariance, rescaled to −1…+1
Covariance has the same scale problem variance had: its size depends on the units of X and Y, so a covariance of 4,000 might describe a weaker relationship than a covariance of 0.02, if the units are different enough. Divide covariance by both standard deviations and the units cancel out completely.
One family tree, five names — plus the cousins
These five share one direct bloodline: each is a variation on "average deviation from expected," widened to two variables or rescaled for comparison. Coefficient of range, quartile coefficient of dispersion, and coefficient of mean deviation from the last section are cousins, not children — same goal, different raw materials (range, quartiles, and absolute distance instead of squared distance).
Try it on a new dataset — pallets vs. pins
Two brand-new, fictitious datasets. We'll compute every measure from this lesson on both, by hand, so nothing is hidden inside a slider. The goal isn't just practice — it's to expose something the raw numbers actively hide from you.
Dataset A — pallet shipping weights
Dataset B — precision pin diameters
Step 1 — the mean
Step 2 — variance and standard deviation
That reversal isn't a one-off trick of this example — the same thing happens with every relative measure from this lesson, because they all divide out scale in the same way. Let's run the rest.
Step 4 — range and coefficient of range
Step 5 — quartiles and quartile coefficient of dispersion
Step 6 — mean deviation and coefficient of mean deviation
Every measure, side by side
Running these in Excel and Minitab
The formulas above are what's happening under the hood. In practice, on the exam and on the floor, you'll pull these from software — and the sample/population distinction below is the single most common place people lose points.
| Function | Syntax | Purpose | When to use |
|---|---|---|---|
| VAR.S | =VAR.S(range) | Sample variance | Your data is a sample of a larger population (the usual case) |
| VAR.P | =VAR.P(range) | Population variance | Your data is the entire population — no estimation involved |
| STDEV.S | =STDEV.S(range) | Sample standard deviation | Square root of VAR.S; the default for process/quality data |
| STDEV.P | =STDEV.P(range) | Population standard deviation | Square root of VAR.P |
| AVERAGE | =AVERAGE(range) | Mean | Needed alongside STDEV to build CV yourself — Excel has no native CV function |
| COVARIANCE.S | =COVARIANCE.S(range1,range2) | Sample covariance | Two paired samples (e.g. two process measurements taken together) |
| COVARIANCE.P | =COVARIANCE.P(range1,range2) | Population covariance | Both variables' complete populations are known |
| CORREL | =CORREL(range1,range2) | Pearson correlation (r) | Same result whether you treat the data as sample or population — r is scale-free either way |
| MAX, MIN | =MAX(range), =MIN(range) | Extremes | Build the coefficient of range yourself — no native function |
| QUARTILE.INC | =QUARTILE.INC(range,1) / (range,3) | Q1 / Q3 | Feeds the quartile coefficient of dispersion — again, no native function combines them for you |
| AVEDEV | =AVEDEV(range) | Mean absolute deviation | The numerator for coefficient of mean deviation — one of Excel's more obscure built-ins |