Skip to main content

Basic statistics and biostatistics for psychologists with an R-like API

Project description

psystats

Basic statistics and biostatistics for psychologists, with an R-like functional API. Part of the ANOVA Methods family (psystats, psymetrics, psyreport).

Free and open (MIT). Every function returns a result object that prints an R-style summary and can be handed to psyreport.report() for APA-7 output.

Install

pip install psystats

What's inside

Descriptives and tables — describe, freq, corr_matrix (correlation matrix with significance stars), and table1 (group comparison with automatic test selection by variable type and distribution).

Inferential tests with effect sizes — ttest (Cohen's d), anova (η² and ω²), chisq (Cramér's V).

Regression — linreg (OLS with standardized betas, R²/adjusted R², F test) and logreg (odds ratios with confidence intervals, McFadden pseudo-R²).

Risk factors — riskratio, oddsratio, and attributable_risk (risk difference with CI, attributable risk percent, population attributable risk and PAR%, number needed to treat).

Example

The package ships a real teaching dataset — depression and anxiety symptoms in 1,957 undergraduate students from Spain, Portugal, and Brazil (Afonso Junior et al., 2020, https://doi.org/10.1590/0102.3772e36412) — so every example runs as-is:

from psystats import load_mapfre, table1, anova, corr_matrix, linreg

df = load_mapfre()

print(table1(df, group="country",                # auto test per variable
             columns=["age", "sex", "bdi_sum", "bai_sum"]))
print(anova(df, "bdi_sum", "country"))           # depression across countries
print(corr_matrix(df, ["age", "bdi_sum", "bai_sum"]))
print(linreg(df, "bdi_sum", ["age", "bai_sum"])) # predict depression score

All estimates are validated in the test suite against scipy and statsmodels.

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

psystats-0.1.1.tar.gz (75.4 kB view details)

Uploaded Source

Built Distribution

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

psystats-0.1.1-py3-none-any.whl (75.6 kB view details)

Uploaded Python 3

File details

Details for the file psystats-0.1.1.tar.gz.

File metadata

  • Download URL: psystats-0.1.1.tar.gz
  • Upload date:
  • Size: 75.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for psystats-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e24b327bda18f5d21181156e46e30ceabeb63f81c04b9828fffcfeaf465dff60
MD5 fcca5959c26ec184a8580e3ed2c8ba2c
BLAKE2b-256 a313f79cd0479f9d2bcbead64969c0f76b585879994dd3d974bb18e50c0f5b69

See more details on using hashes here.

Provenance

The following attestation bundles were made for psystats-0.1.1.tar.gz:

Publisher: publish.yml on anovabr/anova-methods

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file psystats-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: psystats-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 75.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for psystats-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b8d4c1a63df59e2c0d0d9e3ebd0a966fca0ba06100b851d3611dcf3e3141de0f
MD5 3adecfb6c7b93aaadfa67f39320030e4
BLAKE2b-256 adf623043e4e6d352c97f61b031823231c33e65d527a6262852be93f645fd08b

See more details on using hashes here.

Provenance

The following attestation bundles were made for psystats-0.1.1-py3-none-any.whl:

Publisher: publish.yml on anovabr/anova-methods

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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