AI Glossary / Statistics and probability / Intermediate

Grubbs's test

Definition

Grubbs's test is a statistical test for a single unusually extreme observation in a univariate sample whose ordinary observations are assumed to come from an approximately normal population. Its familiar two-sided version compares the largest absolute deviation from the sample mean with the sample standard deviation. A significant result identifies a value requiring investigation; it does not establish that the value is a mistake or authorize its automatic removal.

What it means

Every finite sample has a largest and smallest value. Grubbs's test asks whether the most extreme observation is unusually far from the center under a specified normal-data model, accounting for the fact that it was selected as the most extreme.

That selection matters. Testing an observation chosen after inspecting all values is different from evaluating a measurement nominated independently beforehand. The reference threshold therefore depends on sample size and the chosen one-sided or two-sided alternative.

The test concerns one measured variable and a particular statistical model. It does not decide whether an unusual customer, transaction, or production event is operationally important.

How it works

For the standard two-sided test, calculate G = max_i |x_i − x_bar| / s, using the sample standard deviation with denominator n − 1. Compare G with the appropriate Grubbs critical value for sample size n and significance level alpha.

The critical value can be expressed using a Student t quantile with n − 2 degrees of freedom and upper-tail probability alpha/(2n). A one-sided version for a prespecified upper or lower extreme uses a different tail adjustment. Software options and defaults therefore need checking.

The ordinary null model assumes independent observations from a common normal distribution. Skewness, dependence, changing process levels, or several unusual observations can undermine its interpretation. Multiple-outlier problems call for methods designed for that setting rather than unplanned repeated deletion and retesting.

Three practical examples

  • A laboratory checks whether one calibration measurement is inconsistent with an otherwise stable measurement process.
  • A manufacturing analyst investigates a single extreme component weight after examining the measurement protocol and distribution.
  • An AI data-quality team uses the test within a narrowly defined, approximately normal sensor channel, then traces a flagged reading to its acquisition record.

Think of it this way

Think of a choir in which one voice sounds much louder than the others. Grubbs's statistic compares that voice's distance from the group average with the group's overall variation. It can prompt a sound check, but cannot tell whether the microphone failed or the singer intentionally sang louder. If the whole choir changes volume, the single-voice model is inadequate.

Worked example

Consider six illustrative measurements: 9, 10, 10, 10, 11, and 20. Their mean is 70/6 = 11.6667. The sum of squared deviations is 85.3333, so the sample variance is 85.3333/5 = 17.0667 and s is approximately 4.1312.

The largest absolute deviation is 20 − 11.6667 = 8.3333. Consequently G = 8.3333/4.1312 = 2.0172.

For a two-sided test with n = 6 and alpha = 0.05, the t quantile has four degrees of freedom and upper-tail probability 0.05/12. It is approximately 4.8510, giving a Grubbs critical value of 1.8871. Because 2.0172 exceeds 1.8871, the test flags 20 under its assumptions.

The mean, variance, and statistic were independently calculated, and the critical value was checked through the four-degree-of-freedom t distribution. Six constructed values do not themselves establish normality or independence; the example demonstrates the calculation rather than validating a real measurement process.

Illustrative case study

In a fictional packaging plant, an analyst receives one unusually heavy test weight among otherwise consistent readings. A prespecified Grubbs check flags it, prompting review of the instrument log and physical label.

The log shows that a heavier reference standard was deliberately measured during a calibration check. The value is correct, but belongs to a different measurement condition. The analyst preserves the original record, documents the condition, and separates the calibration observation from the production-weight analysis. The statistical flag helped locate the issue; process information determined the appropriate treatment. No result from this fictional example demonstrates a general reduction in defects or inspection cost.

Common misconceptions and mistakes

A significant result does not prove a data-entry error. A nonsignificant result does not prove that every value is trustworthy. Several extreme observations can inflate the mean and standard deviation and hide one another, a problem known as masking.

Do not select a one-sided test merely because the observed extreme happens to be high. Do not repeatedly remove values until the remaining data pass the test without accounting for the procedure. A normality assumption is especially questionable for naturally skewed quantities such as waiting times or transaction sizes.

Business use

Use the test as one documented component of a measurement-review process. Record the sample definition, direction of the alternative, significance threshold, software settings, flagged value, and investigation outcome. Preserve enough information to reproduce both the original and any corrected analysis.

For automated pipelines, distinguish a review flag from an exclusion rule. A legitimate rare event may be precisely the event a risk model needs to learn about, so removing it can damage downstream performance.

People also ask

Is Grubbs's test the same as a three-standard-deviation rule?

No. Its decision threshold accounts for sample size and the selected extreme.

Can it detect several outliers?

The standard version targets one; other named variants and multiple-outlier procedures require their own definitions.

Should a flagged value be deleted?

Only after a justified, documented assessment of its meaning and validity.

Check your understanding

Why does the example use a denominator of five for the variance?

Answer: It uses the sample variance for six observations.

What does rejection establish?

Answer: Incompatibility with the specified no-outlier model at the chosen threshold, not proof of a faulty observation.

Related terms

  • Outlier
  • Studentized residual
  • Masking
  • Robust statistics
  • normality assumption
  • generalized extreme studentized deviate test
  • data validation

Learn next

Next, compare graphical diagnostics with formal outlier tests. Then study masking and procedures for several suspected outliers, and design an investigation policy that preserves legitimate extreme events.

  • Outlier
  • Masking

More in Statistics and probability

  • Group testing - Group testing is a method for identifying items with a particular property by testing collections of items together.
  • Growth curve (statistics) - A growth curve in statistics describes how an outcome changes over time, often using repeated measurements from the same individuals or other units.
  • Growth function - The growth function of a binary hypothesis class gives the largest number of distinct label patterns that its classifiers can produce on a set of a given size.
  • Guttman scale - A Guttman scale is a cumulative measurement scale in which endorsing a more demanding item implies endorsing every less demanding item on the same ordered...
  • Gy's sampling theory - Gy's sampling theory is a framework for understanding and controlling errors when taking and preparing samples of heterogeneous particulate materials.
  • H-spread - The H-spread is the difference between the upper and lower hinges of a dataset.

Sources

Sources: NIST/SEMATECH e-Handbook, “Grubbs' Test for Outliers,” https://www.itl.nist.gov/div898/handbook/eda/section3/eda35h1.htm; Lukasz Komsta, outliers package documentation, https://search.r-project.org/CRAN/refmans/outliers/html/grubbs.test.html. Both sources were opened; the standard statistic, critical-value rule, assumptions, and implementation variants were checked. The numerical example and plant scenario are original.

Previous: Growth function Next: GTD2

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer