Skip to main content

A Python package for correlation analysis between ordinal variables

Project description

ordinalcorr: correlation coefficients for ordinal variables

PyPI version License

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 binary Tetrachoric correlation tetrachoric_corr
ordinal ordinal Polychoric correlation polychoric_corr
continuous ordinal Polyserial correlation polyserial_corr
continuous binary (discretized from continuous) Biserial correlation biserial_corr
continuous binary Point-Biserial correlation point_biserial_corr

Example

Here is an example for computing 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}")

📒 Document

Full document is here

⚖️ License

This project is licensed under the MIT License. See the LICENSE file for details.

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.4.2.tar.gz (11.6 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.4.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ordinalcorr-0.4.2.tar.gz
Algorithm Hash digest
SHA256 f3600aaff49650d69ad501c0bc5b9238102220b79395eff535adc8147aab2b0b
MD5 e6fd70df32945c89ea567d581f5f2fbe
BLAKE2b-256 df7605c639fa4aa6f19861f010acebd5e6012c7764bf48eb296260cc386e7835

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ordinalcorr-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6c776dbe22a24e4e43db06a243f5c3fbe08f343f1d5dbfdba08b77ef6a2ec32d
MD5 1e54de77eb4223e08afae98b5fae2200
BLAKE2b-256 5dc6c2f58315e50deba9647e66403cbb71f8b67ddb6c0bdecf75a7395b9f1f9c

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