#
Statistical aggregation functions

Use the drop-down on each function to see a brief description and the syntax of each function. Click the function name in the syntax description for further details.

## Statistical aggregation functions in the data load script

The following statistical aggregation functions can be used in scripts.

Avg() finds the average value of the aggregated data in the expression over a number of records as defined by a group by clause.

Correl() returns the aggregated correlation coefficient for a series of coordinates represented by paired numbers in x-expression and y-expression iterated over a number of records as defined by a group by clause.

**correl**(x-expression, y-expression)

Fractile() finds the value that corresponds to the inclusive fractile (quantile) of the aggregated data in the expression over a number of records as defined by a group by clause.

**fractile**(expression, fractile)

FractileExc() finds the value that corresponds to the exclusive fractile (quantile) of the aggregated data in the expression over a number of records as defined by a group by clause.

**fractileexc**(expression, fractile)

Kurtosis() returns the kurtosis of the data in the expression over a number of records as defined by a group by clause.

LINEST_B() returns the aggregated b value (y-intercept) of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers in x-expression and y-expression iterated over a number of records as defined by a group by clause.

**linest_b**(y-expression, x-expression [, y0 [, x0 ]])

LINEST_DF() returns the aggregated degrees of freedom of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers in x-expression and y-expression iterated over a number of records as defined by a group by clause.

**linest_df**(y-expression, x-expression [, y0 [, x0 ]])

This script function returns the aggregated F statistic (r2/(1-r2)) of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers in x-expression and y-expression iterated over a number of records as defined by a group by clause.

**linest_f**(y-expression, x-expression [, y0 [, x0 ]])

LINEST_M() returns the aggregated m value (slope) of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers in x-expression and y-expression iterated over a number of records as defined by a group by clause.

**linest_m**(y-expression, x-expression [, y0 [, x0 ]])

LINEST_R2() returns the aggregated r2 value (coefficient of determination) of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers in x-expression and y-expression iterated over a number of records as defined by a group by clause.

**linest_r2**(y-expression, x-expression [, y0 [, x0 ]])

LINEST_SEB() returns the aggregated standard error of the b value of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers in x-expression and y-expression iterated over a number of records as defined by a group by clause.

**linest_seb**(y-expression, x-expression [, y0 [, x0 ]])

LINEST_SEM() returns the aggregated standard error of the m value of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers in x-expression and y-expression iterated over a number of records as defined by a group by clause.

**linest_sem**(y-expression, x-expression [, y0 [, x0 ]])

LINEST_SEY() returns the aggregated standard error of the y estimate of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers in x-expression and y-expression iterated over a number of records as defined by a group by clause.

**linest_sey**(y-expression, x-expression [, y0 [, x0 ]])

LINEST_SSREG() returns the aggregated regression sum of squares of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers in x-expression and y-expression iterated over a number of records as defined by a group by clause.

**linest_ssreg**(y-expression, x-expression [, y0 [, x0 ]])

LINEST_SSRESID() returns the aggregated residual sum of squares of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers in x-expression and y-expression iterated over a number of records as defined by a group by clause.

**linest_ssresid**(y-expression, x-expression [, y0 [, x0 ]])

Median() returns the aggregated median of the values in the expression over a number of records as defined by a group by clause.

**median**(expression)

Skew() returns the skewness of expression over a number of records as defined by a group by clause.

Stdev() returns the standard deviation of the values given by the expression over a number of records as defined by a group by clause.

Sterr() returns the aggregated standard error (stdev/sqrt(n)) for a series of values represented by the expression iterated over a number of records as defined by a group by clause.

STEYX() returns the aggregated standard error of the predicted y-value for each x-value in the regression for a series of coordinates represented by paired numbers in x-expression and y-expression iterated over a number of records as defined by a group by clause.

**steyx**(y-expression, x-expression)

## Statistical aggregation functions in chart expressions

The following statistical aggregation functions can be used in charts:

Avg() returns the aggregated average of the expression or field iterated over the chart dimensions.

**avg**({[SetExpression] [DISTINCT] [TOTAL [<fld{, fld}>]]} expr)

Correl() returns the aggregated correlation coefficient for two data sets. The correlation function is a measure of the relationship between the data sets and is aggregated for (x,y) value pairs iterated over the chart dimensions.

**correl**({[SetExpression] [TOTAL [<fld {, fld}>]]} value1, value2 )

Fractile() finds the value that corresponds to the inclusive fractile (quantile) of the aggregated data in the range given by the expression iterated over the chart dimensions.

**fractile**({[SetExpression] [TOTAL [<fld {, fld}>]]} expr, fraction)

FractileExc() finds the value that corresponds to the exclusive fractile (quantile) of the aggregated data in the range given by the expression iterated over the chart dimensions.

**fractileexc**({[SetExpression] [TOTAL [<fld {, fld}>]]} expr, fraction)

Kurtosis() finds the kurtosis of the range of data aggregated in the expression or field iterated over the chart dimensions.

**kurtosis**({[SetExpression] [DISTINCT] [TOTAL [<fld{, fld}>]]} expr)

LINEST_B() returns the aggregated b value (y-intercept) of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers in the expressions given by the expressions x_value and y_value, iterated over the chart dimensions.

**linest_r2**({[SetExpression] [TOTAL [<fld{ ,fld}>]] }y_value, x_value[, y0_const[, x0_const]])

LINEST_DF() returns the aggregated degrees of freedom of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers in the expressions given by x_value and y_value, iterated over the chart dimensions.

**linest_df**({[SetExpression] [TOTAL [<fld{, fld}>]]} y_value, x_value [, y0_const [, x0_const]])

LINEST_F() returns the aggregated F statistic (r2/(1-r2)) of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers in the expressions given by x_value and the y_value, iterated over the chart dimensions.

**linest_f**({[SetExpression] [TOTAL[<fld{, fld}>]]} y_value, x_value [, y0_const [, x0_const]])

LINEST_M() returns the aggregated m value (slope) of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers given by the expressions x_value and y_value, iterated over the chart dimensions.

**linest_m**({[SetExpression] [TOTAL[<fld{, fld}>]]} y_value, x_value [, y0_const [, x0_const]])

LINEST_R2() returns the aggregated r2 value (coefficient of determination) of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers given by the expressions x_value and y_value, iterated over the chart dimensions.

**linest_r2**({[SetExpression] [TOTAL [<fld{ ,fld}>]] }y_value, x_value[, y0_const[, x0_const]])

LINEST_SEB() returns the aggregated standard error of the b value of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers given by the expressions x_value and y_value, iterated over the chart dimensions.

**linest_seb**({[SetExpression] [TOTAL [<fld{ ,fld}>]] }y_value, x_value[, y0_const[, x0_const]])

LINEST_SEM() returns the aggregated standard error of the m value of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers given by the expressions x_value and y_value, iterated over the chart dimensions.

**linest_sem**([{set_expression}][ distinct ] [total [<fld {,fld}>] ] y-expression,
x-expression [, y0 [, x0 ]] )

LINEST_SEY() returns the aggregated standard error of the y estimate of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers given by the expressions x_value and y_value, iterated over the chart dimensions.

**linest_sey**({[SetExpression] [TOTAL [<fld{ ,fld}>]] }y_value, x_value[, y0_const[, x0_const]])

LINEST_SSREG() returns the aggregated regression sum of squares of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers given by the expressions x_value and y_value, iterated over the chart dimensions.

**linest_ssreg**({[SetExpression] [TOTAL [<fld{ ,fld}>]] }y_value, x_value[, y0_const[, x0_const]])

LINEST_SSRESID() returns the aggregated residual sum of squares of a linear regression defined by the equation y=mx+b for a series of coordinates represented by paired numbers in the expressions given by x_value and y_value, iterated over the chart dimensions.

**linest_ssresid**({[SetExpression] [TOTAL [<fld{ ,fld}>]] }y_value, x_value[, y0_const[, x0_const]])

Median() returns the median value of the range of values aggregated in the expression iterated over the chart dimensions.

**median**({[SetExpression] [TOTAL [<fld{, fld}>]]} expr)

MutualInfo calculates the mutual information (MI) between two fields or between aggregated values in Aggr().

**MutualInfo**{[SetExpression] [DISTINCT] [TOTAL target, driver [, datatype [, breakdownbyvalue [, samplesize ]]])

Skew() returns the aggregated skewness of the expression or field iterated over the chart dimensions.

**skew**{[SetExpression] [DISTINCT] [TOTAL [<fld{ ,fld}>]]} expr)

Stdev() finds the standard deviation of the range of data aggregated in the expression or field iterated over the chart dimensions.

**stdev**({[SetExpression] [DISTINCT] [TOTAL [<fld{, fld}>]]} expr)

Sterr() finds the value of the standard error of the mean, (stdev/sqrt(n)), for the series of values aggregated in the expression iterated over the chart dimensions.

**sterr**({[SetExpression] [DISTINCT] [TOTAL[<fld{, fld}>]]} expr)

STEYX() returns the aggregated standard error when predicting y-values for each x-value in a linear regression given by a series of coordinates represented by paired numbers in the expressions given by y_value and x_value.

**steyx**{[SetExpression] [TOTAL [<fld{, fld}>]]} y_value, x_value)