> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-vortex-format.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 各変数の平均からの偏差の積の総和を返します。

# regr_sxy

<h2 id="regr_sxy">
  regr\_sxy
</h2>

導入バージョン: v26.9.0

2 つの変数の偏差積和を返します:

$$
\Sigma{(x - \bar{x})(y - \bar{y})}
$$

**構文**

```sql theme={null}
regr_sxy(y, x)
```

**別名**: `regrSXY`

**引数**

* `y` — 従属変数。 [`(U)Int*`](/reference/data-types/int-uint) または [`Float*`](/reference/data-types/float)
* `x` — 独立変数。 [`(U)Int*`](/reference/data-types/int-uint) または [`Float*`](/reference/data-types/float)

**戻り値**

`x` と `y` について、それぞれの平均からの偏差の積和を返します。 [`Float64`](/reference/data-types/float)

**例**

**基本的な使い方**

```sql title=Query theme={null}
SELECT regr_sxy(y, x)
FROM VALUES('x Float64, y Float64', (1, 2), (2, 4), (3, 6), (4, 8))
```

```response title=Response theme={null}
┌─regr_sxy(y, x)─┐
│             10 │
└────────────────┘
```
