Skip to main content

Unit 5: Statistics and Science

This unit turns data into evidence. It tests whether groups of places differ, models how one variable changes with others, and puts the pieces together into a reproducible spatial data science project, from the research question to the conclusion. It ends by testing Tobler’s first law of geography, that near things are more related than distant things: first deciding what “near” means, with distances and neighbors, and then measuring whether values on a map are clustered, random, or dispersed.

Chapter 18: Comparing Groups: p-values and ANOVA

This chapter places statistical tests in the cycle of data analysis. It explains what a p-value does and doesn’t tell you, and why the replication crisis changed how scientists report them. It then compares group means with analysis of variance, from a small worked example to median male age across North Carolina’s regions, with follow-up tests and alternatives for when ANOVA’s assumptions fail.

Chapter 19: Linear Regression

Regression asks how one variable changes as another changes. This chapter covers correlation, fitting a line with lm(), slopes, intercepts, residuals, and predictions, and how to read R’s model summary, including R² and adjusted R². It models median house value in North Carolina’s counties, then maps the residuals to see where the model fails.

Chapter 20: Writing a Spatial Data Science Project

This chapter steps back to ask how data become knowledge. It covers the data, information, knowledge, wisdom pyramid, big data, choosing sources, and why reproducibility and replicability matter. It then walks through the parts of a project, from the research question and background to methods, results, and conclusions, and ends with what makes a project spatial data science.

Chapter 21: Distance and Neighborhoods

This chapter covers what distance means and the main ways to measure it: Euclidean, great circle, Manhattan, and network distance. It then uses distance and shared borders to decide which features are neighbors, with distance bands, k nearest neighbors, and rook and queen contiguity, and stores those relationships in a neighborhood weight matrix, built in R with spdep.

Chapter 22: Spatial Clustering and Spatial Autocorrelation

This chapter tests objectively whether things on a map are clustered. It measures point patterns with the Average Nearest Neighbor ratio, global spatial autocorrelation with Moran’s I and a permutation test, and local hot spots and cold spots with Getis-Ord Gi*, using births in North Carolina’s counties.