Skip to content
ClickHouse Docs

regr_avgx

Autogenerated from ClickHouse system tables

Introduced in: v26.9.0

Returns the mean of the independent 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_avgx(y, x)

Arguments

Returned value

Returns the mean of x. Float64

Examples

Basic usage

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