Iterative Grubbs outlier test without adapting critical value (Not recommended)
[outlierfree, outlier] = ST_grubbs_iterat(v, p) [outlierfree, outlier] = ST_grubbs_iterat(v, p, side) [outlierfree] = ST_grubbs_iterat(v, p) [outlierfree] = ST_grubbs_iterat(v, p, side)
vector of numerical values
statistical confidence level (%) as a string or the level of significance (α) as a decimal value, "95%", "99%", "99.9%" or 0.05, 0.01, 0.001 resp (see examples).
one-or two-sided "both" (default), "left", "right"
input vector with the detected outlier removed; unchanged if the test does not identify an outlier
detected outliers as a scalar vector; [] if no outlier is detected
Performs an ITERATIVE Grubbs outlier test. The classic Grubbs test detects just one outlier at a time. This function applies the test iteratively on the same data record until no further outlier is found.
![]() | IMPORTANT: When ST_grubbs_iterat() repeatedly used its interative algorithm on the same data it does not adapting the critical value. After each iterative run, the statistical confidence decreases. This means that even if a confidence level of 99% was specified, the result does not correspond to that level of statistical confidence. It is lower and increases the probability of removing valid observations. For statistically reliable outlier removal, the classic Grubbs test (ST_grubbs) is recommended. However, it can only detect one outlier in a data record. If more than one outlier is expected, Roesner-ESD (ST_esd) is the statistically clean alternative. A warning is displayed on very output of ST_grubbs_iterat() It is implemented for comparison purposes because it is often used this way in lab practice. Use it with care. |
Confidence levels 95%, 99% or 99.9% (α: 0.05, 0.01 or 0.001) are available.
The test can be applied one- or two-sided. If “side” is set to “left,” the outliers are determined one-sided from the minimum side; if “side” is set to “right,” from the maximum side. If "side" is set to "both" or omitted the test is performed two-sided and determine outliers from the minimum and the maximum side.
The test statistic

Critical value:

Decision rule
The selected observation is classified as an outlier when G > Gcrit. Equality does not lead to rejection.