Skip to main content

A Python package for correlation analysis between ordinal variables

Project description

ordinalcorr: correlation coefficients for ordinal variables

PyPI version License Unit Tests

A Python package for computing correlation coefficients designed for ordinal-scale data (e.g., Likert items). Supports polychoric correlation and other ordinal association measures.

📦 Installation

pip install ordinalcorr

📘 Features

Polychoric correlation

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}")

Polyserial correlation

Compute correlation coefficient between continuous variable and ordinal variable

from ordinalcorr import polyserial_corr

x = [0.1, 0.1, 0.2, 0.2, 0.3, 0.3]
y = [0, 0, 0, 1, 1, 2]

rho = polyserial_corr(x, y)
print(f"Polyserial correlation: {rho:.3f}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ordinalcorr-0.2.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ordinalcorr-0.2.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file ordinalcorr-0.2.0.tar.gz.

File metadata

  • Download URL: ordinalcorr-0.2.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ordinalcorr-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ac10b634cfea0388ff930c11fe41529c75edad16ef238491e533b0f7e4a9d7eb
MD5 f56af38e89162846078b2835cc675798
BLAKE2b-256 1630d4d781ae387b4334c1dcd9fdab2b945476f6a501c8d964aa8f42051f4537

See more details on using hashes here.

File details

Details for the file ordinalcorr-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ordinalcorr-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ordinalcorr-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 caeba937045623c2a2045693d28c7a716f366b3949efd22e4c43a2eed8d875e8
MD5 4a9664552b711c2c15026520215b4b9c
BLAKE2b-256 ee20db43c4f10e56d18c95754e4bd819bb81a60d948f9c7b56fc944dece34b75

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page