ordinalcorr.polychoric¶
- ordinalcorr.polychoric(x: Sequence[int] | ndarray[int], y: Sequence[int] | ndarray[int]) float[source]¶
Estimate the polychoric correlation coefficient between two ordinal variables.
The polychoric correlation assumes that the two observed ordinal variables are thresholded representations of underlying continuous variables that follow a bivariate normal distribution.
- Parameters:
x (array_like (int)) – Ordinal variable.
y (array_like (int)) – Ordinal variable.
- Returns:
Estimated polychoric correlation coefficient.
- Return type:
float
Examples
>>> from ordinalcorr import polychoric >>> x = [1, 1, 2, 2, 3, 3] >>> y = [0, 0, 0, 1, 1, 1] >>> polychoric(x, y)
References