DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....


Declaration: GrubbsTest (Data: TDoubleArray; SigLevel: double; var Statistic: double; var Outlier: integer): integer;
The function GrubbsTest performs a Grubbs outlier test on the data contained in Data. The parameter SigLevel specifies the level of significance. On return the variable parameter Outlier provides the index of the element of the array Data which is considered to be an outlier. If no outliers are recognized, Outlier is set to -1. The variable parameter Statistic contains the corresponding test statistic.

The function returns the following error codes:

 0 ... everything is OK, the value of Outlier is valid
-1 ... invalid level of significance
-2 ... too few data values (a minimum of 4 data points is required)
Hint 1: Note that this function tests only for a single outlier, checking both the lowest and the highest value in the Data array. The element which delivers the highest test statistic is compared to the critical value.