An outlier is a value that sits far from the rest of the data. It might be a typing error, a broken instrument, a sample from a different population, or simply a rare but genuine observation. How you handle it can change your conclusions, and doing it badly (deleting inconvenient points after seeing the results) is one of the classic ways research goes wrong. This guide shows how to find outliers, why the popular "z > 3" rule often fails, and a defensible way to decide what to do.
A worked example
Seven measurements of a protein concentration (mg/mL):
4.1, 4.3, 4.4, 4.6, 4.8, 5.0, 9.7
The last value is obviously suspicious. Look at what it does to the summary statistics:
| All 7 values | Without 9.7 | |
|---|---|---|
| Mean | 5.27 | 4.53 |
| Median | 4.60 | 4.50 |
| Standard deviation | 1.98 | 0.33 |
One value moves the mean by 0.74 and multiplies the standard deviation by six. The median barely moves. This is why outliers matter so much for t-tests and ANOVA, which rely on means and SDs, and so little for rank-based tests such as Mann-Whitney U.
Method 1: the box-plot rule (Tukey's fences)
The most widely used rule is based on the interquartile range (IQR), the width of the middle 50% of the data:
- Find the first quartile (Q1) and third quartile (Q3). Here Q1 = 4.35 and Q3 = 4.90, so IQR = 0.55.
- Compute the fences: lower = Q1 − 1.5 × IQR = 3.53; upper = Q3 + 1.5 × IQR = 5.73.
- Values beyond the fences are flagged. Here 9.7 is far beyond the upper fence.
This is exactly what a box plot draws: the whiskers extend to the most extreme values inside the fences, and anything beyond them appears as a separate point. Because quartiles are barely affected by extreme values, the rule is not fooled by the outlier itself. Values beyond 3 × IQR are sometimes called "extreme" outliers.
Method 2: z-scores, and why they often fail
A z-score measures how many standard deviations a value is from the mean. A popular rule flags |z| > 3. For our example:
- z for 9.7 = (9.7 − 5.27) / 1.98 = 2.24, so the rule does not flag it.
The problem is that the outlier inflates both the mean and the standard deviation it is being measured against. This "masking" effect is worst in small samples. In fact, with n values, no z-score can ever exceed (n − 1) / √n. For n = 7 that is 2.27, and for n = 10 it is 2.85, so a "z > 3" rule can never flag anything in a sample of 10 or fewer, no matter how absurd the value.
Robust alternatives replace the mean with the median and the SD with the median absolute deviation (MAD), but for most purposes the IQR rule is simpler and works well.
Flagged is not the same as wrong
A rule can only tell you that a value is unusual. Whether to remove it depends on why it is unusual. Work through these questions:
| Cause | What to do |
|---|---|
| Data-entry or transcription error (9.7 should be 4.97) | Correct it from the original records. If it cannot be verified, remove it and say so. |
| Known technical failure (bubble in the well, failed calibration, protocol violation) | Exclude it, documenting the reason. Ideally these criteria are written down before the experiment. |
| Subject from a different population than intended (wrong species, exclusion criterion met) | Exclude based on the eligibility criteria, not on the value itself. |
| No identifiable problem: a genuine but extreme observation | Keep it. Use methods that are robust to it, and consider reporting results with and without it. |
The golden rule: decide on exclusion criteria based on the reason a value is suspicious, ideally before seeing the results, and never because removing it makes your p-value smaller.
Analysing data that contain genuine outliers
- Use rank-based tests. Mann-Whitney U and Kruskal-Wallis treat the most extreme value simply as "the largest", so it cannot dominate the result.
- Report medians and IQRs rather than means and SDs. See mean vs median.
- Transform the data. If outliers are all on the high side of a right-skewed variable, a log transformation often turns them into ordinary values.
- Sensitivity analysis. Run the analysis both ways. If the conclusion is the same, say so and the reader can be confident. If the conclusion depends on one data point, the reader needs to know that too.
Show your outliers
Hiding outliers by plotting only means and error bars is the worst option: the reader cannot see that the mean is being pulled by one value. In StatFlo, draw a Box Plot with Show individual data points turned on. Every value is visible, the box shows the median and quartiles, and points beyond the whiskers stand out immediately. If you exclude anything, state in the figure legend or methods how many values were excluded and why.
Summary
Find outliers with a box plot (the 1.5 × IQR rule), not z > 3. Investigate the cause. Correct or remove only errors and documented failures. Keep genuine extreme values and use robust methods, and be transparent about every decision.