Skip to main content
Skip to main content

REGR_SXY

Description

Syntax

double regr_sxy(y, x)

x, y support basic numeric types.

calculate the sum of the products of deviations of two variables, X and Y, from their respective means

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_sxy(y,x) from t;
+----------------+
| regr_sxy(y, x) |
+----------------+
| 59.75 |
+----------------+

KEYWORDS

REGR_SXY