Skip to main content

psymetrics

Reliability, factor analysis and SEM for psychologists, with an R-like functional API. Part of the ANOVA Methods family (psystats, psymetrics, psyreport).

Free and open (MIT). Results print R-style summaries and render to APA-7 through psyreport.report().

Install

pip install psymetrics

What's inside

Reliability — alpha (Cronbach's alpha with the Feldt confidence interval, corrected item-total correlations, alpha-if-dropped, reverse keying), like psych::alpha.

Factorability — kmo (Kaiser-Meyer-Olkin, overall and per item) and bartlett (test of sphericity).

Exploratory factor analysis — efa with selectable estimator (minres, ml, principal) and rotation (varimax, promax, oblimin, quartimax, ...); returns loadings, communalities, eigenvalues, variance explained, and the factor correlation matrix for oblique rotations.

Confirmatory factor analysis and SEM — cfa using lavaan-style syntax; returns standardized loadings and the usual fit indices (χ², df, p, CFI, TLI, RMSEA).

Example

import pandas as pd
from psymetrics import alpha, kmo, efa, cfa

df = pd.read_csv("scale.csv")
items = df[[f"q{i}" for i in range(1, 11)]]

print(alpha(items))                 # like psych::alpha
print(kmo(items))                   # sampling adequacy
print(efa(items, 3, method="minres", rotation="promax"))

model = """
visual  =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed   =~ x7 + x8 + x9
"""
print(cfa(model, df))               # lavaan-style CFA

EFA is validated against factor_analyzer and CFA fit indices against semopy.

Note: factor_analyzer (0.5.x) requires scikit-learn < 1.6; this pin is declared as a dependency so efa works out of the box.

Metadata

Release files for psymetrics 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for psymetrics 0.1.0
File Size Uploaded Provenance Actions
psymetrics-0.1.0.tar.gz 7.2 kB Without provenance Details for psymetrics-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for psymetrics 0.1.0
File Interpreter ABI Platform Actions
psymetrics-0.1.0-py3-none-any.whl Python 3 none any Details for psymetrics-0.1.0-py3-none-any.whl

Total release size: 14.6 kB

Release files / psymetrics-0.1.0.tar.gz

Download URL psymetrics-0.1.0.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a88f58259e38aac6e98c995a75d6594d727e0b44f0de954f7110275a2a9e2ae4
BLAKE2b-256 checksum
How to use checksums
b29f0324b0fab07461d121eac4df7c8a43648c0e4084dd2ec52838d41cd48b87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / psymetrics-0.1.0-py3-none-any.whl

Download URL psymetrics-0.1.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c7e18e582b08c08e6140442158c42004717710fb4373cfe33465d9bf2e30980
BLAKE2b-256 checksum
How to use checksums
050d611efe72c0fd44dbe4e5349e829f7ec98b375251746f2098a6581ec08b20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Security for psymetrics 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page