correlation coefficients for ordinal-scaled variables
Project description
ordinalcorr: correlation coefficients for ordinal variables
ordinalcorr is a Python package designed to compute correlation coefficients tailored for ordinal-scale data (e.g., Likert items).
It supports polychoric correlation coefficients and other coefficients for ordinal data.
📦 Installation
pip install ordinalcorr
✨ Features
This package provides several correlation coefficients for many types of variables
| Variable X | Variable Y | Method | Function |
|---|---|---|---|
| binary (discretized) | binary (discretized) | Tetrachoric correlation | tetrachoric |
| ordinal (discretized) | ordinal (discretized) | Polychoric correlation | polychoric |
| continuous | ordinal (discretized) | Polyserial correlation | polyserial |
| continuous | binary (discretized) | Biserial correlation | biserial |
| continuous | binary | Point-Biserial correlation | point_biserial |
Example
Here is an example for computing correlation coefficient between two ordinal variables
from ordinalcorr import polychoric
x = [1, 1, 2, 2, 3, 3]
y = [0, 0, 0, 1, 1, 1]
rho = polychoric(x, y)
print(f"Polychoric correlation: {rho:.3f}")
📒 Document
⚖️ License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ordinalcorr-0.5.0.tar.gz.
File metadata
- Download URL: ordinalcorr-0.5.0.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98d57343c9d3682cccaf4a3e93f57b11acd03133d1c42689264b10577bbc36ae
|
|
| MD5 |
b85e9edcd97c2f70b440743421b29f1a
|
|
| BLAKE2b-256 |
50f8653172664c3b1dccaf10c24d1a807f0cd12e07f511d7b13464b707d1491b
|
File details
Details for the file ordinalcorr-0.5.0-py3-none-any.whl.
File metadata
- Download URL: ordinalcorr-0.5.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7373348b1493f4bd25a3031ff5cef8e1e366a096acff12fb68ee826666e6e5aa
|
|
| MD5 |
18c11e8d589d17366094f17dd375813d
|
|
| BLAKE2b-256 |
87dacb725a3775382faf3f908cbbb97f8fa6a78d6d6bde3702e965cb6a59dec5
|