REGR_SYY
REGR_SYY is an aggregate function in SQL that returns the sum of squares of the differences between dependent variable values and their corresponding predicted values in a linear regression model. It's typically used in statistical analysis to evaluate the goodness of fit of a regression model.
REGR_SYY(y, x)
- y: It’s the dependent variable represented usually as the response in the language of regression analysis. It’s a numerical input for which REGR_SYY computation is made. Null or non-numeric inputs result in null outputs.
- x: It’s the independent variable, also known as the predictor in regression analysis. This is also a numerical input which helps in the regression computations. Similar to y, null or non-numeric input values result in null outputs.
Example
Output
Explanation
The REGR_SYY function in Oracle performs a linear regression calculation and returns the sum of squares of the differences of the dependent variable. In this example, it calculates the sum of squares of the differences for ‘score’ for each ‘hours_studied’ in the ‘student_scores’ table.
REGR_SYY(Y, X)
- y: This is the dependent variable in the regression equation. It is typically the variable we’re interested in predicting or understanding. Each value of Y corresponds to a value of X in the data set.
- x: This is the independent variable in the regression equation. It is the variable we use to predict or explain the variations in Y. Each value of X corresponds with a value of Y in the data set.
Example
Output
Explanation
The REGR_SYY function in SQL is used to compute the sum of squares of the differences from the mean for column2. The value provided is the result of this computation on the provided dataset in the ‘table’.