What Grubbs’ test does
Grubbs’ test checks whether the most extreme value of a sample is an outlier, meaning too far from the others to come plausibly from the same normal distribution. It is used in laboratories, quality control and data cleaning, and it is part of standards such as ISO 5725 for interlaboratory studies and ASTM E178.
The formulas
G = |x − x̄| ÷ s
where x is the suspect value and x̄ and s are the mean and standard deviation of the whole sample, suspect value included.
The critical value for a two-sided test at level α is
G_crit = (n − 1) ÷ √n × √(t² ÷ (n − 2 + t²))
where t is the quantile of Student’s t distribution with n − 2 degrees of freedom at 1 − α ÷ (2n). For a one-sided test, α ÷ n is used instead. The value is an outlier if G exceeds G_crit.
Example
A sample of 20 measurements has a mean of 50 and an SD of 5, and the largest value is 64:
- G = 14 ÷ 5 = 2.80;
- critical G at α = 0.05, two-sided: 2.71;
- G is above it: 64 is an outlier at the 5% level, with an approximate p-value of 0.03;
- with these statistics, any value below 36.5 or above 63.5 would be flagged.
Important rules
- The data, apart from the outlier, must be roughly normal. In skewed data, large values are expected and Grubbs’ test flags them wrongly.
- The test checks one value at a time. To look for several outliers, remove the first, recompute the mean and SD, and test again, but beware of masking, where two outliers hide each other. The generalized ESD test handles several outliers properly.
- G can never exceed (n − 1) ÷ √n. If the calculator says it does, the mean or SD probably excludes the suspect value.
- The test needs at least 3 values, and it is not very reliable below about 7.
What to do with an outlier
A statistical outlier is a signal to investigate, not a license to delete. Check for recording errors, instrument faults or a different population, such as a sample from another batch. If there is a clear cause, the value can be corrected or excluded and the reason documented. If not, report the analysis with and without it, or use robust methods such as the median.
The z-score shown is the same number as G when the suspect value is above the mean. Grubbs’ test is stricter than the “beyond 3 SD” rule of thumb for small samples and more lenient for large ones, since it accounts for the sample size.