Statistical Group Comparison Tool
Project description
📊 Data Analysis Toolkit
Automated comparative analysis tool for group data, supporting intelligent statistical tests for two/multiple groups with standardized output tables.
⚙️ Installation
pip install CBCgrpspy
📖 Parameter Specifications
| Parameter | Type | Default | Description |
|---|---|---|---|
df_path |
str |
Required | Data file path (.xlsx/.csv supported) |
label_series |
str |
"label" | Target label column name (must specify if no "label" column exists) |
skewvaranalysis |
list |
None | Manually specified categorical variables |
norm_rd |
int |
2 | Decimal places for normal distributions (Mean ± SD format) |
sk_rd |
int |
2 | Decimal places for non-normal distributions (Median (IQR) format) |
cat_rd |
int |
0 | Decimal places for categorical variable percentages |
pnormtest |
float |
0.05 | Significance threshold for normality tests |
phomogeneity |
float |
0.05 | Significance threshold for homogeneity of variance tests |
extractp |
float |
0.05 | Threshold for identifying significant variables |
minfactorlevels |
int |
10 | Maximum categorical levels (variables exceeding this become continuous) |
showstatistic |
bool |
True | Whether to display statistical values in output |
🚀 Core Features
1. Two-Group Comparison (Binary Groups)
- Use Cases: Control vs Treatment, Male vs Female, etc.
- Statistical Methods:
- 📌 Continuous variables: Auto-select T-test / Mann-Whitney U test
- 📌 Categorical variables: Auto-select Chi-square / Fisher's exact test
- Output:
- Standardized comparison table
- Flagged significant variables (p < extractp)
2. Multi-Group Comparison (≥3 Groups)
- Use Cases: Age stratification, multiple treatment protocols, etc.
- Statistical Methods:
- 📌 Continuous variables: ANOVA / Kruskal-Wallis test
- 📌 Categorical variables: Chi-square / Monte Carlo Fisher simulation
- Output:
- Multi-dimensional group comparison summary
- Subgroup difference indicators
🎯 Quick Start Example
from CBCgrpspy import dataAnalysis
result = dataAnalysis(
df_path="analysis.xlsx",
label_series="label",
norm_rd=2,
sk_rd=2,
cat_rd=0,
pnormtest=0.05,
extractp=0.05,
phomogeneity=0.05,
maxfactorlevels=10,
showstatistic=True
)
print(result["comparison_table"]) # Output comparison matrix
print(result["significant_vars"]) # List of significant variables
📌 Important Notes
- Ensure the first row contains column headers
- Convert categorical variables to string type beforehand
- Recommended for use with Jupyter Notebook for optimal table rendering
- This package has currently only been tested on Windows 10/11 systems. Compatibility with macOS and Linux systems has not been verified.
💡 Pro Tip: Adjust
*_rdparameters to control decimal precision. Useshowstatistic=Falsefor simplified outputs.
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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 cbcgrpspy-0.3-py3-none-any.whl.
File metadata
- Download URL: cbcgrpspy-0.3-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85de9259aa764ae57879e4cf589f8ffe44b9da44dcb7970423e5dec78635fba5
|
|
| MD5 |
bc51a44cab0fd0dc676b215d44faa32d
|
|
| BLAKE2b-256 |
59630abc2403df217baed81d7bbe205db2f811354643e76998017604392e77b2
|