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 twodimensional 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 chisquare value of the test, the returned function value is the corresponding pvalue.
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
