Welcome to MUSA 5080

Public Policy Analytics

Dr. Elizabeth Delmelle

2025-09-08

Course Overview

What This Course Is About

  • Advanced spatial analysis for urban planning and public policy
  • Data science tools within policy context
  • Focus on understanding concepts rather than just completing code
  • Professional portfolio development using modern tools

Unlike Private Sector Data Science

  • Not just about optimization
  • Public goods, governance, equity considerations
  • Transparency and interpretability are crucial
  • Algorithmic bias has real consequences for communities

This Semester’s Innovation

Problem: AI tools making it easy to complete code without understanding

Solution:

  • 40% weekly in-class quizzes (test conceptual understanding)
  • Low-stakes portfolio assignments (focus on learning, not grades)
  • GitHub-based workflow (professional skills)

The Tools We’ll Use

Why These Tools?

GitHub: Industry standard for version control and collaboration

Quarto: Modern approach to reproducible research and documentation

R: Powerful for spatial analysis and policy-focused statistics

Professional Development

These aren’t just “class tools” - they’re career tools:

  • Portfolio employers can see
  • Version control skills for any data job
  • Professional documentation practices

GitHub Fundamentals

What is Git?

Version control system that tracks changes in files

Think of it as:

  • “Track changes” for code projects
  • Time machine for your work
  • Collaboration tool for teams

What is GitHub?

Cloud hosting for Git repositories

  • Backup your work in the cloud
  • Share projects with others
  • Deploy websites (like our portfolios)
  • Collaborate on code projects

Key GitHub Concepts

Repository (repo): Folder containing your project files

Commit: Snapshot of your work at a point in time

Push: Send your changes to GitHub cloud

Pull: Get latest changes from GitHub cloud

GitHub in This Course

Your workflow each week:

  1. Edit files in RStudio
  2. Commit changes with descriptive message
  3. Push to GitHub
  4. Your portfolio website updates automatically

This will become second nature soon!

GitHub Classroom

What is GitHub Classroom?

Educational tool that:

  • Creates individual repositories for each student
  • Distributes assignments automatically
  • Enables efficient feedback and grading
  • Teaches professional Git workflow

How It Works

  1. Dr. Delmelle creates assignment with starter code
  2. You accept assignment via special link
  3. GitHub creates your personal repository
  4. You complete work in your repository
  5. TAs provide feedback through GitHub tools

Benefits for You

  • Individual workspace that’s yours to customize
  • Professional portfolio you can show employers
  • Version control practice for future jobs
  • Direct feedback from instructors on your code

Quarto Introduction

What is Quarto?

Publishing system that combines:

  • Code (R, Python, etc.)
  • Text (explanations, analysis)
  • Output (plots, tables, results)

Into professional documents

Why Quarto?

Reproducible research:

  • Code and explanation in one place
  • Others can re-run your analysis
  • Professional presentation

Career relevance:

  • Industry standard for data science communication
  • Creates websites, PDFs, presentations
  • Used at major tech companies and government agencies

Quarto vs. R Markdown

If you know R Markdown:

  • Quarto is the “next generation”
  • Better website creation
  • Works with multiple programming languages
  • Same basic concept, improved features

Quarto Document Structure

YAML header:

---
title: "My Analysis" 
author: "Your Name"
date: today
format: html
---

R code chunk:

library(tidyverse)
data <- read_csv("data/car_sales_data.csv")

Markdown Basics

Text Formatting

**Bold text**
*Italic text*
***Bold and italic***
`code text`
~~Strikethrough~~

Bold text
Italic text
Bold and italic
code text
Strikethrough

Headers

# Main Header
## Section Header  
### Subsection Header

Use headers to organize your analysis sections.

Lists

## Unordered List
- Item 1
- Item 2
  - Sub-item A
  - Sub-item B

## Ordered List  
1. First item
2. Second item
3. Third item

R and dplyr Review

Why R for Policy Analysis?

  • Free and open source
  • Excellent for spatial data
  • Strong statistical capabilities
  • Large community in urban planning/policy
  • Reproducible research workflows

tidyverse Philosophy

Collection of packages designed for data science:

  • Consistent syntax across functions
  • Readable code that tells a story
  • Efficient workflows for common tasks

Tibbles vs. Data Frames

Tidyverse uses “tibbles” - enhanced data frames.

#Traditional Data Frame
class(data)
# Convert to tibble
car_data <- as_tibble(data)
class(car_data)

Why are Tibbles Better?

Smarter Printing:

  • Shows first 10 rows by default
  • Displays column names
  • fits nicely on a screen

Essential dplyr Functions

We’ll use these constantly:

  • select() - choose columns
  • filter() - choose rows
  • mutate() - create new variables
  • summarize() - calculate statistics
  • group_by() - operate on groups

Live Demo: Basic dplyr

library(tidyverse)

# Load car sales data
car_data <- read_csv("data/car_sales_data.csv")

# Basic exploration
glimpse(car_data)
names(car_data)

Data Manipulation Pipeline


# The power of pipes - read as "then"
car_summary <- data %>%
  filter(`Year of manufacture` >= 2020) %>%      # Recent models only
  select(Manufacturer, Model, Price, Mileage) %>% # Key variables
  mutate(price_k = Price / 1000) %>%             # Convert to thousands
  filter(Mileage < 50000) %>%                    # Low mileage cars
  group_by(Manufacturer) %>%                     # Group by brand
  summarize(                                     # Calculate statistics
    avg_price = mean(price_k, na.rm = TRUE),
    count = n()
  )

Policy Applications

This semester we’ll use these skills for:

  • Census data analysis
  • Neighborhood change studies
  • Predictive modeling for resource allocation
  • Housing market analysis
  • Transportation equity assessment

Course Structure

Weekly Pattern

Monday Class: - New concepts and methods - Hands-on coding practice - Lab work with TA support

During Week: - Complete portfolio assignments - Weekly notes and reflection - Office hours for help

Assessment Philosophy

Focus on understanding, not perfect code:

  • Weekly quizzes test concepts
  • Portfolio assignments build skills
  • Low stakes encourage experimentation
  • Professional development throughout

Portfolio Development

Your GitHub portfolio will include:

  • Weekly learning reflections
  • Completed lab analyses
  • Professional documentation
  • Work you can show employers

Getting Started Today

Portfolio Setup Process

  1. Accept GitHub Classroom assignment
  2. Clone repository to your computer
  3. Customize with your information
  4. Enable GitHub Pages
  5. Complete first analysis

What We’ll Accomplish

By end of today: - Working portfolio repository - Live website with your work - First R analysis in professional format - Familiarity with workflow

Support Available

  • Dr. Delmelle and TAs circulating during hands-on time
  • Office hours starting this week
  • GitHub Issues for technical questions
  • Canvas discussion for course questions

Questions?

Ready to Get Started?

Next: Portfolio setup with GitHub Classroom

Remember: This is a learning process - ask for help when you need it!

Live Demo: Portfolio Setup

[Switch to live demonstration of GitHub Classroom workflow]