Skip to main content

A minimal linear regression pipeline providing six functions for data inspection, type adjustment, listwise cleaning, OLS fitting, parameter export, and diagnostics.

Reason this release was yanked:

New updated Version available

Project description

📘 README.md (End-User Version — Clean & Professional)

C2REGbase

C2REGbase provides a simple and structured workflow for running linear regression using six clear steps.
It is designed for analysts who want a clean, consistent, and reproducible regression process without the complexity of full statistical frameworks.

The library performs:

  1. Variable inspection
  2. Type adjustments
  3. Missing-value summary and listwise deletion
  4. Ordinary Least Squares (OLS) regression
  5. Export of parameter estimates in a dataset-friendly format
  6. Diagnostics including standard errors, t-values, p-values, and confidence intervals

🔧 Installation

Install from PyPI:

pip install C2REGbase


🚀 Quick Example

from C2REGbase import (
    inspect_variables,
    adjust_variable_types,
    summarize_missing_listwise,
    fit_ols,
    export_outest,
    compute_diagnostics
)
import pandas as pd
import numpy as np

# Sample dataset
df = pd.DataFrame({
    "bweight": np.random.normal(3000, 600, size=200),
    "matage": np.random.randint(18, 40, size=200),
    "ht": np.random.choice(["yes", "no"], size=200),
    "sex": np.random.choice(["male", "female"], size=200)
})

# Step 1: Inspect structure
inspect_variables(df)

# Step 2: Adjust variable types
df = adjust_variable_types(df, {"ht": "category", "sex": "category"})

# Step 3: Missing-value summary & listwise deletion
df_clean, mv_summary = summarize_missing_listwise(
    df, ["bweight", "matage", "ht", "sex"]
)

# Step 4: Fit OLS model
results, stats = fit_ols(
    df_clean,
    dependent="bweight",
    independents=["matage", "ht", "sex"]
)

# Step 5: Export parameter estimates (OUTEST-style)
outest_df = export_outest(results, dependent="bweight")

# Step 6: Compute diagnostics (stderr, t, p-value, CI)
diag_df = compute_diagnostics(results, alpha=0.05)

📘 Notes

  • C2REGbase does not perform automatic transformations (e.g., log, squared, interaction terms). Users should create any derived variables manually in their DataFrame before fitting.

  • Categorical variables are automatically dummy-encoded during regression.

  • The output includes:

    • ANOVA
    • RMSE
    • R² and Adjusted R²
    • Coefficient table
    • OUTEST-like export
    • Diagnostic table with confidence intervals

📄 License

C2REGbase is open-source under the MIT License.


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

c2regbase-0.1.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

c2regbase-0.1.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file c2regbase-0.1.1.tar.gz.

File metadata

  • Download URL: c2regbase-0.1.1.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for c2regbase-0.1.1.tar.gz
Algorithm Hash digest
SHA256 87a1316b83e9c3c9875fae645004fb64675aadfe9b23c0f4ccf104d72b6d9905
MD5 b53e7b3bc91374f1ca2a8d79ad7041a4
BLAKE2b-256 0001a859e9528b942f26b4a60654f673f60ff3a2164f0ecfa6c7417958c42168

See more details on using hashes here.

File details

Details for the file c2regbase-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: c2regbase-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for c2regbase-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d0c9c398341f4ea059185faf732b56fe5b65bc0e0ce6e5e60ec7b2214f061e94
MD5 bd064ca8acb5868aa4bc89190dcbfe2a
BLAKE2b-256 5d02289676c2bd6f84a45b1d5a12ff7cc93157c535c3562e88cad5a0dadf83de

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