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


BartlettTest

Declaration: BartlettTest (Data: TDouble2DArray; NSampleData: TIntArray; var Chi2: double): double;
The function BartlettTest performs a Bartlett's test to check for equal variances of grouped data. It tests the null hypothesis that the variances of all groups are equal. The grouped data are contained in the two-dimensional array Data, each group represented by one column of the array. The group sizes are contained in the array NSampleData:

The variable parameter Chi2 returns the chi-square value of the test, the returned function value is the corresponding p-value.

Please note that the Data array has to have as many rows (or more) as the number of members of the largest group. The group data always run from index 0 to NSampleData[grp]-1. Values beyond NSampleData[grp]-1 are ignored.

The function returns the following error codes:

 0 .... everything is OK, the value is the probability corresponding to the Chi2 value
-1 .... the number of columns of Data does not match the size of NSampleData
-2 .... one of the groups is smaller than 6 data points