Name

REGR_R2 — Returns the coefficient of determination (R-squared) of the regression line.

Synopsis

numeric REGR_R2 ( in expr1 any ,
in expr2 any );

Description

REGR_R2 returns the coefficient of determination (also called "R-squared" or "goodness of fit") for the regression. VAR_POP(expr1) and VAR_POP(expr2) are evaluated after the elimination of null pairs. The return values are:

NULL if VAR_POP(expr2) = 0
1 if VAR_POP(expr1) = 0 and VAR_POP(expr2) != 0
(CORR(expr1,expr2) * CORR(expt1, expr2)) if VAR_POP(expr1) > 0 and VAR_POP(expr2) != 0

Parameters

expr1

Number expression.

expr2

Number expression.

Return Types

The function returns a value of type NUMERIC. If the function is applied to an empty set, then it returns null.