Skip to main content

Do County Characteristics Explain Migration Flows?

A U.S. county migration atlas and research study combining public-data preparation, clustering, PCA, and retrospective classification of inflows, outflows, and net migration.

People move for many reasons. This project studies how county economic, demographic, housing, and environmental characteristics relate to domestic inflows, outflows, and net migration. An interactive flow atlas connects the geography of movement with exploratory analysis, county profiles, and retrospective classification.

Explore the research website ↗ View code on GitHub ↗

The question

How do migration patterns relate to housing, demographics, economic conditions, and climate across U.S. counties?

The study brings together IRS migration records, Census ACS characteristics and migration flows, FEMA declarations, and NOAA climate observations. The published exploration covers 2009–2023; clustering, principal component analysis (PCA), and classification share a 2023 cohort of 3,050 counties.

Net migration, inflow, and outflow receive equal emphasis as rates per 1,000 ACS residents, with counts describing movement volumes. The IRS outcomes cover individuals represented in matched tax returns, including filers and dependents. Alaska and Connecticut use state-level substitutes in the longitudinal maps; county-only analyses exclude those substitutes.

The work behind the maps

Public data changes shape over time. The pipeline handles legacy IRS spreadsheets, different text encodings, missing-value markers, geographic code changes, and differing source coverage.

Raw snapshots are preserved with checksums. Cleaned tables are kept separate, and the analysis records exclusions and provenance. Climate annual summaries require all 12 months; duplicate migration records are checked before canonical county-pair tables are produced.

Longitudinal charts compare the same 3,007 counties across years. The flow atlas separately maps reported county-pair connections, preserving direction and movement volume. Historical county identifiers and suppressed records remain documented limits on the displayed geography.

What the analyses found

In the 2023 cohort, the strongest absolute Spearman associations among the reported characteristics differ by outcome: homeownership with net migration (0.290), home value with inflow (0.442), and gross rent with outflow (0.420). Inflow and outflow rates are themselves strongly associated (0.80), showing why two-way movement matters alongside net change.

K-means and hierarchical clustering each identify two broad characteristic profiles. The profile with higher income, education, and housing costs has higher median inflow and outflow rates, while the profiles’ median net rates differ by only 0.70 per 1,000 residents. Five principal components retain 80.7% of the variation in 13 standardized characteristics; the first two retain 54.5%.

Three classification tasks use a shared split with 610 held-out counties and target-specific majority baselines. Inflow and outflow classes use training-derived rate tertiles; net migration uses direction.

2023 task Selected model Test accuracy Majority baseline
Inflow: low, medium, or high Multinomial Naive Bayes 50.8% 36.4%
Outflow: low, medium, or high Depth-6 decision tree 54.1% 34.6%
Net migration: inflow or outflow Depth-4 decision tree 65.4% 57.7%

These results show useful but limited classification signal. The net-direction tree identifies only 32.2% of actual net-outflow counties, so its overall accuracy needs that context. The Findings chapter includes macro-F1, balanced accuracy, and the conclusions from each analysis.

What you can explore

  • A county migration flow atlas with county/state search, inflow, outflow and net views, year playback, and animated directional flows.
  • Interactive county maps and exploratory charts showing all three migration outcomes and their associations with county characteristics.
  • Data-preparation examples showing the steps between raw source files and analytical tables.
  • Clustering and PCA views connecting county profiles and characteristic dimensions with movement patterns.
  • Naive Bayes and decision-tree results with model comparisons, confusion matrices, and task-specific limitations.
  • Executed notebooks and downloadable evidence organized by analysis, with notebook conclusions carried through to the website.
NoteBoundaries of the evidence

IRS and ACS measure different populations and periods. Overlapping ACS windows, nominal dollar measures, changing county boundaries, and IRS series breaks constrain comparisons. Suppressed or missing county-pair flows remain unknown, and atlas pair totals can differ from published county totals. The models describe the observed 2023 cohort retrospectively. Causal explanation and future migration forecasts require a separate design that accounts for publication timing and geographic dependence.

Why this project belongs here

The map is the visible part. The less visible work—preserving raw data, resolving definitions, auditing duplicates, and documenting what gets excluded—is what makes the map worth reading.

Explore further

Next: A Comparison of Neural Recommender System Architectures →