Metadata-Version: 2.4
Name: pystatpower
Version: 0.0.4
Summary: A Power Analysis Toolkit for Python
Author-email: Snoopy1866 <pystatpower@gmail.com>
License: GPL-3.0
Project-URL: Homepage, https://github.com/Snoopy1866/pystatpower
Project-URL: Documentation, https://github.com/Snoopy1866/pystatpower/blob/main/README.md
Project-URL: Repository, https://github.com/Snoopy1866/pystatpower.git
Project-URL: Issues, https://github.com/Snoopy1866/pystatpower/issues
Project-URL: Changelog, https://github.com/Snoopy1866/pystatpower/blob/main/CHANGELOG.md
Keywords: mathematics,statistics,power analysis,sample size,power,hypothesis
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: scipy>=1.16.0
Dynamic: license-file

# PyStatPower

[![PyPI - Version](https://img.shields.io/pypi/v/pystatpower)](https://badge.fury.io/py/pystatpower)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pystatpower)
![GitHub License](https://img.shields.io/github/license/Snoopy1866/pystatpower)
![PyPI - Status](https://img.shields.io/pypi/status/pystatpower)
[![PyPI Downloads](https://static.pepy.tech/badge/pystatpower)](https://pepy.tech/projects/pystatpower)

[![Build Status](https://img.shields.io/github/actions/workflow/status/Snoopy1866/pystatpower/release.yml?branch=main&label=build)](https://github.com/Snoopy1866/pystatpower/actions/workflows/release.yml?query=branch:main)
[![Test Status](https://img.shields.io/github/actions/workflow/status/Snoopy1866/pystatpower/check.yml?branch=main&label=test)](https://github.com/Snoopy1866/pystatpower/actions/workflows/check.yml?query=branch:main)
[![Documentation Status](https://readthedocs.org/projects/pystatpower/badge/?version=latest)](https://pystatpower.readthedocs.io/zh-cn/latest/?badge=latest)
[![codecov](https://codecov.io/gh/Snoopy1866/pystatpower/graph/badge.svg?token=P9UWC8Q4P6)](https://codecov.io/gh/Snoopy1866/pystatpower)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Snoopy1866/pystatpower/main.svg)](https://results.pre-commit.ci/latest/github/Snoopy1866/pystatpower/main)

[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![pytest](https://img.shields.io/badge/logo-pytest-blue?logo=pytest&labelColor=5c5c5c&label=%20)](https://github.com/pytest-dev/pytest)

PyStatPower 是一个专注于统计领域功效分析的开源的 Python 库。

## 安装

```bash
pip install pystatpower
```

## 使用示例

```python
from pystatpower.models import proportion

size = proportion.independent.noninferiority.size(
    alpha=0.025,
    power=0.8,
    treatment_proportion=0.95,
    reference_proportion=0.90,
    margin=-0.10,
)
print(size)
```

输出:

```python
(47.96537615435558, 47.96537615435558)
```

详细用法请查看 [API](./docs/api/index.md)。

## 鸣谢

- [scipy](https://github.com/scipy/scipy)
- [pingouin](https://github.com/raphaelvallat/pingouin)
