regr_syy
regr_syy 介绍
regr_syy(y, x) - 对于组中的非空值对,返回 REGR_COUNT(y, x) * VAR_POP(y),其中 y 是因变量,x 是自变量。
Examples:
> SELECT regr_syy(y, x) FROM VALUES (1, 2), (2, 2), (2, 3), (2, 4) AS tab(y, x);
0.75
> SELECT regr_syy(y, x) FROM VALUES (1, 2), (2, null), (2, 3), (2, 4) AS tab(y, x);
0.6666666666666666
> SELECT regr_syy(y, x) FROM VALUES (1, 2), (2, null), (null, 3), (2, 4) AS tab(y, x);
0.5
Since: 3.4.0