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

> Returns the mean of the dependent variable.

# regr_avgy

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

Introduced in: v26.9.0

Returns the mean of the dependent variable.

It is taken around a value from the data rather than around zero, so for an integer column past
2^53 it can be closer to the exact mean than [`avg`](/reference/functions/aggregate-functions/avg),
which divides a `Float64` sum.

**Syntax**

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

**Aliases**: `regrAvgY`

**Arguments**

* `y` — Dependent variable. [`(U)Int*`](/reference/data-types/int-uint) or [`Float*`](/reference/data-types/float)
* `x` — Independent variable. [`(U)Int*`](/reference/data-types/int-uint) or [`Float*`](/reference/data-types/float)

**Returned value**

Returns the mean of `y`. [`Float64`](/reference/data-types/float)

**Examples**

**Basic usage**

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