REGR_AVGX
REGR_AVGX(y, x)
Section titled “REGR_AVGX(y, x)”- y: This is the dependent variable parameter in the function REGR_AVGX(y, x). It represents the set of values that are to be predicted or estimated.
- x: This is the independent variable parameter in the function REGR_AVGX(y, x). It is the set of values used for prediction or estimation of the dependent variable ‘y’.
Example
Section titled “Example”SELECT REGR_AVGX(y, x) FROM (VALUES (1, 2), (2, 4), (3, 6)) AS t(x, y);Output
Section titled “Output”2Explanation
Section titled “Explanation”The REGR_AVGX function calculates the average of the independent variable (x). In our example, with the input values for variable x being 1, 2, and 3, the average of these numbers equals 2.