Skip to content
ClickHouse Docs

regr_sxy

Autogenerated from ClickHouse system tables

Introduced in: v26.9.0

Returns the sum of products of the two variables:

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

Syntax

regr_sxy(y, x)

Arguments

Returned value

Returns the sum of products of x and y around their means. Float64

Examples

Basic usage

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