Skip to main content

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

  1. Ensure the first row contains column headers
  2. Convert categorical variables to string type beforehand
  3. Recommended for use with Jupyter Notebook for optimal table rendering
  4. 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 *_rd parameters to control decimal precision. Use showstatistic=False for simplified outputs.

Project details


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

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

cbcgrpspy-0.3-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

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

Hashes for cbcgrpspy-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 85de9259aa764ae57879e4cf589f8ffe44b9da44dcb7970423e5dec78635fba5
MD5 bc51a44cab0fd0dc676b215d44faa32d
BLAKE2b-256 59630abc2403df217baed81d7bbe205db2f811354643e76998017604392e77b2

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