Skip to content
ClickHouse Docs

regr_avgy

Autogenerated from ClickHouse system tables

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, which divides a Float64 sum.

Syntax

regr_avgy(y, x)

Arguments

Returned value

Returns the mean of y. Float64

Examples

Basic usage

SELECT regr_avgy(y, x)
FROM VALUES('x Float64, y Float64', (1, 2), (2, 4), (3, 6), (4, 8))
┌─regr_avgy(y, x)─┐
│               5 │
└─────────────────┘