Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Stat 159 Group 18 Final Project

California Food Affordability Analysis

Binder DOI

Overview

This project analyzes food affordability across places in California and investigates how affordability varies with socioeconomic, geographic, and demographic context. The motivation is to understand where affordability burdens are highest and which contextual predictors are most informative, using interpretable statistical tests and simple regression models.

The analysis is organized into four research questions (RQs), implemented as notebooks. Across the project we emphasize reproducibility by (1) using a shared utilities module, (2) saving outputs to disk, and (3) including unit tests for utility functions.

Dataset

We use the Food Affordability indicator published by the California Department of Public Health on the State of California Open Data portal. The dataset describes the average cost of a nutritious market basket relative to income for female-headed households with children, reported for California and multiple geographic levels (regions/counties/places).

Source: https://data.ca.gov/dataset/food-affordability

Temporal coverage: 2006–2010

Publisher: California Department of Public Health

Project Website

The project’s JupyterBook website can be accessed here

Repository Structure

Setup and Installation

  1. Clone this repository:

git clone https://github.com/UCB-stat-159-f25/final-group18
cd final-group18
  1. Create and activate the environment:

mamba env create -f environment.yml --name stat159-env
conda activate stat159-env
python -m ipykernel install --user --name stat159-env --display-name "IPython - stat159-env"

Usage

Run notebooks

Open JupyterLab and run:

  1. EDA.ipynb

  2. model_rq1.ipynb

  3. model_rq2.ipynb

  4. model_rq3.ipynb

  5. model_rq4.ipynb

  6. main.ipynb

Figures and tables are written to figures/ and outputs/.

Automation (MyST)

Build the MyST site / configured exports:

myst build

Build PDF exports:

myst build --pdf

Package Structure (utils/model_utils.py)

The model_utils module provides small reusable helpers used across RQ1–RQ4.

Metrics

RQ1: Interpretable regression modeling

RQ2: Group mean inference

RQ4: Preprocessing + evaluation utilities

Testing

Run tests from the repository root:

pytest -q

License

This project is licensed under the BSD 3-Clause License.

Additional Information

See project-description.md for the assignment specification and main.ipynb for the final narrative results.

References
  1. Lee, S., Zhang, D. Y., Chung, H., Leng, D., Jimmy Butler, & sdny2 berkeley. (2025). UCB-stat-159-f25/final-group18: v1.0.1 – Final Project Release. Zenodo. 10.5281/ZENODO.17970438