Two common tests for omics tables: the Grubbs test for single values and the Mahalanobis distance for whole samples. Formulas, cutoff tables, the quick rules, what to do after a flag, and a checklist that remembers what you ticked.
A test cannot tell a technical fault from a real biological difference. It tells you where to look.
One measurement in one feature. Use the Grubbs test on roughly normal data, so log transform first.
One sample across all features. Use the Mahalanobis distance on the first principal components.
Pipetting slip, failed injection, swapped tube.
A patient who truly responds differently may be your discovery.
Tests whether the single most extreme value is an outlier.
G = max |x - mean| / SDHow many standard deviations the farthest point sits from the mean.
(n-1)/sqrt(n) × sqrt(t² / (n-2+t²))t is the t quantile with n minus 2 degrees of freedom at probability alpha / (2n). Flag the value if G exceeds it.
12 samples, mean 20.1, SD 0.86, alpha 0.05. Flagged.
Add a second extreme value and G drops to 2.09, below 2.41. Nothing is flagged.
Conditions: roughly normal data, one outlier at a time (remove, then repeat on what is left), at least 7 samples.
| n samples | alpha 0.05 | alpha 0.01 |
|---|---|---|
| 7 | 2.020 | 2.139 |
| 8 | 2.127 | 2.274 |
| 9 | 2.215 | 2.387 |
| 10 | 2.290 | 2.482 |
| 12 | 2.412 | 2.636 |
| 15 | 2.548 | 2.806 |
| 20 | 2.708 | 3.001 |
| 25 | 2.822 | 3.135 |
| 30 | 2.908 | 3.236 |
| 40 | 3.036 | 3.381 |
| 50 | 3.128 | 3.482 |
Running Grubbs on every feature multiplies the chance of a false flag. In our clean simulation of 600 features, 31 were flagged at alpha 0.05, about 5 percent. At alpha 0.05 / 600, none were. Use value tests with care and treat sample level tests as the main tool.
Distance from the centre in units that respect the shape and correlation of the cloud.
D² = (x - mean)ᵀ S⁻¹ (x - mean)S is the covariance matrix of the features. A point across the trend gets a large D, a point along it a small one.
Flag a sample when D² exceeds the chi-squared quantile, for example 97.5 percent. The table below gives D itself.
With more features than samples the covariance cannot be estimated. Run it on the first few principal component scores, as in Episode 6.
Fits the covariance to the most central part of the samples, so outliers cannot inflate it. Use it when more than one outlier is possible.
| p | 97.5 percent | 99.9 percent |
|---|---|---|
| 2 | 2.72 | 3.72 |
| 3 | 3.06 | 4.03 |
| 4 | 3.34 | 4.30 |
| 5 | 3.58 | 4.53 |
| 6 | 3.80 | 4.74 |
| 8 | 4.19 | 5.11 |
| 10 | 4.53 | 5.44 |
These are approximations that use the chi-squared distribution with the estimated mean and covariance. Treat a flag as a reason to look, not a verdict.
Not formal tests, but robust and free of normality assumptions.
| Rule | Flags a value when | Watch for |
|---|---|---|
| Box plot | It lies below Q1 minus 1.5 × IQR or above Q3 plus 1.5 × IQR | Over-flags skewed data. An adjusted box plot exists for skewed distributions. |
| MAD | |x - median| / (1.4826 × MAD) is greater than 3 | The cutoff is a convention. Some authors use 2.5. |
30 samples, 600 features, two groups, 3 samples with a shared technical fault, first 4 principal components, cutoff D = 3.34.
| Method | Result |
|---|---|
| Classical Mahalanobis | 0 of 3 faulty samples flagged. The outliers inflated the covariance. |
| Robust (MCD) | 3 of 3 flagged, all above 30. One extra clean sample at 4.5 was also flagged: check it, do not remove it automatically. |
| Grubbs on every feature, clean data | 31 of 600 flagged at alpha 0.05. None at alpha 0.05 / 600. |
One simulated dataset illustrates the ideas. It is not a universal rate.
Sample notes, run order, QC and the raw data.
Technical or biological. Technical can go, and you say so. Biological is information.
Run the analysis with and without it. If the conclusion holds, report that.
Rank-based tests and robust scaling before deleting data.
The test, the cutoff, the samples removed, and why.
Never remove a point only because it spoils the p value.
Tick as you go. Your ticks stay in this browser.
This series is built from the questions researchers actually ask. Tell us where you got stuck and what you want next. It takes under a minute.
Turn on JavaScript to send your questions, or write to wael@omvitalis.com.
DOIs were checked against Crossref. Check the details against the publisher page before you cite.