Skip to main content

Effect size estimation and statistics library

Project description

ESEK — Effect Size Estimation Kit

ESEK is a Python library for computing and converting effect sizes across common statistical designs (t-tests, paired tests, non-parametric tests, proportions, and more).

⚠️ Work in progress
The API may change as statistical methods are being integrated.


Installation

pip install esek

Or install from source:

git clone https://github.com/nadavWeisler/esek.git
cd esek
pip install -e .

Requirements: Python ≥ 3.10, NumPy ≥ 2.0, SciPy ≥ 1.13, statsmodels ≥ 0.14


Quickstart

Effect Size Calculation

# Two independent groups (t-test)
from esek.calculators.two_independent_mean.two_independent_t import TwoIndependentTTests

result = TwoIndependentTTests.from_parameters(
    sample_mean_1=5.2,
    sample_mean_2=4.0,
    sample_sd_1=1.1,
    sample_sd_2=1.0,
    sample_size_1=30,
    sample_size_2=30,
    population_mean_diff=0,
    confidence_level=0.95,
)

print(result.cohens_d.value)           # Cohen's d
print(result.cohens_d.ci.lower)        # CI lower bound
print(result.cohens_d.ci.upper)        # CI upper bound
print(result.hedges_g.value)           # Hedges' g (bias-corrected)

Effect Size Conversion

from esek import EffectSizeConverter

# Convert Cohen's d to Pearson r
result = EffectSizeConverter.d_to_r(d=0.5, n1=30, n2=30)
print(result.output_value)   # → 0.243

# Convert d to odds ratio
or_result = EffectSizeConverter.d_to_odds_ratio(d=0.5)
print(or_result.output_value)  # → 2.477

# Fisher z transformation
z_result = EffectSizeConverter.r_to_fisher_z(r=0.6)
r_back = EffectSizeConverter.fisher_z_to_r(z_result.output_value)

Confidence Intervals

from esek.confidence_intervals import central_ci_one_sample, fisher_z_ci

# CI for Cohen's d (one-sample)
ci_low, ci_high, se = central_ci_one_sample(effect_size=0.5, sample_size=30, confidence_level=0.95)

# Fisher z CI for correlation
ci_low, ci_high = fisher_z_ci(r=0.6, n=50, confidence_level=0.95)

Supported Effect Sizes

Design Effect Sizes
One-sample t / z Cohen's d, Hedges' g, CLES
Two independent groups Cohen's d, Hedges' g, Glass's Δ, Ratio of Means, Cliff's delta, VDA, U1/U3
Two paired groups Cohen's dav, gav, drm, grm, rank-biserial, robust measures
Proportions Cohen's h, g, Phi, OR, RR, Cramer's V
Converters d↔r, d↔OR, r↔Fisher z, OR↔d

Interpretation Warning

Effect sizes are statistical summaries. They do not determine whether a finding is practically important — this judgment requires domain knowledge, study design context, and replication. Interpret them in context.


Testing

pytest
python -m compileall src/

Package Structure

src/esek/
    core/          ← exceptions, validation, type aliases
    results/       ← frozen dataclass result objects
    calculators/   ← statistical calculators (t, z, aparametric, proportions)
    converters/    ← effect size conversion functions
    confidence_intervals/  ← CI methods
    utils/         ← math helpers, distribution helpers

License

GPL-3.0

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

esek-0.1.32.tar.gz (144.2 kB view details)

Uploaded Source

Built Distribution

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

esek-0.1.32-py3-none-any.whl (174.8 kB view details)

Uploaded Python 3

File details

Details for the file esek-0.1.32.tar.gz.

File metadata

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

File hashes

Hashes for esek-0.1.32.tar.gz
Algorithm Hash digest
SHA256 da0fcad86ffdc46e97d4b58d8057a4e0ce36bdc0ca7314b195362138ff24fb3d
MD5 faf2d22f1fa858b5b0d641e987388a8c
BLAKE2b-256 e59d46b5410b92ff341e63ac780a470f5dc9d6ce5b70d92a8277c31980cf4b15

See more details on using hashes here.

Provenance

The following attestation bundles were made for esek-0.1.32.tar.gz:

Publisher: python-publish.yml on nadavWeisler/esek

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

File details

Details for the file esek-0.1.32-py3-none-any.whl.

File metadata

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

File hashes

Hashes for esek-0.1.32-py3-none-any.whl
Algorithm Hash digest
SHA256 c45a69433004e58a00b1603222947e4ca71d414d13aa4b0cec588beec02bbea0
MD5 aac62fee841a11db271f2a0dcaf4a09f
BLAKE2b-256 9d22130613bdf4d189f58cd2d1b96295c70d72852e7e30f17b1449b1c9c05e93

See more details on using hashes here.

Provenance

The following attestation bundles were made for esek-0.1.32-py3-none-any.whl:

Publisher: python-publish.yml on nadavWeisler/esek

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