STAT
Applies to PredictiveInsight only.
Syntax
STAT(data [, keyword])
Parameters
data
The numerical values to compute the moments for (that is, mean, standard deviation, skew, and kurtosis). This can be a constant value, a column, a cell range, or an expression evaluating to any of the above. For the format definition of data, see the "Macro Function Parameters" section in the chapter in this guide for your IBM® product. There must be at least three values in data.
keyword
This optional keyword determines how the computation is performed over the input data range. Select one of the following:
ALL - Performs the computation on all cells in data (default)
COL - Performs the computation separately for each column of data
ROW - Performs the computation separately for each row of data
For more details on using keywords in IBM® Campaign, see Format Specifications.
For more details on using keywords in IBM® PredictiveInsight, see Format Specifications.
Description
STAT calculates the first four moments of the values in the specified data range. The first moment is the average. The second moment is the standard deviation. The third moment is skew, and the fourth moment is kurtosis.
The number of columns returned by the STAT macro function depends on keyword and the number of columns in data.
*
If the keyword ALL is used (the default), the moments are computed over all values in data. One column is returned containing four values.
*
If the keyword COL is used, moments are calculated separately for each input column. One column is returned for each input column, each containing four values.
*
If the keyword ROW is used, the moments are calculated across each row of data. STAT returns four columns. The moments are listed across each row for each row of the input data range.
Examples
TEMP = STAT(MERGE(1, 2, 3, 4, 5)) or TEMP = STAT(MERGE(1, 2, 3, 4, 5), ALL)
Creates a new column named TEMP containing the values 3, 1.58, 0, and -1.2.
Creates a new column named TEMP containing the first four moments of column V1.
Creates a new column named TEMP containing the first four moments of columns V1, V2, and V3.
Creates a new column named TEMP containing the first four moments of the cells in rows 10-20 of column V1.
Creates a new column named TEMP containing the first four moments of the cells in rows 1-5 of columns V1 through V4.
Creates three new columns named TEMP, VX, and VY. The four values in the TEMP column are the moments of column V1, the four values in the VX column are the moments of column V2, and the four values in the column VY are the moments of column V3.
TEMP = STAT(V1[1:5]:V3, COL) or TEMP = STAT(V1[1:5]:V3[1:5], COL)
Creates three new columns named TEMP, VX, and VY, each containing four values. The values in column TEMP are the moments of the cells in rows 1-5 of column V1, the values in column VX are the moments of the cells in rows 1-5 of column V2, and the values in column VY are the moments of the cells in rows 1-5 of column V3.
Creates four new columns named TEMP, VX, VY, and VZ. TEMP contains the average of each row across columns V1, V2, and V3, VX contains the standard deviation, VY contains the skew, and VZ contains the kurtosis.
TEMP = STAT(V1[50:100]:V3],ROW) or TEMP = STAT(V1[50:100]:V3[50:100], ROW)
Creates four new columns named TEMP, VX, VY, and VZ, each containing 51 rows. TEMP contains the average, VX contains the standard deviation, VY contains the skew, and VZ contains the kurtosis. The first row corresponds to row 50 across columns V1, V2, and V3. The second row corresponds to row 51, and so on.
Related Functions
AVG or MEAN
STDV or STDEV