> ## 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

Возвращает сумму произведений отклонений двух переменных:

$$
\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=Запрос theme={null}
SELECT regr_sxy(y, x)
FROM VALUES('x Float64, y Float64', (1, 2), (2, 4), (3, 6), (4, 8))
```

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