Ezpwr
Ezpwr is a Python package for statistical power analysis that allows users to estimate sample size, test power, and effect size.
简体中文 | English
🗺️ Feature List & Roadmap: To see currently supported statistical models and planned features, check out roadmap.
📦 Installation
Prerequisites: Python 3.10+
pip install ezpwr
🚀 Usage Examples
Sample Size Estimation
-
Single Proportion Confidence Interval
from ezpwr import proportion size = proportion.single.ci.solve_size( proportion=0.9, distance=0.10, conf_level=0.95, interval_type="two-sided", ) print(size) # output: 158
-
Single Proportion Inequality Test
from ezpwr import proportion size = proportion.single.inequality.solve_size( null_proportion=0.80, proportion=0.95, alternative="one-sided", alpha=0.025, power=0.8, ) print(size) # output: 42
-
Two Independent Proportions Non-Inferiority Test
from ezpwr import proportion size = proportion.independent.noninferiority.solve_size( treatment_proportion=0.95, reference_proportion=0.90, margin=-0.10, ratio=1, alpha=0.025, power=0.8, ) print(size) # output: (48, 48)
-
Two Independent Means Superiority Test
from ezpwr import mean size = mean.independent.superiority.solve_size( diff=0.5, margin=0.1, treatment_std=1.2, reference_std=1.2, ratio=2, alpha=0.025, power=0.8, ) print(size) # output: (214, 107)
Statistical Power Calculation
from ezpwr import proportion
power = proportion.independent.noninferiority.solve_power(
treatment_proportion=0.95,
reference_proportion=0.90,
margin=-0.10,
treatment_size=48,
reference_size=48,
alpha=0.025,
)
print(power)
# output: 0.800282915718918
Effect Size Solving
from ezpwr import proportion
treatment_proportion = proportion.independent.noninferiority.solve_treatment_proportion(
reference_proportion=0.90,
margin=-0.10,
treatment_size=48,
reference_size=48,
alpha=0.025,
power=0.8,
)
print(treatment_proportion)
# output: 0.9499637015276098
🧪 Compatibility Matrix
| 🐍 3.10 | 🐍 3.11 | 🐍 3.12 | 🐍 3.13 | 🐍 3.14 | |
|---|---|---|---|---|---|
| SciPy 1.7 | ✅ | - | - | - | - |
| SciPy 1.8 | ✅ | - | - | - | - |
| SciPy 1.9 | ✅ | - | - | - | - |
| SciPy 1.10 | ✅ | ✅ | - | - | - |
| SciPy 1.11 | ✅ | ✅ | ✅ | - | - |
| SciPy 1.12 | ✅ | ✅ | ✅ | - | - |
| SciPy 1.13 | ✅ | ✅ | ✅ | - | - |
| SciPy 1.14 | ✅ | ✅ | ✅ | - | - |
| SciPy 1.15 | ✅ | ✅ | ✅ | ✅ | - |
| SciPy 1.16 | - | ✅ | ✅ | ✅ | ✅ |
| SciPy 1.17 | - | ✅ | ✅ | ✅ | ✅ |
| SciPy 1.18 | - | - | ✅ | ✅ | ✅ |
[!NOTE]
-: This combination of Python and SciPy does not exist.
✨ Contributing
Issues and pull requests are welcome and highly appreciated. To get started, check out the contributing guidelines.
🤝 Acknowledgments
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ezpwr-0.0.8.tar.gz.
File metadata
- Download URL: ezpwr-0.0.8.tar.gz
- Upload date:
- Size: 54.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6178310564f70f187fff9317d92a2402730c45f2f4fd942c69500064757e578d
|
|
| MD5 |
0d59a34016e150adc48eb7f49b22c62e
|
|
| BLAKE2b-256 |
1e93573f9aa00c41a87b2b8bdfb0d598f624506d41ac311b95cb3a446c0c16a9
|
File details
Details for the file ezpwr-0.0.8-py3-none-any.whl.
File metadata
- Download URL: ezpwr-0.0.8-py3-none-any.whl
- Upload date:
- Size: 77.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3e30bada156ed28c48c6521d7dd3793180bcd6a539d751adac1896495024b9d
|
|
| MD5 |
9f844532df0ba1c441307dfcadb737da
|
|
| BLAKE2b-256 |
2d77b4fd3de8ae38ff33f108e5f7b6d6bd20ea9de719cc717165b6e6a78df129
|