Grubbs’ Outlier G-Statistic & Robust Modified Z-Score (MAD) Outlier Detector Calculator

Detect statistical outliers via Grubbs’ G-test and robust Median Absolute Deviation (MAD) Z-score.

Grubbs’ Outlier Statistic (G) 3.36 G (SDs)
Robust Modified MAD Z-Score 3.957 MAD Z
Theoretical Max G Bound (N−1)/√N 4.007 G_max
Raw Deviation from Mean 42 units
Inputs
Try:
x_i
Suspected extreme observation x_i.
mean
Sample arithmetic mean x̄.
SD
Sample standard deviation s.
median
Sample median.
MAD
Median Absolute Deviation MAD = median(|x − median|).
N
Sample size N.
Results & Graph
Grubbs’ Outlier Statistic (G)
3.36 G (SDs)
Robust Modified MAD Z-Score
3.957 MAD Z
Theoretical Max G Bound (N−1)/√N
4.007 G_max
Raw Deviation from Mean
42 units

Grubbs’ Outlier Statistic (G)

Graph 1 • How the inputs feed Grubbs & MAD Outlier Test
Grubbs’ Outlier G-Statistic & Robust Modified Z-Score (MAD) Outlier Detector Calculator • Custom Domain Schematic (Non-Parametric & Hypothesis Testing) μ / Critical Cutoff (suspectO, sampleMe) Suspect Outlier Value: 94 x_i • Sample Mean: 52 mean GRUBBS’ OUTLIER STATISTIC 3.36 G (SDs) • Robust Modified MAD Z-: 3.957 MAD Z • Theoretical Max G Boun: 4.007 G_max Eq: Grubbs G = |x_i − x̄| / s; Mod
Graph 2 • Grubbs’ Outlier Statistic (G) as Suspect Outlier Value changes (40% to 160% of current)
0 G (SDs 2.96 G (SDs 5.91 G (SDs 1.15 37.60x_i 0.352 56.40x_i 1.86 75.20x_i 3.36 94x_i 4.03 112.8x_i 4.70 131.6x_i 5.38 150.4x_i
Graph 3 • Suspect Outlier Value and Sample Mean together Compares Grubbs’ Outlier Statistic (G) when Sample Mean is shifted +25% (solid) vs. −25% (dashed).
0 G (SDs 2.40 G (SDs 4.80 G (SDs --- Sample Mean @ 75% 0.0640 -30% 1.19 -15% 2.32 +0% 3.45 +15% 4.37 +30%
Summary: Grubbs’ G statistic is 3.36 (theoretical ceiling 4.01 for N=18) and robust Iglewicz-Hoaglin Modified MAD Z-score is 3.96 (Outlier ≥ 3.5).
Summary: Grubbs’ G statistic is 3.36 (theoretical ceiling 4.01 for N=18) and robust Iglewicz-Hoaglin Modified MAD Z-score is 3.96 (Outlier ≥ 3.5).
Interactive chart & math engine powered by CalculatorGraph

Formula: Grubbs & MAD Outlier Test Formula

Grubbs G = |xi − x̄| / s
ModifiedZMAD = 0.6745 × |xi − Median| / MAD (Outlier if > 3.5)
Grubbs G = |x_i − x̄| / s; Modified_Z_MAD = 0.6745 × |x_i − Median| / MAD (Outlier if > 3.5)
  • suspectOutlierValue: Suspect Outlier Value (x_i)
  • sampleMean: Sample Mean (mean)
  • sampleStdDev: Sample Std Dev (SD)
  • sampleMedian: Sample Median (median)
  • medianAbsoluteDeviationMad: Median Absolute Deviation (MAD)
  • sampleSizeN: Sample Size N (N)

Frequently Asked Questions

Does this calculator tell me if Grubbs' test is significant?

No. It reports the G statistic, 3.36 on the defaults, and the theoretical maximum for your sample size, but not the critical value or a p-value. Look up the Grubbs critical value for your N and significance level in a table, or compute it from the t distribution, and compare G with it to complete the test.

What is the theoretical max G bound used for?

It is the largest G any point can have in a sample of that size, (N−1)/√N, which is 4.007 for N=18. It is not a critical value. Its main use is catching bad inputs: if your numbers imply a G above the bound, the calculator stops with an inconsistent-inputs message, because the mean, standard deviation and N cannot belong to the same sample.

Should the mean and SD include the suspected outlier?

Yes. Grubbs' statistic is defined using the mean and standard deviation of the whole sample, suspect value included. Calculating them after removing the point makes the point look far more extreme than the test intends and can push G above the theoretical bound, which is a sign the inputs are mixed up.

Can I test a suspiciously low value?

Yes. Both scores use the absolute distance, so a low value works the same way as a high one. A reading of 20 with the default summary statistics gives G of 2.56 and a modified z-score of 2.698, so it is not flagged by the 3.5 rule. The raw deviation line keeps the sign and shows -32 units.

Why is the modified z-score higher than G on the defaults?

The outlier pulls the mean up and inflates the standard deviation, which shrinks G. The median and MAD are hardly affected by one wild value, so the robust score stays large. With a median of 50 and MAD of 7.5 the score reaches 3.957 while G is 3.36. A big gap between them often signals masking.

My software gives a MAD of about 11. Is that right for this form?

Possibly not. Many packages report a scaled MAD, multiplied by about 1.4826, by default. This form wants the raw MAD, because it applies the 0.6745 factor itself. Entering a scaled value of about 11.1 instead of 7.5 drops the default score from 3.957 to 2.674 and changes the verdict, so check which one you have.

What happens if my MAD is zero?

The form will not accept it. A zero MAD means more than half the values are identical, so the robust spread is zero and the modified z-score is undefined. Both the MAD and the standard deviation must be above zero before the calculator returns anything. For data like that, rely on the Grubbs statistic worked by hand or inspect the values directly instead.

Is the 3.5 cut-off a strict rule?

It is the threshold Iglewicz and Hoaglin recommended for flagging potential outliers, and the calculator uses it as a fixed line, flagging anything at or above 3.5. It is a screening guide, not a significance test. A score of 3.418, which the default data give for a reading of 88, is close enough to the line to deserve a look anyway.

Does my data need to be normally distributed?

Grubbs' test assumes that, apart from the suspect point, the data come from a roughly normal distribution. With skewed data it flags values in the long tail too often. The modified z-score is less sensitive to that assumption, which is one reason to read both. For strongly skewed data, consider transforming the values first.

Can I use this to find several outliers at once?

Not reliably. Both methods here test a single suspect value. Running Grubbs' test again and again after removing points raises the overall false alarm rate, and several outliers can mask each other by inflating the standard deviation. A procedure designed for multiple outliers, such as Rosner's generalised ESD test, handles that case properly.

What is the smallest sample this works for?

The calculator needs a whole-number N of at least 3 and returns an error otherwise; at N=3 the bound is only 1.155. Grubbs' test technically starts at three, but with very small samples neither method has much power to separate a real outlier from ordinary variation. With fewer than about eight values, investigate the measurement itself first.

The default suspect: a reading of 94 in a sample averaging 52

The form starts with a sample of 18 values whose mean is 52, standard deviation 12.5, median 50 and median absolute deviation 7.5. One reading, 94, looks too high, and the calculator scores it two ways.

Grubbs' statistic measures distance from the mean in standard deviations. The reading sits 42 units above the mean, and 42 divided by 12.5 is 3.36. That is the headline G.

The modified z-score measures distance from the median in robust units. The reading is 44 above the median of 50. Multiply 44 by 0.6745 and divide by the MAD of 7.5 and you get 3.957, which the calculator reports to three decimals. Because that is at or above 3.5, the interpretation labels the point an outlier under the Iglewicz and Hoaglin rule.

A third supporting figure, 4.007, is the largest G any single point could ever reach in a sample of 18. It is not a pass mark. It is a ceiling, and it matters more than it looks, as a later section explains.

So on the defaults both methods point the same way. The reading is more than three standard deviations from the mean and about four robust units from the median, and both are strong hints that 94 deserves a closer look before it goes into any average.

G on its own is a distance, not a test result

The calculator stops at the statistic. It does not compute the Grubbs critical value for your sample size or a p-value, so the result line saying 3.36 does not by itself tell you whether the test rejects.

To finish the test you need the critical value for your N and chosen significance level, either from a published Grubbs table or from its formula. For a two-sided test the critical value is (N−1)/√N multiplied by the square root of t² divided by (N − 2 + t²), where t is the upper critical value of Student's t with N − 2 degrees of freedom at α/(2N). Most statistics packages and spreadsheet t functions can produce t. If G exceeds the critical value, the suspect point is declared an outlier at that level.

Notice that the first factor in that formula is the same (N−1)/√N the calculator reports as the theoretical bound. The critical value is always smaller than the bound, because the second factor is always below one. That gives a quick sense check: a G close to the bound is extreme for that sample size, while a G well under it may or may not clear the critical value.

When G exceeds the 4.007 ceiling, the inputs are inconsistent

In a sample of N values that includes the suspect point, no value can sit more than (N−1)/√N standard deviations from the mean. An extreme point drags the mean towards itself and inflates the standard deviation at the same time, which caps how large G can get. For N=18 the cap is 4.007.

That makes the bound a useful error detector, and the calculator now uses it that way. Keep the default mean, SD and suspect value but change N to 10, and the bound falls to 2.846 while G would be 3.36. That combination cannot happen with real data, so instead of a result the form reports that the summary numbers are inconsistent and asks you to check the mean, SD and N.

When you see that message, the usual cause is that the mean and SD were calculated without the suspect value, or N is wrong, or the summary statistics came from a different sample. Recompute the mean and standard deviation from the full sample, including the suspect reading, before drawing any conclusion.

Raising N has the opposite effect. At N=25 the bound becomes 4.8, so the same G of 3.36 sits further below the ceiling. Larger samples naturally produce more extreme points by chance, which is why Grubbs' critical value grows with N.

The modified z-score and the 3.5 line

The second method replaces the mean with the median and the standard deviation with the MAD. Neither the median nor the MAD moves much when one value is wild, so the score is not dragged down by the very point you are testing. The constant 0.6745 rescales the MAD so the score is comparable to an ordinary z-score when the data are normal.

The calculator applies the 3.5 cut-off that Iglewicz and Hoaglin recommended, and it treats a score of exactly 3.5 as an outlier. The line is sharp. The mild preset, a suspect value of 70, scores only 1.799 with a G of 1.44 and is nowhere near it. A value of 88 scores 3.418 and is not flagged, even though its G of 2.88 is large. The default 94 scores 3.957 and is flagged, and the extreme preset of 101 reaches 4.587 with a G of 3.92, close to the 4.007 ceiling.

The test is symmetric. A low reading of 20 sits 32 units below the mean and 30 below the median, giving G of 2.56 and a modified z of 2.698. The calculator uses absolute distances, so you enter the value as it is and it reports the size of the departure, though the raw deviation line keeps the sign and shows -32 units.

Raw MAD, not the scaled version some software returns

The MAD field expects the plain median of the absolute deviations from the median. Find the median, take each value's distance from it, and the median of those distances is the MAD.

Several statistics packages report a scaled MAD by default, multiplied by about 1.4826 so it estimates the standard deviation for normal data. R's mad() function does this unless you set the constant to one. If you paste that scaled figure into this form, the 0.6745 factor is applied on top of a value that has already been scaled, and the score comes out too small.

The difference is not subtle. With the default MAD of 7.5 the score is 3.957 and the point is flagged. Entering roughly 11.1, which is what a scaled MAD of 7.5 would look like, drops the score to 2.674 and the point passes. Same data, opposite verdict. Check which version your software gives before typing it in.

A MAD of zero is another trap. It happens when more than half the values are identical, and the modified z-score is then undefined. The form requires both the standard deviation and the unscaled MAD to be above zero and will not produce a score otherwise. For data like that, rely on the Grubbs statistic or look at the values directly.

Why the two scores disagree, and which one to trust

On the defaults the modified z of 3.957 is larger than G of 3.36. That is typical when a real outlier is present. The outlier inflates the standard deviation, which shrinks G, while the MAD barely notices it. This shrinking is called masking, and it gets worse when there are two or more outliers on the same side, because each one hides the others.

Grubbs' test assumes the rest of the data are roughly normal and tests one suspect point at a time. It is the more formal test, with a defined significance level, but it is fragile when the data are skewed or contain several outliers. The modified z-score is a screening rule rather than a hypothesis test. It has no p-value, but it holds up better when the data are messy.

A sensible reading is to treat agreement as strong evidence and disagreement as a prompt. If G is large but the modified z sits under 3.5, the sample may simply have a wide spread. If the modified z flags a point but G looks modest, check for masking by other extreme values.

Getting the six summary inputs right

All six numbers must describe the same sample, and that sample must include the suspect value. Grubbs' statistic is defined with the mean and standard deviation of the full data set. Removing the suspect point first and then testing it against the cleaned mean gives a much larger G and breaks the bound described earlier.

Use the sample standard deviation, the one that divides by N − 1, which is the default in most spreadsheets and calculators. N is the total count of values, including the suspect.

N must be a whole number of 3 or more, and the form returns an error for anything smaller or fractional. Grubbs' test is not meaningful for tiny samples anyway, and with only a handful of values neither method has much power. Below about seven or eight values, look at the data and the measurement process rather than leaning on any test.

What to do once a point is flagged

A flag is a reason to investigate, not permission to delete. Go back to the source of the 94. Was it a transcription error, a faulty instrument, a sample from a different population, or a genuine but rare result? Each answer leads to a different decision.

If the value is a clear error, correct or remove it and say so. If it is genuine, keep it and consider reporting results with and without it, or switch to methods that use the median and MAD so one extreme value does not dominate. Silently dropping points that fail a test makes later analysis look more certain than it is.

If several values look suspicious, avoid running Grubbs' test repeatedly on the same data with the same critical value. Each removal changes the mean and standard deviation, and the overall error rate creeps up. A method built for multiple outliers, such as Rosner's generalised extreme studentised deviate procedure, is a better fit for that situation.