exactpower
Free core of ExactPower: exact power of Fisher's exact test for a planned 2x2 study.
The problem You are planning a study with two groups and a yes/no outcome, and you need to pick a sample size before you collect data. The usual power calculators use approximations that drift exactly where small samples matter most. Search terms: exact power Fisher test Python, sample size Fisher exact test, power analysis 2x2 Python.
What it does
exact_power_fisher(n1, n2, p1, p2) computes the exact rejection probability of the two-sided Fisher exact test under your planned design. Give it the group sizes and the event rates you expect, and it enumerates every possible outcome. No approximation, no simulation. The free version handles n1 + n2 up to 1000.
Limits Free version: two-sided power only, n1 + n2 <= 1000. Larger studies are refused outright instead of hanging. No sample-size inversion, no Monte Carlo power estimator, no plots, no CLI.
Install
pip install exactpower
Needs Python 3.9 or newer, NumPy, and SciPy.
from exactpower import exact_power_fisher
print(exact_power_fisher(60, 60, 0.55, 0.30))
This is the free core: two-sided exact power for a planned 2x2 design, capped at n1 + n2 <= 1000. The full version ($30, one-time) goes to n1 + n2 = 5000 and adds sample-size inversion, Monte Carlo power for r-by-c tables, and one-sided power: https://groundplane0.gumroad.com/l/tyevqe
Metadata
Release files for exactpower 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| exactpower-0.1.0.tar.gz | 7.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| exactpower-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.4 kB
Release files / exactpower-0.1.0.tar.gz
| Download URL | exactpower-0.1.0.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f7917ca3f8a635cb078da645fe7124703d5d9211b53073a10b64f2b9fb8a53b1
|
|
BLAKE2b-256 checksum How to use checksums |
f7d59d542636d3e0718643fd86df222a8ccda4031b3860954ad71f660517de30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / exactpower-0.1.0-py3-none-any.whl
| Download URL | exactpower-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f59cedcb505ee07a544cc7467c3a09f3161589df681a39914697a23e515a30b
|
|
BLAKE2b-256 checksum How to use checksums |
3d1a93ff58af569c9320cab1b8c45274a689873da23dae3858dafdeb1333686f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|