Metadata-Version: 2.4
Name: psystats
Version: 0.1.0
Summary: Basic statistics and biostatistics for psychologists with an R-like API
Project-URL: Homepage, https://github.com/anovamethods/psy
Project-URL: Lab, https://labmm.org/
Project-URL: ORCID, https://orcid.org/0000-0001-5303-5782
Author-email: Luis Anunciacao <luisfca@gmail.com>
License-Expression: MIT
Keywords: biostatistics,psychology,regression,risk ratio,statistics,table1
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.10
Requires-Dist: numpy>=1.24
Requires-Dist: pandas>=2.0
Requires-Dist: scipy>=1.10
Requires-Dist: statsmodels>=0.14
Description-Content-Type: text/markdown

# 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

```bash
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

```python
import pandas as pd
from psystats import table1, corr_matrix, linreg, riskratio, attributable_risk

df = pd.read_csv("study.csv")

print(table1(df, group="condition"))            # auto t-test / chi-square / etc.
print(corr_matrix(df, ["age", "score", "rt"]))  # r with * significance stars
print(linreg(df, "score", ["age", "condition"]))

rr = riskratio(df, exposure="smoker", outcome="disease", exposed=1, positive=1)
ar = attributable_risk(df, exposure="smoker", outcome="disease",
                       exposed=1, positive=1)
print(rr); print(ar)
```

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