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

  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_sxx(y,x) from t;
  2. +----------------+
  3. | regr_sxx(y, x) |
  4. +----------------+
  5. | 92.75 |
  6. +----------------+

KEYWORDS

REGR_SXX