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

  1. mysql> select * from t;
  2. +------+------+------+
  3. | id | x | y |
  4. +------+------+------+
  5. | 2 | 14 | 27 |
  6. | 4 | 10 | 20 |
  7. | 3 | 5 | 7 |
  8. | 1 | 18 | 13 |
  9. +------+------+------+
  1. mysql> select regr_sxy(y,x) from t;
  2. +----------------+
  3. | regr_sxy(y, x) |
  4. +----------------+
  5. | 59.75 |
  6. +----------------+

KEYWORDS

REGR_SXY