Skip to content
Omnikalc

Grubbs' outlier test from the mean, SD and sample size

Enter the mean, standard deviation and size of a normal sample, including the suspect value, to get Grubbs' G statistic, its critical value and an approximate p-value.

Updated on
Your inputs

Value out of range

Value out of range

Value out of range

Value out of range

Test

Results

Grubbs statistic G

2.800

Outlier at this significance level
Critical G at α
2.708
Approximate p-value (Bonferroni bound)
0.0315
Distance from the mean in SDs (z-score)
2.800
Largest possible G, (n − 1) ÷ √n
4.249
Values below this are outliers (two-sided)
36.459
Values above this are outliers
63.541

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.

Frequently asked questions

What does Grubbs' test detect?

Whether the most extreme value of a normal sample is an outlier.

Should the mean and SD include the suspect value?

Yes. Grubbs' G uses the mean and standard deviation of the whole sample, including the suspect value.

Can Grubbs' test find several outliers?

Only one at a time. For several, use the generalized ESD test to avoid masking.

Should I delete an outlier found by Grubbs' test?

Not automatically. Investigate its cause and remove it only with a documented reason.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.