Skip to main content
Skip to main content

REGR_SXX

Description​

Syntax​

double regr_sxx(y, x)

x, y support basic numeric types.

calculate the sum of the squared differences between each X value and the mean of all X values

EXAMPLE​

We have the following data

mysql> select * from t;
+------+------+------+
| id | x | y |
+------+------+------+
| 2 | 14 | 27 |
| 4 | 10 | 20 |
| 3 | 5 | 7 |
| 1 | 18 | 13 |
+------+------+------+
mysql> select regr_sxx(y,x) from t;
+----------------+
| regr_sxx(y, x) |
+----------------+
| 92.75 |
+----------------+

KEYWORDS​

REGR_SXX