PyStatPower is an open-source Python library focused on power analysis in the field of statistics.
Main features: calculation of sample size and test power, and estimation of the required effect size
pip install pystatpower
from pystatpower.models import one_proportion
result = one_proportion.solve_for_sample_size(
alpha=0.05, power=0.80, nullproportion=0.80, proportion=0.95, alternative="two_sided", test_type="exact_test"
)
print(result)
Output:
Size(41.59499160228066)
-
Clone this repository
git clone https://github.com/Snoopy1866/pystatpower.git
-
Install dependencies
pip install .[docs]
-
Change to the documentation directory
cd docs
-
Build the documentation
make clean make html
You can view the generated documentation in the docs/build/html
directory by opening index.html
in your browser.