REGR_R2
functionsupportedCore SQL functionsReturns the coefficient of determination for non-null pairs in a group. It is computed for non-null pairs using the following formula: Where x is the independent variable and y is the dependent variable.
Syntax
supportedpartialnot supportednot scored
Aggregate function
REGR_R2(y, x)
Window function
REGR_R2(y, x) OVER ( [ PARTITION BY <expr3> ] )
Parameters
| Name | Required | Description |
|---|---|---|
y | required | The dependent variable. This must be an expression that can be evaluated to a numeric type. |
x | required | The independent variable. This must be an expression that can be evaluated to a numeric type. |
expr3 | required | This is the optional expression used to group rows into partitions. |
Returns
If any of the input expressions is of type DECFLOAT, the returned type is DECFLOAT. Otherwise, the returned type is FLOAT.
Usage notes
- DISTINCT is not supported for this function.
- When this function is called as a window function, it does not support: An ORDER BY clause within the OVER clause.
- Explicit window frames.