Stats Package
A comprehensive Python package for statistical analysis, providing functions for hypothesis testing, confidence intervals, regression analysis, and more.
Features
- Descriptive Statistics: Basic statistics, z-score conversions, and percentile calculations
- Standard Error Calculations: For means, proportions, and their differences
- Critical Values: Calculate critical values for hypothesis testing
- Confidence Intervals: For means and proportions
- Sample Size Calculations: Determine required sample sizes for studies
- Hypothesis Testing: Single-sample and two-sample tests for means and proportions
- Regression Analysis: Linear regression with confidence intervals and predictions
- Probability Calculations: Central Limit Theorem applications
- Inverse Calculations: Solve for various statistical parameters
Installation
pip install stats211
Quick Start
from stats import *
# Hypothesis testing
test_mean(0, 3.1, 1.3, 18)
# Confidence intervals
ci_mean(3.1, 1.3, 18, 0.95)
# Two-sample tests
test_two_means(1610, 129.8, 18.906, 1929, 127.07, 21.975, equal_var=True, alpha=0.13)
# Sample size calculations
sample_size_mean(0.9, 11.71, 0.84)
# Get help
stats_help()
Module Organization
The package is organized into the following modules:
utils: Color printing and file I/O utilitiesdescriptive: Basic statistics and z-score conversionsstandard_error: Standard error calculationscritical_values: Critical value functionsconfidence_intervals: Confidence interval calculationssample_size: Sample size calculationshypothesis_testing: Single-sample hypothesis teststwo_sample: Two-sample hypothesis testsregression: Linear regression functionsprobability: Probability calculations (CLT)inverse: Inverse calculations
Usage Examples
Hypothesis Testing
from stats import test_mean, test_proportion
# Test a mean
test_mean(0, 3.1, 1.3, 18)
# Test a proportion
test_proportion(0.03, 0.04, 500, tail='right')
Confidence Intervals
from stats import ci_mean, ci_proportion
# Confidence interval for mean
ci_mean(3.1, 1.3, 18, 0.95)
# Confidence interval for proportion
ci_proportion(0.5, 100, 0.95)
Two-Sample Tests
from stats import test_two_means, test_two_proportions
# Two-sample t-test
test_two_means(1610, 129.8, 18.906, 1929, 127.07, 21.975, equal_var=True, alpha=0.13)
# Two-sample proportion test
test_two_proportions(314, 59, 319, 101)
Regression Analysis
from stats import slope_test, linregress_ci
# Test slope
slope_test(1.57, 0.606, 170, 0.05, 'two')
# Confidence interval for regression
linregress_ci(slope, se_slope, n, confidence=0.95)
Requirements
- Python >= 3.8
- numpy >= 1.20.0
- pandas >= 1.3.0
- scipy >= 1.7.0
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Author
Isaac Lagoy
Metadata
Release files for stats211 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stats211-0.1.4.tar.gz | 16.9 kB | Without provenance | Details for stats211-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stats211-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for stats211-0.1.4-py3-none-any.whl |
Total release size: 37.7 kB
Release files / stats211-0.1.4.tar.gz
| Download URL | stats211-0.1.4.tar.gz |
|---|---|
| Size | 16.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28c9dc0fc58a7d58e0ffe9094797ae8b94d7a6a09dc64655c5668b4b14b69c02
|
|
BLAKE2b-256 checksum How to use checksums |
79dd9a83943ced1383b6f7c90cd82772fe5550aaeecf8caf65e39a306809845b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.4
|
Release files / stats211-0.1.4-py3-none-any.whl
| Download URL | stats211-0.1.4-py3-none-any.whl |
|---|---|
| Size | 20.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
340101c1410085f9bfc326574af44738145ef8f7a62abcf63938091a1e6c315d
|
|
BLAKE2b-256 checksum How to use checksums |
395616022ab61c457caf00634e534212c823fbcba1dfc2d8df250ecbebc79f8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.4
|
Security for stats211 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.