Skip to main content

A python module implementing power analysis to estimate sample size

Project description

sample-size

This python project is a helper package that uses power analysis to calculate required sample size for any experiment.

Script Usage Guide

Sample size script lets you get the sample size estimation easily by providing metric inputs.

Requirements

Please make sure you have Python 3 installed before using the script.

Verify Python was installed

python -V # python version should >=3.7.1, <3.11

Verify pip was installed

pip -V 

Install the package

pip install sample-size
pip show sample-size # verify package was installed

Start using the script

run-sample-size will prompt required questions for you to enter the input it needs

run-sample-size

Script Constraints

  • This package supports

    • Single and multiple metrics per calculation
    • Multiple cohorts, i.e. more than one treatment variant, per calculation
    • Metric types: Boolean, Numeric, and Ratio
  • Default statistical power (80%) is used in run-sample-size all the time

  • Input constraints

    • alpha: (0, 0.4]
    • probability (Boolean Metric): (0, 1)
    • variance (Numeric and Ratio Metrics): [0, )
    • registered metrics: [1, ]
    • variants: [2, ]

    Please be aware that we are running simulations many times when calculating sample size for multiple metrics or variants. Therefore, too many cohorts or metrics will have extremely long runtime.

Contributing

All contributors and contributions are welcome! Please see the contributing docs for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sample-size-2.0.2.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sample_size-2.0.2-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file sample-size-2.0.2.tar.gz.

File metadata

  • Download URL: sample-size-2.0.2.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.7.13 Linux/5.15.0-1019-azure

File hashes

Hashes for sample-size-2.0.2.tar.gz
Algorithm Hash digest
SHA256 b97c4c12077f63b647a70b47a3089501e7f8855f7808b6fc556c0396446d2c29
MD5 c45555ee8b25f41a07ec0e7a0e3a0ca0
BLAKE2b-256 bc97b0a3ea5c733e3de4aa5e4d08dd74ebdebbd2a92b7d23a4c65eba3e5eea56

See more details on using hashes here.

File details

Details for the file sample_size-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: sample_size-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.7.13 Linux/5.15.0-1019-azure

File hashes

Hashes for sample_size-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 56b4bb797b494b42f805dea3ae59c14cb178cd4bb8c702ebd825d9040d772ceb
MD5 65881afd2f08154d6564b5cfe7cb4ef8
BLAKE2b-256 8b7dac9cf3a1eac5325ab1eeac5fcf58d8e6b81a3796977a2e1ac76704e7146c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page