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


MeanAbsDevVector

Declaration: MeanAbsDevVector (Data: TDoubleArray; Mode: integer; var CentralPoint: double): double;

The function MeanAbsDevVector calculates the mean absolute deviation from either the mean, the median or a user-defined central point. The parameter Data contains the data to be used for the calculation. The parameter Mode controls the type of the central point:
Mode central point
0 mean
1 median
2 user-defined central point

The variable parameter CentralPoint returns the calculated mean or median (Mode = 0 or 1). If Mode is set to 2 the parameter CentralPoint has to be set to the user-defined central point. The function returns the calculated mean absolute deviation.

Hint: If the Data array is empty or the Mode parameter holds an invalid value the function returns a zero value.