ordinalcorr documentation¶
Installation¶
pip install ordinalcorr
Example¶
Compute correlation coefficient between two ordinal variables
from ordinalcorr import polychoric_corr
x = [1, 1, 2, 2, 3, 3]
y = [0, 0, 0, 1, 1, 1]
rho = polychoric_corr(x, y)
print(f"Polychoric correlation: {rho:.3f}")