Find the mean
Add every value. Divide by n, the number of values.
An interactive statistics lesson
Change the data. Watch the mean, variance, and standard deviation respond. The fence moves with them — and anything on the outside gets called an outlier.
The balance point. Every distance above is matched by a distance below.
The average squared distance from the mean. It measures spread.
The square root of variance — spread measured in the data's own units.
The playground
How the fence is calculated
The fence uses the mean and the standard deviation. The width k is a choice you make; the data does not pick it.
Add every value. Divide by n, the number of values.
Average the squared distances from the mean, then take the square root.
Move k standard deviations below the mean and k above it.
The percentile idea
Put the values in order from smallest to largest. The pth percentile is the value with about p% of the data at or below it. The 90th percentile is the value with about 90% of the values at or below it.
The median is the 50th percentile. A percentile is a position in the sorted list, so it is a value, not a percentage. It does not use the mean or standard deviation.
| Fence | Inside | Each tail | Percentile range |
|---|---|---|---|
| 1σ | about 68% | about 16% | 16th–84th |
| 2σ | about 95% | about 2.5% | 2.5th–97.5th |
| 3σ | about 99.7% | about 0.15% | 0.15th–99.85th |
—
“Each tail” is the percentage beyond one end of the fence. These percentages are rounded values for an ideal bell-shaped distribution. Skewed data, small samples, or clusters can put very different percentages beyond the same fence. In those cases, actual percentiles may describe the tails better.
Worked calculation
The table lists every squared gap. Σ means “add up.” The steps below combine them, then use the standard deviation to build the fence.
| Value x | x − μ | (x − μ)² | Status |
|---|
This page uses population standard deviation (divide by n). For a sample, many courses divide by n − 1 instead.
Why it works
Positive and negative gaps would cancel. Squaring makes every gap count.
10² = 100(−10)² = 10010 + (−10) = 0100 + 100 = 200Variance averages those squared gaps. Squaring punishes far-away points more than nearby ones, which is why one extreme value can make the spread look large.
A variance is in squared units — awkward if the data are points, minutes, or centimetres. The standard deviation takes the square root, returning to the original units. It acts like a typical distance from the mean.
An extreme value adds a large squared gap. That increases the variance and the standard deviation, which pushes the fence outward. The unusual point can make its own fence wider.
A fence is a rule, not a verdict. A point outside the fence is unusual by this rule. It is not automatically a mistake.
Notice & wonder
Change one thing at a time, then read what happens to σ and the fence.
Drag one point far away from the rest. Does σ grow by a little or a lot? Does the fence keep up with the point?
Set k to 1. How many points are now “outside”? Is calling all of them outliers still fair?
Raise k until the point outside comes back inside. Has the data changed, or only the rule?