Key Points
The standard outlier formula sets fences at and , and flags any value beyond them.
The NIST e-Handbook of Statistical Methods calls these inner fences, places outer fences at three times the IQR, and labels points beyond them mild and extreme outliers respectively.
A second approach uses the Z-score , measuring how many standard deviations a value sits from the mean.
The NIST e-Handbook warns that the maximum possible Z-score is , so on small samples no value can reach a large Z-score however extreme it looks.
Flagging a value as an outlier is not permission to delete it, because the rule identifies unusual values without explaining why they are unusual.
What Is the Outlier Formula?
The outlier formula identifies values sitting far enough from the bulk of a data set to deserve a second look, using quartile fences:
Any observation outside those bounds is flagged. The NIST/SEMATECH e-Handbook of Statistical Methods calls these inner fences, with outer fences at three times the interquartile range.
The Two Standard Outlier Formulas
The quartile method assumes nothing about the shape of the data. It builds the fences from , and the interquartile range, which all ignore the tails, so the rule is not distorted by the values it is looking for.
The Z-score method measures distance from the mean in units of standard deviation:
Values with above about 3 are commonly flagged. The weakness is circular: an extreme value inflates both and , shrinking its own Z-score and hiding it. NIST addresses that with a modified Z-score built from the median:
where is the median and MAD is the median absolute deviation. NIST reports a recommendation that modified Z-scores above 3.5 in absolute value be labelled potential outliers.
Why Z-Scores Fail on Small Samples
This is the detail most outlier guides omit. The NIST e-Handbook notes that the maximum possible Z-score in a sample of size is .
For that ceiling is , so on five observations no value can ever reach a Z-score of 3, however obviously it stands apart.
So applying a "Z above 3" rule to a small sample guarantees finding nothing. For the ceiling is about 2.846, still below 3, and the rule only becomes usable from about .
Variable Key
Symbol | Meaning | Unit or type | Notes |
|---|---|---|---|
, | first and third quartiles | same units as the data | the fence anchors |
interquartile range | same units as the data | ||
inner fence multiplier | dimensionless | NIST uses 3 for outer fences | |
standard score | dimensionless | ||
modified Z-score | dimensionless | median-based, threshold 3.5 | |
median absolute deviation | same units as the data |
Examples of the Outlier Formula
Example 1
A data set has and . Find the inner fences and test whether 78 is an outlier.
Final answer: Since , the value 78 is a mild outlier, beyond the upper inner fence but inside the outer fence at 96.
Example 2
Test whether 100 is an outlier in 2, 4, 5, 6, 100 using a Z-score above 3.
The Z-score rule looks natural here, because 100 is obviously unlike the rest. The mean is and the sample standard deviation is about 42.56, so
That is nowhere near 3, so the rule says 100 is not an outlier. Yet it plainly is.
Two things went wrong together. The value inflated both the mean and the standard deviation it is measured against, and with the largest possible Z-score is only , so the test could never flag anything.
The quartile method has no such ceiling. Sorted, the data gives and , so and the upper fence is :
Final answer: 100 is an outlier by the IQR rule, and beyond the outer fence at 12 it is an extreme one.
Example 3
Find the outlier fences for 12, 14, 15, 15, 16, 18, 19, 45.
With , the quartile positions are and :
Final answer: 45 is flagged, since , and it also passes the outer fence at 32.25, making it extreme.
Example 4
A sample of 11 values has and . Is a value of 77 an outlier by the Z-score rule?
With , the ceiling is , so a Z-score of 3.375 is not attainable. The figures given are therefore inconsistent with a sample of this size.
Final answer: The value exceeds the maximum Z-score for , so the stated mean, standard deviation and sample size cannot all be correct. Checking a Z-score against the ceiling catches transcription errors in reported summary statistics.
Example 5
Use the modified Z-score on 10, 11, 12, 13, 40.
The median is 12, and the absolute deviations from it are , whose median is 1, so :
Final answer: , far above the 3.5 threshold, so 40 is flagged.
The median and MAD both ignore the extreme value, so the modified score is not dragged down by it as the ordinary Z-score was in Example 2.
An Outlier Is Not Automatically an Error
What the rule tells you | What it does not tell you |
|---|---|
The value lies far from the bulk of the data | Whether it was recorded incorrectly |
How far, in IQR or standard deviation units | Whether the underlying process changed |
Whether it is mild or extreme by NIST's bands | Whether it should be removed |
The NIST e-Handbook treats outlier identification as labelling, and names Grubbs' test as the recommended route when testing for a single outlier. None of that decides what to do with the point.
A flagged value can be a keying error, a genuine rare event, or the most informative observation in the set. Deciding needs to know where the data came from, which no formula supplies.
Tripping Points to Avoid
Mistake 1: Deleting flagged values as a matter of routine
Where it slips in: The rule returns a clean verdict, so the verdict gets treated as an instruction.
Don't do this: Remove every value beyond a fence before analysing the data.
The correct way: Investigate first, and if a point is removed, say which rule flagged it and why removal was justified.
Students who ask what the flagged value would mean if it were real, before deciding anything, keep the genuinely interesting observations. The reflex to tidy data is where real findings get discarded.
Mistake 2: Using a Z-score threshold on a small sample
Where it slips in: The "Z above 3" rule is widely quoted without its sample-size condition.
Don't do this: Apply a Z-score cutoff of 3 to a sample of five or ten values.
The correct way: Check the ceiling first. Below about the threshold is unreachable, so use the quartile fences or the modified Z-score instead.
Mistake 3: Recomputing the fences after removing a point
Where it slips in: Removing one outlier changes the quartiles, which moves the fences, which flags another point, and so on.
Don't do this: Iterate the rule until nothing is flagged.
The correct way: Apply the fences once, to the original data. Repeated application will eventually flag almost anything, because each removal tightens the spread the next pass measures against.
What to Remember About the Outlier Formula
The outlier formula flags values beyond or .
NIST calls these inner fences and adds outer fences at three times the IQR, separating mild from extreme outliers.
The Z-score alternative is self-defeating on small samples, because the maximum attainable score is .
A flagged point is a candidate for investigation, never an automatic deletion.
To work through data handling with a teacher, explore a high school math tutor or math tutoring.
Quick Self-Check, Try These
Find the inner fences for 5, 7, 8, 9, 10, 12, 30 and say whether 30 is flagged. Then compute the maximum possible Z-score for this sample size and decide whether a Z-score rule could have caught it.
Want a live Bhanzu trainer to walk through more statistics problems? Book a free demo class.
Read More
Was this article helpful?
Your feedback helps us write better content