REGR_AVGX()
Average of the independent variable of the regression line
DOUBLE PRECISION
REGR_AVGX ( <y>, <x> )
Parameter | Description |
---|---|
y |
Dependent variable of the regression line.It may contain a table column, a constant, a variable, an expression, a non-aggregate function or a UDF.Aggregate functions are not allowed as expressions. |
x |
Independent variable of the regression line.It may contain a table column, a constant, a variable, an expression, a non-aggregate function or a UDF.Aggregate functions are not allowed as expressions. |
The function REGR_AVGX
calculates the average of the independent variable (x) of the regression line.
The function REGR_AVGX(<y>, <x>)
is equivalent to
SUM(<exprX>) / REGR_COUNT(<y>, <x>) <exprX> :== CASE WHEN <x> IS NOT NULL AND <y> IS NOT NULL THEN <x> END