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

> Retorna a soma dos produtos dos desvios das variáveis em relação às suas médias.

# regr_sxy

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

Introduzido em: v26.9.0

Retorna a soma dos produtos das duas variáveis:

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

**Sintaxe**

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

**Aliases**: `regrSXY`

**Argumentos**

* `y` — Variável dependente. [`(U)Int*`](/reference/data-types/int-uint) ou [`Float*`](/reference/data-types/float)
* `x` — Variável independente. [`(U)Int*`](/reference/data-types/int-uint) ou [`Float*`](/reference/data-types/float)

**Valor retornado**

Retorna a soma dos produtos de `x` e `y` em relação às suas médias. [`Float64`](/reference/data-types/float)

**Exemplos**

**Uso básico**

```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 │
└────────────────┘
```
