akua-hawa-package 1.1.0
AHM Analytical Package: OLS, SEM, Diagnostics, Visualization, Model Comparison
Requires Python: >=3.9

# Akua Hawa Package (AHM Analytical Package)

**Version:** 1.1.0  
**Author:** Francis Jemisiham Amofa  
**License:** MIT  
**GitHub:** [https://github.com/yourusername/akua_hawa_package](https://github.com/yourusername/akua_hawa_package)

---
Table of Contents

Overview 
Installation

Quick Start / Usage

Function Categories

Advanced Examples

License

## Overview

The **Akua Hawa Package** (`akua_hawa_package`) is a comprehensive Python library designed for advanced analytical workflows in social sciences, behavioral research, and business analytics. It integrates **AHM modeling**, **OLS regression**, **SEM (Structural Equation Modeling)**, **diagnostics**, and **visualization** tools into a single, easy-to-use package.  

This package is especially useful for researchers who want **robust model comparison, coefficient analysis, effect size computation, and visualization** without juggling multiple libraries.

---

## Features

### 1. **AHM Modeling**
- Forward, backward, and difference coefficient calculations.
- Partial effects and cumulative effects.
- Probability distributions and temporal dynamics.
- Sensitivity analysis and clustering of predictors.
- Variance decomposition and outlier detection.

### 2. **OLS Regression**
- Fit models, extract coefficients, confidence intervals, and p-values.
- Residuals analysis, standardized and studentized residuals.
- Diagnostic tests: Shapiro-Wilk, Kolmogorov-Smirnov, Anderson-Darling.
- Multicollinearity checks (VIF, Tolerance).
- Effect sizes (Cohen's f², Amofa Adjusted f²).
- Prediction and visualization functions.

### 3. **SEM (Structural Equation Modeling)**
- Fit SEM models using `semopy`.
- Compute direct, indirect, and total effects.
- Residual diagnostics: Q-Q plots, histograms, skewness, kurtosis.
- Effect sizes (F², Amofa Adjusted F²).
- Bootstrap confidence intervals.
- Path visualization, heatmaps, and correlation matrices.

### 4. **Model Comparison & Visualization**
- Compare AHM, OLS, and SEM models.
- Residuals distribution comparison.
- R², F², and adjusted effect sizes.
- Radar plots, temporal dynamics plots, coefficient CI overlays.
- Predictor sensitivity heatmaps.

### 5. **Descriptive Statistics & Data Exploration**
- Mean, median, standard deviation, min, max.
- Skewness and kurtosis.
- Normality tests: Shapiro-Wilk, KS, Anderson-Darling.
- Histograms, Q-Q plots, boxplots for outliers.
- Correlation matrices and heatmaps.

---

## Installation

You can install the package directly from **PyPI** (once published):

```bash
pip install akua_hawa_package



Installation
pip install akua_hawa_package


Requirements: Python 3.9+, with the following packages:
numpy, pandas, matplotlib, seaborn, scipy, statsmodels, semopy, pingouin

Quick Start / Usage
# Import the package
import akua_hawa_package as ahm

# Load data
import pandas as pd
df = pd.read_csv("your_data.csv")

# Descriptive statistics
summary = ahm.show_data_summary(df)
print(summary)

# Fit OLS model
ols_model = ahm.ols_fit(df, dv_col="Y", iv_cols=["X1", "X2", "X3"])
print(ahm.ols_summary(ols_model))

# Fit SEM model
model_desc = """
Y ~ X1 + X2
X2 ~ X3
"""
sem_model = ahm.sem_fit(df, model_desc)
print(ahm.sem_summary(sem_model))

# Model comparison
comparison_table = ahm.compare_models_table(ahm_results=df, ols_model=ols_model, sem_model=sem_model)
print(comparison_table)

# Visualize coefficients
ahm.compare_models_plot(ahm_results=df, ols_model=ols_model, sem_model=sem_model)


This is the minimum workflow to quickly use the package for analysis, diagnostics, and visualization.

Function Categories

Data Summary & Descriptive Statistics: show_data_summary, show_skewness_kurtosis, shapiro_test …

Diagnostics & Multicollinearity: compute_vif, compute_tolerance, vif_plot …

OLS Regression: ols_fit, ols_summary, ols_coefficients, ols_r2 …

SEM Functions: sem_fit, sem_summary, sem_coefficients, sem_r2 …

Visualization: correlation_heatmap, ci_errorbar_plot, forward_backward_diff_plot …

Model Comparison: compare_models_table, compare_models_plot, effect_size_comparison_plot …

Advanced Examples

Running temporal dynamics analysis:

ahm.temporal_dynamics_plot(df_results, time_col="Time")


Running sensitivity heatmaps:

ahm.predictor_sensitivity_heatmap(df_results)


All-in-one dashboard for full model summary:

ahm.all_in_one_dashboard(df, ahm_results=df, ols_model=ols_model, sem_model=sem_model)

License

This project is licensed under the MIT License. See the LICENSE file for details.