Expand description
Covariance and correlation: Pearson, Spearman and Kendall.
See the book entry Correlation and covariance.
Structs§
- Correlation
- A correlation coefficient with its two-sided p-value for the null hypothesis of no association.
Functions§
- correlation_
matrix - The Pearson correlation matrix of the columns
variables[k]. - covariance
- The covariance
Σ(x − x̄)(y − ȳ) / (n − ddof). - covariance_
matrix - The covariance matrix of the columns
variables[k](each a sample of one variable). - kendall
- Kendall’s τ_b,
(C − D) / √((n₀ − n₁)(n₀ − n₂))over concordant and discordant pairs with tie corrections, and a two-sided p-value from the normal approximation toS = C − Dwith the tie-corrected variance.O(n²). - pearson
- Pearson’s product-moment correlation, with the p-value from
t = r √((n−2)/(1−r²))onn − 2degrees of freedom (exact for bivariate normal data). - rank
- Ranks starting at 1, with tied values given the average of their ranks.
- spearman
- Spearman’s rank correlation (Pearson’s on average ranks), with the same t approximation for the p-value. Measures any monotone association.