REGR_INTERCEPT() OVER ...
All functions > WINDOW FUNCTION > REGR_INTERCEPT() OVER ...
Returns the y-intercept of the linear regression line over the window frame.
Syntax
Diagram(
Sequence(
Terminal("REGR_INTERCEPT"),
Terminal("("),NonTerminal('expr_y'), Terminal(','), NonTerminal('expr_x'),Terminal(")"),
Terminal("OVER"),
Terminal("("),
NonTerminal("over_clause"),
Terminal(")"),
)
)| Parameter | Type | Required | Description |
|---|---|---|---|
expr_y | EXPRESSION | Yes | The dependent variable (y) |
expr_x | EXPRESSION | Yes | The independent variable (x) |
over_clause | OVER CLAUSE | Yes | OVER (PARTITION BY ... ORDER BY ... [FRAME ...]) |
Notes
- Equivalent to AVG(y) - REGR_SLOPE(y, x) * AVG(x) over the window
- NULL values in either expression are excluded