pystatpower
0.0.3
Simplified Chinese | English
pystatpower is an open source Python library focusing on power analysis in the field of statistics.
Main functions: calculation of sample size and test power, and estimation of required effect size under given parameters.
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 repository
git clone https://github.com/Snoopy1866/pystatpower.gitInstall dependencies
pip install .[docs]Install pre-commit
pre-commit install
pre-commit install --hook-type commit-msgSwitch to the document directory
cd docsBuild documentation
make clean
make html You can see the generated documentation in the docs/build/html directory and double-click index.html to view it in the browser.