Comprehensive statistical functions for hypothesis testing, confidence intervals, regression, and more
Project description
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 stats-package
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
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
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 stats211-0.1.0.tar.gz.
File metadata
- Download URL: stats211-0.1.0.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd74a6235c89deed801c6601b884da1e23e7ac2265a8a4df1dcc11fb524e3901
|
|
| MD5 |
107065370ff4eb06ebac3904dac4062d
|
|
| BLAKE2b-256 |
4c1e84227cfdb5631f049faeb738226031231280dbcc70f87139807c76ad3b98
|
File details
Details for the file stats211-0.1.0-py3-none-any.whl.
File metadata
- Download URL: stats211-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26d42cef03f3982616eb1a8aef79f1d46df63749beedb1dbb2a0702a2c664351
|
|
| MD5 |
b886c87089141a0f212375fca974472b
|
|
| BLAKE2b-256 |
58f65a8d123d94e11bbd34d43ec2820c7db03d18911a2c5b5282be2b57ecf140
|