I'd like to do some analysis of the state-to-state migration flow files, available to download here. Unfortunately, these files include tables that will take quite a bit of wrangling for me to use. (They have multi-row headers, repeated rowname columns, etc.)
Usually, the Census Bureau also publishes a dataset version of these kinds of files, but right now I'm struggling to find one. These state migration flow files also appear not to be on the API, or at least, they aren't supported by tidycensus::get_flows().
Can anyone point me to a properly formatted version of this data?
The lower level API library is `library(censusapi)`, but migration flows do not seem to be available through the API (https://www.census.gov/data/developers/data-sets.html).
2010-2020: https://www2.census.gov/programs-surveys/popest/datasets/2010-2020/national/totals/nst-est2020-alldata.csv2020-2023: You'll have to download this file separately. It's located here: https://www.census.gov/data/tables/time-series/demo/popest/2020s-state-total.html. The table name mirrors the one above, just with "2023" in the title instead of "2020."
The Census Bureau uses the IRS migration data as part of their PEP, and I believe is the source of these files. The original state to state files are here and are easy to use.
https://www.irs.gov/statistics/soi-tax-stats-migration-data-2021-2022
I don't think this is correct.
According to this page, "Data sources for these products include the American Community Survey (ACS), the Puerto Rico Community Survey (PRCS), and the decennial census." The IRS migration isn't mentioned as a source for the PEP data flows, although I supposed the IRS could be un-credited both here and on the "differences" page.
If OP really does want the IRS-derived migration flows, they could use the link you provided. MCDC also offers these as SAS datasets or basic extracts, here: https://mcdc.missouri.edu/cgi-bin/uexplore?/data/irsmig
Thank you Glenn. I used to work in estimates and they use IRS for 0-64 and a Medicare for 65+ to measure migration. The resulting total migration data are in their components of change files, which are no easier to analyze than the files the OP posted. Although I’d use these adrec data over estimated ACS data any day. The majority of this is 0-64 IRS measured migration.
www2.census.gov/.../methods-statement-v2021.pdf
The IRS data are great for domestic migration patterns, and I'd also use it over ACS estimates if looking for that. The only limitation is that there is incomplete information on international immigration, which is a huge component (especially in these recent years).
Just a quick note to any potential IRS data users to say that there are irregularities in the IRS SOI migration files for 2014-2015 (very low in- and out-migration) and 2016-2017 (very high in- and out-migration). I have written to them about this and they replied "We suspect these are administrative errors that do not reflect accurate migration trends. We are still trying to determine the cause of these data anomalies and we encourage extreme caution when using these specific years."