import pysal as ps import numpy as np import pandas as pd import matplotlib.pyplot as plt import geopandas as gpd %matplotlib inline This is just a quick demonstration of what I understand from Hodges & Reich (2010)’s argument about the structure of spatial error terms. Essentially, his claim is that the substantive estimates ($\hat{\beta}$) from an ordinary least squares regression over $N$ observations and $P$ covariates:
$$ Y \sim \mathcal{N}(X\hat{\beta}, \sigma^2)$$
This is a quick and dirty exploration of the compactness impacts of changing the projection of data on compactness measures.
import geopandas as gpd import numpy as np import matplotlib.pyplot as plt from compact import reock as _reock import pysal as ps import seaborn as sns %matplotlib inline The data I’m using is the 113th districts from my Scientific Data publication, sourced originally from Jeff Lewis.
df = gpd.read_file('./districts113.shp').query('STATENAME not in ("Alaska","Hawaii")') df.
imported from:<a href=‘https://yetanothergeographer.
imported from:<a href=‘https://yetanothergeographer.
imported from:<a href=‘https://yetanothergeographer.
imported from:<a href=‘https://yetanothergeographer.
imported from:<a href=‘https://yetanothergeographer.
imported from:<a href=‘https://yetanothergeographer.
imported from:<a href=‘https://yetanothergeographer.
imported from:<a href=‘https://yetanothergeographer.