Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle PL/SQL REGR_SLOPE Function      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

Term: REGR_SLOPE

Definition:
In Oracle, REGR_SLOPE is a linear regression analytic function which is used to measure the slope of a line. Its computation formula looks like this:

COVAR_POP(x,y) / VAR_POP(y)

It accepts two numeric inputs. 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_R2(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 uses REGR_SLOPE to measure the slope of line formed by the columns DEPTNO and SAL.

SELECT deptno, sal, REGR_SLOPE(deptno, sal) OVER (partition by deptno) "REGR_SLOPE"
FROM employee



Related Links:

Related Code Snippets:
  • REGR_SLOPE - REGR_SLOPE returns the slope of the line. After the elimination of null (expr1, expr2...
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 70 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?