μ Statistics Lab Spread, variation & unusual values

An interactive statistics lesson

Where is
the fence?

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 mean

The balance point. Every distance above is matched by a distance below.

Variance

The average squared distance from the mean. It measures spread.

Standard deviation

The square root of variance — spread measured in the data's own units.

The playground

Move the data. Move the fence.

Try a dataset
Drag a dot, or focus it and use ← →

Your data

9 values

How the fence is calculated

Center, then spread, then fence.

The fence uses the mean and the standard deviation. The width k is a choice you make; the data does not pick it.

1

Find the mean

Add every value. Divide by n, the number of values.

2

Find the standard deviation

Average the squared distances from the mean, then take the square root.

3

Stretch k SDs each way

Move k standard deviations below the mean and k above it.

The percentile idea

What is a percentile?

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.

How this connects to the fence: the fence is not calculated from percentiles. It is calculated as μ ± kσ. But when data are roughly bell-shaped, the interval from μ − kσ to μ + kσ captures a predictable middle percentage. At k = 2, about 95% is inside, so about 2.5% lies beyond each fence.
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
Current data —

—

—

“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

From variance to standard deviation

σ² = Σ(x − μ)² ÷ n  ·  σ = √σ²

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

Why square the gaps?

Positive and negative gaps would cancel. Squaring makes every gap count.

Gap of +1010² = 100
Gap of −10(−10)² = 100
Gaps added directly10 + (−10) = 0
Squared gaps added100 + 100 = 200

Variance 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.

Then why take a square root?

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.

Why an outlier moves the fence

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

Try these three moves.

Change one thing at a time, then read what happens to σ and the fence.

  1. 01 Make the SD grow.

    Drag one point far away from the rest. Does σ grow by a little or a lot? Does the fence keep up with the point?

  2. 02 Change the rule.

    Set k to 1. How many points are now “outside”? Is calling all of them outliers still fair?

  3. 03 Hide an outlier.

    Raise k until the point outside comes back inside. Has the data changed, or only the rule?