Skip to main content

corr

Introduced in: v1.1.0 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}}}
This function uses a numerically unstable algorithm. If you need numerical stability in calculations, use the corrStable function. It is slower but provides a more accurate result.
Syntax
Arguments Returned value Returns the Pearson correlation coefficient. Float64 Examples Basic correlation calculation
Query
Response
Last modified on June 19, 2026