Skip to main content
Skip to main content

corrStable

Calculates the Pearson correlation coefficient:

Σ(xxˉ)(yyˉ)Σ(xxˉ)2Σ(yyˉ)2\frac{\Sigma{(x - \bar{x})(y - \bar{y})}}{\sqrt{\Sigma{(x - \bar{x})^2} * \Sigma{(y - \bar{y})^2}}}

Similar to the corr function, but uses a numerically stable algorithm. As a result, corrStable is slower than corr but produces a more accurate result.

Syntax

Arguments

Returned Value

  • The Pearson correlation coefficient. Float64.

*Example

Query:

Result: