Definition:
In Oracle PL/SQL, the function REGR_SYY is an analytic function used to generate statistics for data diagnostics based on variance of dependent variable of regression line. It takes two numeric inputs and returns a numeric output based on the formula shown below:
REGR_COUNT(x,y) * VAR_POP(x),/b>
Note that the pairs having any argument's value as NULL are eliminated, but the final result might be NULL as per the above computation.
Example Syntax:
REGR_SYY(x,y)
In the syntax, 'x' is referred to as the dependent variable and 'y' is referred to as the independent variable of the Regression Line.
Example Usage:
The SQL query below demonstrates the use of REGR_SYY.
SELECT deptno, sal, REGR_SYY(deptno, sal) OVER (partition by deptno) "REGR_SYY"
FROM employee
/
DEPTNO SAL REGR_SYY
----------- ---------- ----------
100 2300 0
100 3810 0
100 3810 0
100 8300 0
100 0
100 2300 0
110 3900 0
110 8210 0
110 2900 0
120 4500 0
120 8300 0
120 1200 0
120 3200 0
13 rows selected.
Related Links:
Related Code Snippets:
- REGR_SYY - REGR_SYY makes the following computation after eliminating NULL (expr1, expr2) pairs:
...