Skip to content

ouslan/mov

Repository files navigation

Road Infrastructure & it's Effects on Comute Time

This project visualizes the interaction between unemployment and average travel distance by incorporating spatial patterns. The data visualization is done using a Dash web application, which displays a map, project details, and data sources.

Prerequisites

Before running the project, make sure you have Python 3.9+ installed and set up a virtual environment:

git clone https://github.com/ouslan/mov
cd mov

a .env in the root directory with the following content:

CENSUS_API_KEY=YOUR_API_KEY

With Conda

You can create a new Conda environment using the provided environment.yml file:

conda env create -f environment.yml

With pip

Alternatively, you can install the required libraries with pip:

pip install -r requirements.txt

Important

This project uses polars as one of its dependencies, which requires Rust to be installed on your system. You can install Rust from the official Rust website.

Usage

To run the Dash application, use the following command:

docker-compose up

Replication

python main.py

Important

It is important to note that this replication will take a while to run. Given my a high end computer with 68GB of RAM and 12 threads, it will take around 22 hours to download and run the project.

Warning

The data used for this project is very large, be sure to have enough space on your computer to download it. It requires at least 120GB of free space.

Caution

Given that the there is a recalculation of the road shape files from counties to PUMAs, and it is done in paraller to save time it maya very resorce intensive to run the project. You can use the following package to generate all the data of the project:

Docker

You can also run the website locally using Docker. To build and start the Docker containers, run:

docker-compose up --build

This will host the Dash application at http://localhost:7050 and the documentation at http://localhost:8005.

File Structure

  • app.py: Main application file that sets up the Dash app, defines the layout, callbacks, and runs the server.
  • src/data/data_pull.py: Contains the DataPull class that handles data retrieval.
  • src/data/data_process.py: Contains the DataClean class that handles data loading, cleaning, and processing.
  • src/graphs/data_graph.py: Contains the DataGraph class for processing and visualizing data.

Data Sources

The data for this project comes from several sources:

Methodology

The project uses two regression models:

  1. OLS Regression: Estimates coefficients of the MOVS dataset to move data from state level to county level.
  2. Panel Spatial Regression with Fixed Effects: Incorporates spatial interaction between neighboring counties. The model used is:

$$y_{it} = \rho \sum_{j=1}^N w_{ij} y_{jt} + x_{it} \beta + \mu_i + e_{it}$$

Sponsors

AEA Seal Census Logo Howard University Seal

Releases

No releases published

Packages

No packages published

Languages