What Is Outlier Testing and Which Statistical Test Should You Use?

Outlier testing helps you decide whether a suspicious data point is a genuine extreme value or an error that could distort your analysis. This article explains the most common outlier tests, how they work, and when to apply each one.

What It Is

Outlier testing (also called outlier detection or discordancy testing) is a set of statistical procedures used to identify observations that deviate markedly from the rest of a dataset. These procedures are formal hypothesis tests or robust rules that tell you whether a candidate point is statistically unlikely under the assumed distribution of your data.

The authoritative framework for outlier testing is described in ISO 5725-2, which specifically recommends Grubbs' test for detecting outliers in inter-laboratory study data. Other widely accepted methods include Dixon's Q test, the Iglewicz-Hoaglin modified Z-score based on the median absolute deviation (MAD), and the simple 3-sigma rule.

How It Works: The Main Tests

### 1. Grubbs' Test (ISO 5725-2)

Grubbs' test detects one outlier at a time in a normally distributed dataset. The test statistic is:

G = (max |x_i - x_mean|) / s

where x_mean is the sample mean and s is the sample standard deviation. You compare G against a critical value from the Grubbs distribution (or an equivalent t-based formula). If G exceeds the critical value at your chosen significance level (commonly 0.05), the point is declared an outlier.

### 2. Dixon's Q Test

Dixon's Q test is designed for small samples (typically n < 30). It is based on the ratio of the gap between the suspected outlier and its nearest neighbor to the range of the data:

Q = (x_2 - x_1) / (x_n - x_1) (for a suspected low outlier)

where x_1 is the smallest value, x_2 is the second smallest, and x_n is the largest. The calculated Q is compared to a table of critical values for the given sample size and significance level.

### 3. Iglewicz-Hoaglin MAD Rule (Robust)

This method is robust to the presence of multiple outliers. It uses the median and the median absolute deviation (MAD) instead of the mean and standard deviation:

Modified Z-score = 0.6745 (x_i - median) / MAD

A common threshold: if the absolute modified Z-score exceeds 3.5, the point is flagged as a potential outlier. MAD is defined as median(|x_i - median|).

### 4. The 3-Sigma Rule

The simplest method: if a data point lies more than 3 standard deviations from the mean, it is considered an outlier. This rule assumes normality and works best for large, clean datasets. It is less robust because the mean and standard deviation are themselves influenced by outliers.

A Worked Illustrative Example

Example data (illustrative only): 10 measurements of a chemical concentration (mg/L):
4.8, 5.1, 4.9, 5.0, 5.2, 4.7, 5.3, 4.6, 5.0, 7.9

The value 7.9 looks suspicious. Let's test it.

Grubbs' test:
Mean = 5.25, standard deviation (sample) = 0.98.
G = |7.9 - 5.25| / 0.98 = 2.70.
For n = 10 and alpha = 0.05, the critical value is approximately 2.29. Since 2.70 > 2.29, 7.9 is declared an outlier.

Dixon's Q test:
Sorted data: 4.6, 4.7, 4.8, 4.9, 5.0, 5.0, 5.1, 5.2, 5.3, 7.9.
Q = (7.9 - 5.3) / (7.9 - 4.6) = 2.6 / 3.3 = 0.788.
For n = 10 at alpha = 0.05, the critical Q is about 0.466. Since 0.788 > 0.466, 7.9 is an outlier.

MAD rule:
Median = 5.0. Absolute deviations from median: 0.4, 0.1, 0.2, 0.1, 0.2, 0.3, 0.3, 0.4, 0.0, 2.9.
MAD = median of those deviations = 0.3.
Modified Z-score for 7.9 = 0.6745
(7.9 - 5.0) / 0.3 = 6.52.
Since 6.52 > 3.5, 7.9 is flagged.

All three methods agree: 7.9 is a significant outlier.

Common Pitfalls

  • Testing without a hypothesis: Do not run outlier tests repeatedly until a point is removed. Decide on the test and significance level before looking at the data.
  • Ignoring the assumption of normality: Grubbs and Dixon assume the remaining data are approximately normal. If your data are heavily skewed, use a robust method like the MAD rule.
  • Removing outliers automatically: An outlier may be a real, important signal. Always investigate the cause before discarding a point.
  • Using the 3-sigma rule on small samples: With n < 10, the mean and standard deviation are unstable, and the 3-sigma rule often fails to detect true outliers.


Free Outlier Testing Tool

To apply these tests quickly without manual calculation, use the free outlier testing tool at 6SQ: https://www.6sq.com/tools/outlier/. It supports Grubbs, Dixon, and MAD-based methods, and it will give you the test statistic and the verdict in seconds.
Invited:

0 replies, guests cannot view replies. For more features, please log in or register