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

> Devuelve la media de la variable dependiente.

# regr_avgy

<h2 id="regr_avgy">
  regr\_avgy
</h2>

Introducido en: v26.9.0

Devuelve la media de la variable dependiente.

Se calcula en torno a un valor tomado de los datos, y no en torno a cero, por lo que, en una columna de tipo integer con valores superiores a
2^53, puede aproximarse más a la media exacta que [`avg`](/es/reference/functions/aggregate-functions/avg),
que divide una suma de tipo `Float64`.

**Sintaxis**

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

**Alias**: `regrAvgY`

**Argumentos**

* `y` — Variable dependiente. [`(U)Int*`](/es/reference/data-types/int-uint) o [`Float*`](/es/reference/data-types/float)
* `x` — Variable independiente. [`(U)Int*`](/es/reference/data-types/int-uint) o [`Float*`](/es/reference/data-types/float)

**Valor devuelto**

Devuelve la media de `y`. [`Float64`](/es/reference/data-types/float)

**Ejemplos**

**Uso básico**

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

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