Calculating Standard Deviation of Wild Data Without Dropping an Outlier
The Quiet Crime of Deleting the Outlier
Most people, the first time they see a number that breaks the pattern, reach for the delete key. I've watched it happen in classrooms, in spreadsheets, in field notebooks with coffee stains on the corners. Someone collects seven days of data, six of them behave, and the seventh is four times larger than the rest. The cursor hovers. The justification writes itself: "That's obviously a mistake. It'll skew everything." And then—gone.
Here's what nobody tells you in that moment: deleting the outlier doesn't clean your data. It flatters it. You haven't removed an error; you've removed evidence. The whole reason standard deviation exists—the reason the formula squares every deviation instead of just averaging them—is to refuse to let an average hide how wild the rest of the data really is. Drop the outlier, and you've broken the honesty meter before you even turned it on.
I learned this with a small dataset and one stubborn number I didn't want to keep.
The Dataset That Wouldn't Behave
Last spring I was tracking daily visitor counts at a small regional museum—seven consecutive days of foot traffic, hand-recorded by the front desk attendant on a clipboard that had seen better decades. The numbers were:
42, 38, 45, 41, 39, 44, 187
Six of those days sit in a tidy band between 38 and 45. The seventh—187—was the Saturday a school district sent four busloads of fourth graders on a field trip. It wasn't a sensor glitch. It wasn't a data entry error. It was a real event that produced a real number, and it was sitting in my dataset like a brick in a pillowcase.
Every instinct told me to cut it. "That's not a typical day," I thought. And it wasn't. But typical isn't what standard deviation measures. Standard deviation measures how far the data actually spreads—from the quiet days and the chaotic ones alike. If I wanted to know how wild this week really was, I had to keep the wild day in.
So I did. Here's what happened, step by step, with every subtraction and square left visible—because the working exists to be checked, not trusted.
Choose Population or Sample—Deliberately
Before touching a single subtraction, you have to make a choice that most people skip: are these seven days the entire population, or a sample of something larger?
This matters more than it sounds. If I'm describing exactly these seven days—this specific week at this specific museum—then I have the full population, and I divide by n (which is 7). If I'm using this week to estimate the variability of museum traffic in general—treating these seven days as a window into a broader reality—then I have a sample, and I divide by n−1 (which is 6).
The difference is one number in the denominator, and it changes the final result. Dividing by n−1 gives a slightly larger standard deviation, because a sample tends to underestimate how spread out the true population is. The formula compensates.
For this exercise, I chose sample standard deviation. These seven days were a sample of the museum's broader operational reality, not a sealed-off universe. I wanted the number to reflect that. Write this choice down. Don't let it be a default. The moment you divide without knowing why, you've stopped doing statistics and started pressing buttons.
The Step-by-Step Working—Meant to Be Checked
Here's the part where most people hand the job to a calculator and move on. Don't. Replicate each subtraction and square with your own pencil, and you've actually learned the formula. Skip it, and you've borrowed an answer.
Step 1: Find the Mean
Add every value, divide by the count.
42 + 38 + 45 + 41 + 39 + 44 + 187 = 436
436 ÷ 7 = 62.29
The mean is 62.29. Notice immediately what the outlier did: without that 187, the average would have been about 41.5. The single wild day pulled the mean up by more than 20 visitors. The average is already compromised—and that's exactly why we need the standard deviation. It will tell us how badly.
Step 2: Subtract the Mean from Every Value
Each deviation shows how far one observation sits from the center:
- 42 − 62.29 = −20.29
- 38 − 62.29 = −24.29
- 45 − 62.29 = −17.29
- 41 − 62.29 = −21.29
- 39 − 62.29 = −23.29
- 44 − 62.29 = −18.29
- 187 − 62.29 = 124.71
Six of these are negative and modest. One is positive and enormous. This is the moment the data tells you the truth the average was hiding: one day was 124.71 visitors above the mean. The others huddle between 17 and 24 below it. The spread isn't gradual. It's a cliff.
Step 3: Square Every Deviation
Squaring serves two purposes: it makes every value positive (so negatives and positives don't cancel each other out), and it punishes large deviations disproportionately. A deviation of 124 becomes a squared deviation of over 15,000. A deviation of 20 becomes about 400. The outlier's influence doesn't just survive—it gets amplified, which is the entire point.
- (−20.29)² = 411.68
- (−24.29)² = 590.00
- (−17.29)² = 298.94
- (−21.29)² = 453.26
- (−23.29)² = 542.42
- (−18.29)² = 334.52
- (124.71)² = 15,552.58
Check these. Grab a pencil. The first time I did this by hand, I transposed two digits in the outlier's square and got a standard deviation of 31 instead of 55. The number felt wrong—a standard deviation of 31 would mean most days fell between 31 and 93 visitors, which clearly wasn't true given that six days were clustered in the upper 30s and low 40s. That's the value of working it out: wrong answers feel wrong because you've held the data in your hands.
Step 4: Sum the Squares and Divide
Add them all:
411.68 + 590.00 + 298.94 + 453.26 + 542.42 + 334.52 + 15,552.58 = 18,183.40
Now divide. Because I chose sample standard deviation, I divide by n−1 = 6:
18,183.40 ÷ 6 = 3,030.57
This is the variance. It's a real number, but it's in squared units—squared visitors, which is a concept that doesn't mean anything to anyone standing at a museum front desk. So we take one more step.
Step 5: Take the Square Root
√3,030.57 = 55.05
The sample standard deviation is 55.05 visitors.
That's the honesty meter, fully assembled. It says: this week's visitor counts had a standard deviation of roughly 55, against a mean of roughly 62. In plain terms, the spread is almost as large as the average itself. That's a week with a serious disruption in it, and the number refuses to pretend otherwise.
What the Number Tells You—And What It Doesn't
A standard deviation of 55.05 doesn't tell you that the outlier was a school bus. It doesn't tell you whether the outlier was legitimate or erroneous. It doesn't tell you what to do next. It tells you one thing, precisely: how dispersed the data is around its own mean.
That's less than what people want from it, and more than what they expect. The number is honest to the point of being uncomfortable. If I had deleted the 187 and recalculated, the mean would drop to 41.5, the standard deviation would shrink to about 2.7, and the week would look like a model of consistency. A tidy graph. A clean report. And a lie.
The outlier didn't break the calculation. The outlier was the calculation. Without it, the standard deviation is a vanity metric—small, reassuring, and useless for understanding what actually happened. The formula squares every deviation precisely so that one wild observation can't hide. It gets amplified, not buried. That's not a flaw in the math. That's the design.
Keep the Outlier, Submit the Number
Here's the lesson I keep returning to: never let one outlier talk you out of submitting the calculation. The temptation is always to clean first, compute second. But the cleaning is where the bias lives. Every time you remove a value before calculating standard deviation, you're deciding in advance what the answer should be—and then producing a number that confirms your decision. That's not statistics. That's a story you're telling yourself with math-shaped props.
The right order is the reverse: compute first, interpret second. Let the standard deviation do its job, which is to report the dispersion faithfully, including the parts that make you uncomfortable. Then, if you need to, report the outlier separately—flag it, annotate it, explain it. "Six typical days plus one field-trip day, standard deviation = 55.05" is a far more honest summary than "Seven days, standard deviation = 2.7" with the inconvenient day quietly erased from the spreadsheet.
Keep your decimals faithful to your source data. If you counted whole visitors, report the standard deviation to two decimals and stop. Don't manufacture false precision by letting the output sprout six decimal places your input never had. The number 55.05 is honest. The number 55.0506384 is theater.
And choose population versus sample with intention. Not because a dropdown menu offered you both and the default looked fine. Because the question you're answering demands one or the other, and the wrong choice gives you a number that's close but not correct—close enough to feel right, far enough to mislead anyone who reads it.
Standard deviation is the statistician's honesty meter. It works only when you feed it everything you observed, wild days included. The formula doesn't need your data to be well-behaved. It needs your data to be true.