4. Elements of OpenSQL Statements : Functions : Aggregate Functions : Binary Aggregate Functions
 
Share this page                  
Binary Aggregate Functions
Ingres supports a variety of binary aggregate functions that perform a variety of regression and correlation analysis.
For all of the binary aggregate functions, the first argument is the independent variable and the second argument is the dependent variable.
The following table lists binary aggregate functions:
Name
Result Data Type
Description
regr_count
integer
Count of rows with non-null values for both dependent and independent variables.
covar_pop
float
Population covariance (sum of the products of the difference of the independent variable from its mean, times the difference of the dependent variable from its mean, divided by the number of rows).
covar_samp
float
Sample covariance (sum of the products of the difference of the independent variable from its mean, times the difference of the dependent variable from its mean, divided by the number of rows minus 1).
corr
float
Correlation coefficient (ratio of the population covariance divided by the product of the population standard deviation of the independent variable and the population standard deviation of the dependent variable).
regr_r2
float
Square of the correlation coefficient.
regr_slope
float
Slope of the least-squares-fit linear equation determined by the (independent variable, dependent variable) pairs.
regr_intercept
float
Y-intercept of the least-squares-fit linear equation determined by the (independent variable, dependent variable) pairs.
regr_sxx
float
Sum of the squares of the independent variable.
regr_syy
float
Sum of the squares of the dependent variable.
regr_sxy
float
Sum of the product of the independent variable and the dependent variable.
regr_avgx
float
Average of the independent variables.
regr_avgy
float
Average of the dependent variables.