A comprehensive Python package for calculating sample sizes for various statistical tests including A/B tests, margin analysis, and log-normal distributions
Project description
Sample Size Calculator
A comprehensive Python package for calculating sample sizes for various statistical tests including A/B tests, margin analysis, and log-normal distributions.
Installation
From PyPI (Public)
pip install sample-size-calculator
From GitHub Packages (Private)
# First, create a .netrc file with your GitHub token
echo "machine npm.pkg.github.com login __token__ password pypi-AgEIcHlwaS5vcmcCJDkxMTRhZThjLWY1NmMtNDcxYS1iODczLWQ3OGY4YWE3OWMxZgACKlszLCI2ZjgyNTM2Mi1hNDM4LTQyZTItOTAyMy05NjlkOWMzZmM4OTEiXQAABiCeXzvlesH92aynC9VaDnKJIaRYYy30Fw9QgBJwKBFoPw" > ~/.netrc
chmod 600 ~/.netrc
# Then install the package
pip install sample-size-calculator --index-url https://npm.pkg.github.com/
Quick Start
from sample_size_calculator import calculate_ab_test_sample_size
# Calculate sample size for A/B test
sample_size = calculate_ab_test_sample_size(
baseline_ctr=0.0375, # 3.75% baseline CTR
uplift_pct=5, # 5% relative uplift
power=0.8
)
print(f"Required sample size per group: {sample_size}")
Features
- A/B Test Sample Size calculations
- Margin analysis and uplift detection
- Log-normal distribution sample sizes
- Test result analysis with p-values and confidence intervals
- Margin distribution visualization
Documentation
See the full documentation for detailed API reference and examples.
Project details
Release history Release notifications | RSS feed
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 sample_size_calculator-1.0.0.tar.gz.
File metadata
- Download URL: sample_size_calculator-1.0.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.12.4 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bbfbc59144e655fe8fe3af2f9d63736bf0847400424ecb78aeb7913692f8c23
|
|
| MD5 |
d3ed71877d915c2cdfcb7d19a65a0c23
|
|
| BLAKE2b-256 |
fa6e7dffdcb960bc155fac66a11a6469aeb4ac43da09c95bf8926dfed71c1944
|
File details
Details for the file sample_size_calculator-1.0.0-py3-none-any.whl.
File metadata
- Download URL: sample_size_calculator-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.12.4 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2de4c9e0daecaa1dccf2fdf3a948adbaaa418239007daf2f495f14e6cf464eb3
|
|
| MD5 |
aea70b5edc117b6971802a1fa11b183d
|
|
| BLAKE2b-256 |
8719e9cdda2ca84ba240758371ceea4b21c061e6961f39899fa7145ab8f2fe6b
|