Alphabetical list of functions
Returns the population covariance of a set of number pairs.
COVAR_POP ( dependent-expression, independent-expression )
dependent-expression The variable that is affected by the independent variable.
independent-expression The variable that influences the outcome.
The function returns a numeric value. If the function is applied to an empty set, then it returns NULL.
Both dependent-expression and independent-expression are numeric. The function is applied to the set of (dependent-expression, independent-expression) pairs after eliminating all pairs for which either dependent-expression or independent-expression is NULL. The following computation is then made:
(SUM ( x * y ) - SUM ( y ) * SUM ( x ) * SUM ( x ) / n) / n
where x represents the dependent-expression and y represents the independent-expression.
SQL/92 Vendor extension.
SQL/99 SQL/foundation feature outside of core SQL.
Sybase Not supported by Adaptive Server Enterprise.
The following example measures the strength of association between employees' age and salary. This function returns the value 73785.84005866687.
SELECT COVAR_POP (salary, (year(now()) - year(birth_date))) FROM employee
SQL Anywhere Studio 9.0.2
Copyright © 1989–2004 Sybase, Inc. Portions copyright © 2001–2004 iAnywhere Solutions, Inc. All rights reserved.