Week 7 Notes - Course Introduction

Published

October 20, 2025

Model Diagnostics & Spatial Autocorrelation

rendering issues

  • Add progress = FALSE in each function call
  • Set globally on the top of the doc
Code
# Add this near the top of your .qmd after loading libraries
options(tigris_use_cache = TRUE)
options(tigris_progress = FALSE)  # Suppress tigris progress bars
  • evaluation and echo
Code
# eval = true, run the code; echo = true, show the result

regression evaluation

  • good error is random

Moran’s I

  • measure spatial autocorrelation
    • +1 shows that has positive correlation (cluster)
    • 0 random
    • -1 shows that has negative correlation (dispersion)

Neighbors

  • Queen: share the same border and corner
  • rook: share the same border