Hey, author here. Definitely didn't expect to see this on the front page when I woke up. A friend posed the question in the title to me last week after seeing the referenced NYT map, and I spent the last couple evenings making this notebook to try and answer it.
Let me know if you have any questions; I'll try my best to answer them.
Thank you so much for doing this. It has been a central political talking point for me for a long time, but I've never seen the data so well laid out.
Obviously, it's just one factor among many, but I think heavy social safety nets and regulations make a lot more sense to people in very populated locations and a lot of interactions and anonymity than they do out in the countryside, who would prefer to be left to themselves with no one else's hand in their wallet.
It looks like your data is by county. I wonder to what extent it would be clearer if it were down to the city level. A large, mostly empty county with a dense city in it is going to skew the data differently than a small county with city.
I agree. The vote dataset doesn't have demographic breakdowns (I believe it was created by scraping post-election reports on _The Guardian_, not by relying on exit polls). But you compare the prediction errors to county-level data on race (the Census Bureau publishes these numbers) and pose the question "is the population-density model more wrong in areas of higher diversity?"
Very nice. I have often speculated that there's also a correlation between population density and people's stance on environmental issues but didn't see a straightforward way to test this using existing data.
Let me know if you have any questions; I'll try my best to answer them.