# danielpyds/easy-statistics architecture

> Architecture diagram of the GitHub repository danielpyds/easy-statistics, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/danielpyds/easy-statistics
- Repository: https://github.com/danielpyds/easy-statistics

## Overview

#### Purpose and execution

Easy Statistics is a local Windows-oriented Python desktop application for introductory dataset exploration and OLS linear regression. It is started directly with `python main.py`; releases may package this entry point as `EasyStatistics.exe`. There is no server, database, or web/API layer.

- Application entry/UI orchestration: `main.py`
- Analysis and UI-support logic: `funciones.py`

#### Desktop UI and application state

`main.py` provides the Tkinter graphical interface: dataset import, navigation to data/description/regression views, selection of dependent and explanatory variables, and presentation of results. The loaded dataset is application state shared across enabled views; analysis actions depend on a successful import.

- Tkinter application and event handlers: `main.py`
- Shared data/analysis operations: `funciones.py`

#### Dataset ingestion boundary

The import workflow accepts local `.xlsx`, `.csv`, and Stata `.dta` files. pandas is the boundary between external files and the in-memory tabular dataset. After loading, the UI exposes row/column counts and available column names, then enables exploration and modeling actions.

- Import-triggering UI: `main.py`
- File-reading/dataframe functions: `funciones.py`

#### Data exploration stage

The application renders the full pandas dataframe in a spreadsheet-like view and derives dataset metadata and descriptive statistics for inspection. This stage operates on the imported dataframe before any regression is requested.

- Data and description views: `main.py`
- Dataframe inspection/statistics logic: `funciones.py`

#### Regression pipeline

A user chooses one dependent variable (Y) and one or more explanatory variables (X). The selected dataframe columns are passed to statsmodels OLS, producing coefficient estimates, standard errors, p-values, R², and the model summary for the results view. Missing-value validation is a known boundary: inputs are not automatically cleaned before modeling.

- Regression selection/results UI: `main.py`
- OLS construction and result extraction: `funciones.py`

#### Visualization outputs

Regression-derived and exploratory visualizations are generated with matplotlib/seaborn: predicted-versus-observed values, residual histogram, and variable correlation matrix. These plots are presentation outputs embedded or displayed from the desktop workflow rather than persisted analytics artifacts.

- Plot invocation/display integration: `main.py`
- Plot and correlation generation: `funciones.py`

#### Runtime and dependencies

The runtime is Python 3.10+ with Tkinter for desktop UI, pandas for data handling, statsmodels for OLS, and matplotlib/seaborn for charts. Dependency installation is defined in `requirements.txt`; PyInstaller is the intended Windows executable packaging mechanism.

- Python dependency manifest: `requirements.txt`
- Runtime entry point: `main.py`

Main entry points: [`main.py`](https://github.com/danielpyds/easy-statistics/blob/main/main.py) (Tkinter UI), [`funciones.py`](https://github.com/danielpyds/easy-statistics/blob/main/funciones.py) (OLS analysis), [`requirements.txt`](https://github.com/danielpyds/easy-statistics/blob/main/requirements.txt) (Dependencies)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop application"]
  node_entry["Application entry<br/>Python entry point<br/>[main.py]"]
  node_ui["Tkinter UI<br/>desktop UI<br/>[main.py]"]
  node_shared_state[("Loaded dataset state<br/>in-memory dataframe<br/>[main.py]")]
  node_import_ui["Import workflow<br/>UI handler<br/>[main.py]"]
  node_exploration_ui["Data and description views<br/>UI views<br/>[main.py]"]
  node_regression_ui["Regression views<br/>UI views<br/>[main.py]"]
  node_plot_ui["Plot display<br/>UI integration<br/>[main.py]"]
end

subgraph group_analysis["Analysis pipeline"]
  node_data_io["Dataset readers<br/>pandas I/O<br/>[funciones.py]"]
  node_inspection["Inspection and statistics<br/>dataframe analysis<br/>[funciones.py]"]
  node_ols["OLS analysis<br/>statsmodels regression<br/>[funciones.py]"]
  node_plots["Charts and correlation<br/>matplotlib / seaborn<br/>[funciones.py]"]
end

node_local_files["Local datasets"]
node_dependencies["Dependencies<br/>Python manifest<br/>[requirements.txt]"]

node_entry -->|"launches"| node_ui
node_dependencies -.->|"runtime packages"| node_entry
node_ui -->|"handles"| node_import_ui
node_ui -->|"navigates to"| node_exploration_ui
node_ui -->|"navigates to"| node_regression_ui
node_import_ui -->|"selects"| node_local_files
node_import_ui -->|"loads through"| node_data_io
node_data_io -->|"returns dataframe"| node_shared_state
node_shared_state -->|"supplies data"| node_exploration_ui
node_exploration_ui -->|"requests"| node_inspection
node_shared_state -->|"supplies columns"| node_regression_ui
node_regression_ui -->|"passes selected Y and X"| node_ols
node_ols -->|"results and summary"| node_regression_ui
node_shared_state -->|"provides data"| node_plots
node_ols -->|"provides predictions and residuals"| node_plots
node_plots -->|"renders"| node_plot_ui
node_ui -->|"displays"| node_plot_ui

click node_entry "https://github.com/danielpyds/easy-statistics/blob/main/main.py"
click node_ui "https://github.com/danielpyds/easy-statistics/blob/main/main.py"
click node_shared_state "https://github.com/danielpyds/easy-statistics/blob/main/main.py"
click node_import_ui "https://github.com/danielpyds/easy-statistics/blob/main/main.py"
click node_exploration_ui "https://github.com/danielpyds/easy-statistics/blob/main/main.py"
click node_regression_ui "https://github.com/danielpyds/easy-statistics/blob/main/main.py"
click node_plot_ui "https://github.com/danielpyds/easy-statistics/blob/main/main.py"
click node_data_io "https://github.com/danielpyds/easy-statistics/blob/main/funciones.py"
click node_inspection "https://github.com/danielpyds/easy-statistics/blob/main/funciones.py"
click node_ols "https://github.com/danielpyds/easy-statistics/blob/main/funciones.py"
click node_plots "https://github.com/danielpyds/easy-statistics/blob/main/funciones.py"
click node_dependencies "https://github.com/danielpyds/easy-statistics/blob/main/requirements.txt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_ui,node_shared_state,node_import_ui,node_exploration_ui,node_regression_ui,node_plot_ui toneBlue
class node_data_io,node_inspection,node_ols,node_plots toneAmber
class node_local_files,node_dependencies toneNeutral
```

## Components

### Desktop application

- [Application entry](https://github.com/danielpyds/easy-statistics/blob/main/main.py): Python entry point · Starts the local desktop application. · `main.py`
- [Tkinter UI](https://github.com/danielpyds/easy-statistics/blob/main/main.py): desktop UI · Coordinates import, navigation, selections, and result presentation. · `main.py`
- [Loaded dataset state](https://github.com/danielpyds/easy-statistics/blob/main/main.py): in-memory dataframe · Enables exploration and modeling after import. · `main.py`
- [Import workflow](https://github.com/danielpyds/easy-statistics/blob/main/main.py): UI handler · `main.py`
- [Data and description views](https://github.com/danielpyds/easy-statistics/blob/main/main.py): UI views · `main.py`
- [Regression views](https://github.com/danielpyds/easy-statistics/blob/main/main.py): UI views · Collects Y and X selections and presents OLS results. · `main.py`
- [Plot display](https://github.com/danielpyds/easy-statistics/blob/main/main.py): UI integration · `main.py`

### Analysis pipeline

- [Dataset readers](https://github.com/danielpyds/easy-statistics/blob/main/funciones.py): pandas I/O · Loads supported files into a dataframe. · `funciones.py`
- [Inspection and statistics](https://github.com/danielpyds/easy-statistics/blob/main/funciones.py): dataframe analysis · Derives metadata and descriptive statistics. · `funciones.py`
- [OLS analysis](https://github.com/danielpyds/easy-statistics/blob/main/funciones.py): statsmodels regression · Builds OLS models and extracts estimates, diagnostics, and summaries. · `funciones.py`
- [Charts and correlation](https://github.com/danielpyds/easy-statistics/blob/main/funciones.py): matplotlib / seaborn · Generates exploratory and regression visualizations. · `funciones.py`

### Other components

- **Local datasets**: xlsx / csv / dta files
- [Dependencies](https://github.com/danielpyds/easy-statistics/blob/main/requirements.txt): Python manifest · Defines the desktop and analysis runtime packages. · `requirements.txt`

## Connections

- Application entry → Tkinter UI: launches
- Dependencies → Application entry: runtime packages
- Tkinter UI → Import workflow: handles
- Tkinter UI → Data and description views: navigates to
- Tkinter UI → Regression views: navigates to
- Import workflow → Local datasets: selects
- Import workflow → Dataset readers: loads through
- Dataset readers → Loaded dataset state: returns dataframe
- Loaded dataset state → Data and description views: supplies data
- Data and description views → Inspection and statistics: requests
- Loaded dataset state → Regression views: supplies columns
- Regression views → OLS analysis: passes selected Y and X · Missing values are not automatically cleaned.
- OLS analysis → Regression views: results and summary
- Loaded dataset state → Charts and correlation: provides data
- OLS analysis → Charts and correlation: provides predictions and residuals
- Charts and correlation → Plot display: renders
- Tkinter UI → Plot display: displays
