Skip to content
ClickHouse Docs

regr_sxx

Autogenerated from ClickHouse system tables

Introduced in: v26.9.0

Returns the sum of squares of the independent variable:

Σ(x−xˉ)2\Sigma{(x - \bar{x})^2}

Syntax

regr_sxx(y, x)

Arguments

Returned value

Returns the sum of squares of x around its mean. Float64

Examples

Basic usage

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