regr_r2
aggregate function
Applies to: Databricks SQL
Databricks Runtime 11.0 and above
Returns the coefficient of determination from values of a group where xExpr
and yExpr
are NOT NULL.
Syntax
regr_r2( [ALL | DISTINCT] yExpr, xExpr) [FILTER ( WHERE cond ) ]
This function can also be invoked as a window function using the OVER
clause.
Arguments
yExpr
: An numeric expression, the dependent variable.xExpr
: An numeric expression, the independent variable.cond
: An optional boolean expression filtering the rows used for the function.