# cse545-bda/hypothesis_testing architecture

> Architecture diagram of the GitHub repository cse545-bda/hypothesis_testing, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cse545-bda/hypothesis_testing
- Repository: https://github.com/cse545-bda/hypothesis_testing

## Overview

This repository analyzes U.S. Census block-group income and population data to compare income-per-capita trends for the bottom 40% with overall trends. The main workflow reads exported JSON from HDFS, filters incomplete geographic histories, and reports three hypothesis-test results. Separate preliminary scripts estimate bottom-40% income and produce comparisons. The graph reflects the excerpts and README; internal steps are grouped by responsibility, and no unsampled implementation details are assumed.

Main entry points: [`Hypothesis testing/main.py`](https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main.py) (Script runner), [`Preliminary analysis/prelim_income_per_capita.py`](https://github.com/cse545-bda/hypothesis_testing/blob/master/Preliminary%20analysis/prelim_income_per_capita.py) (Per-capita comparison), [`Hypothesis testing/main1.py`](https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main1.py) (Class-based analysis), [`Preliminary analysis/prelim_analysis.py`](https://github.com/cse545-bda/hypothesis_testing/blob/master/Preliminary%20analysis/prelim_analysis.py) (Median-income estimate)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Hypothesis analysis"]
  node_main_runner["Script runner<br/>[main.py]"]
  node_clean_data["Filter complete data<br/>[main.py]"]
  node_bottom40["Bottom-40 cutoff<br/>[main.py]"]
  node_hyp1["Overall comparison<br/>[main.py]"]
  node_hyp2["Bottom-40 trends<br/>[main.py]"]
  node_hyp3["Growth-rate test<br/>[main.py]"]
  node_class_runner["Class-based analysis<br/>[main1.py]"]
  node_results["Printed test results<br/>[main.py]"]
end

subgraph group_preliminary["Preliminary analysis"]
  node_prelim_median["Median-income estimate<br/>[prelim_analysis.py]"]
  node_prelim_percapita["Per-capita comparison"]
  node_charts["Trend charts"]
end

subgraph group_data["Input data"]
  node_census[("Census data")]
  node_hdfs[("HDFS JSON")]
end

node_analyst(("Analyst"))

node_census -->|"export JSON"| node_hdfs
node_analyst -->|"runs script"| node_main_runner
node_hdfs -->|"reads and filters"| node_clean_data
node_clean_data -->|"derives cutoff"| node_bottom40
node_main_runner -->|"runs test"| node_hyp1
node_main_runner -->|"runs test"| node_hyp2
node_main_runner -->|"runs test"| node_hyp3
node_hyp1 -->|"prints result"| node_results
node_hyp2 -->|"prints result"| node_results
node_hyp3 -->|"prints result"| node_results
node_analyst -.->|"runs script"| node_class_runner
node_hdfs -->|"loads and filters"| node_class_runner
node_analyst -.->|"runs analysis"| node_prelim_median
node_hdfs -->|"reads JSON"| node_prelim_median
node_analyst -.->|"runs analysis"| node_prelim_percapita
node_hdfs -->|"reads JSON"| node_prelim_percapita
node_prelim_percapita -->|"plots trends"| node_charts

click node_main_runner "https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main.py"
click node_clean_data "https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main.py"
click node_bottom40 "https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main.py"
click node_hyp1 "https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main.py"
click node_hyp2 "https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main.py"
click node_hyp3 "https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main.py"
click node_class_runner "https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main1.py"
click node_prelim_median "https://github.com/cse545-bda/hypothesis_testing/blob/master/Preliminary%20analysis/prelim_analysis.py"
click node_prelim_percapita "https://github.com/cse545-bda/hypothesis_testing/blob/master/Preliminary%20analysis/prelim_income_per_capita.py"
click node_results "https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main.py"
click node_charts "https://github.com/cse545-bda/hypothesis_testing/blob/master/Preliminary%20analysis/prelim_income_per_capita.py"

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_main_runner,node_clean_data,node_bottom40,node_hyp1,node_hyp2,node_hyp3,node_class_runner,node_results toneBlue
class node_prelim_median,node_prelim_percapita,node_charts toneAmber
class node_census,node_hdfs toneMint
class node_analyst toneIndigo
```

## Components

### Hypothesis analysis

- [Script runner](https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main.py): `Hypothesis testing/main.py`
- [Filter complete data](https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main.py): `Hypothesis testing/main.py`
- [Bottom-40 cutoff](https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main.py): `Hypothesis testing/main.py`
- [Overall comparison](https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main.py): `Hypothesis testing/main.py`
- [Bottom-40 trends](https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main.py): `Hypothesis testing/main.py`
- [Growth-rate test](https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main.py): `Hypothesis testing/main.py`
- [Class-based analysis](https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main1.py): `Hypothesis testing/main1.py`
- [Printed test results](https://github.com/cse545-bda/hypothesis_testing/blob/master/Hypothesis%20testing/main.py): `Hypothesis testing/main.py`

### Preliminary analysis

- [Median-income estimate](https://github.com/cse545-bda/hypothesis_testing/blob/master/Preliminary%20analysis/prelim_analysis.py): `Preliminary analysis/prelim_analysis.py`
- [Per-capita comparison](https://github.com/cse545-bda/hypothesis_testing/blob/master/Preliminary%20analysis/prelim_income_per_capita.py): `Preliminary analysis/prelim_income_per_capita.py`
- [Trend charts](https://github.com/cse545-bda/hypothesis_testing/blob/master/Preliminary%20analysis/prelim_income_per_capita.py): `Preliminary analysis/prelim_income_per_capita.py`

### Input data

- **Census data**
- **HDFS JSON**

### Other components

- **Analyst**

## Connections

- Census data → HDFS JSON: export JSON (evidence: `README.md`)
- Analyst → Script runner: runs script (evidence: `README.md`)
- HDFS JSON → Filter complete data: reads and filters (evidence: `Hypothesis testing/main.py`)
- Filter complete data → Bottom-40 cutoff: derives cutoff (evidence: `Hypothesis testing/main.py`)
- Script runner → Overall comparison: runs test (evidence: `Hypothesis testing/main.py`)
- Script runner → Bottom-40 trends: runs test (evidence: `Hypothesis testing/main.py`)
- Script runner → Growth-rate test: runs test (evidence: `Hypothesis testing/main.py`)
- Overall comparison → Printed test results: prints result (evidence: `Hypothesis testing/main.py`)
- Bottom-40 trends → Printed test results: prints result (evidence: `Hypothesis testing/main.py`)
- Growth-rate test → Printed test results: prints result (evidence: `Hypothesis testing/main.py`)
- Analyst → Class-based analysis: runs script (evidence: `README.md`)
- HDFS JSON → Class-based analysis: loads and filters (evidence: `Hypothesis testing/main1.py`)
- Analyst → Median-income estimate: runs analysis (evidence: `Preliminary analysis/prelim_analysis.py`)
- HDFS JSON → Median-income estimate: reads JSON (evidence: `Preliminary analysis/prelim_analysis.py`)
- Analyst → Per-capita comparison: runs analysis (evidence: `Preliminary analysis/prelim_income_per_capita.py`)
- HDFS JSON → Per-capita comparison: reads JSON (evidence: `Preliminary analysis/prelim_income_per_capita.py`)
- Per-capita comparison → Trend charts: plots trends (evidence: `Preliminary analysis/prelim_income_per_capita.py`)
