This zip file includes two do files, and 12 Stata datasets.  

Do-file
"Code for Tables" calculates the values in the 6 tables of this paper. 
"Code for Figures" produces the all the 19 figures of this paper.

Stata Datasets: 
wiid_ver3_sept15.dta has values on Gini index for many countries and many years. The data are obtained from World Income Inequality Database. 
Master.dta has GDP per capital for many countries and many years. The data are obtained from World Development Indicators. 
GDP.dta has quarterly GDP per capital for many years and for countries US, Mexico and Latin American countries. The data are obtained from World Development Indicators. 
BP_data.dta has the number of border patrol police from 1992-2016. The data are obtained from U.S. Department of Homeland Security. 
pce.dta has personal consumption expenditures price index collected from Bureau of Labor Statistics.
unem.dta has national unemployment rate by year, collecting from Bureau of Labor Statistics. 
1980-2015.dta has 27 immigrant-sending countries in year 1980, 1990, 2000, 2010 and 2015, by birth cohort and gender. It has variables on population, GDP/K, the number of immigrants at each year. Population of each country by birth cohort is obtained from the database provided by United Nations Population Division. GDP/K is obtained from IMF database. The number of immigrants to the US is obtained from IPUM Census. 

2020-2050.dta has the same structure as the dataset 1980-2015.dta, but differ in that the variable are projected values on birth cohort and GDP/K during 2020-2050. Population is obtained from World Banks population projection. We project future GDP/K based on IMF database, assuming a geometric growth rate of GDP/K.   

US_gdp_updated.dta has quarterly GDP data for the US, Mexico and Latin American countries from 1991-2016. 
US_gdp_updated_redux.dta has yearly GDP data for the US and Mexico from 1991-2016. 
populationgdp_chen.dta has variable on population and GDP by each Mexican state for many years.  
Millman_1960-2015.dta gives per capita GDP for the US and Mexico for each year from 1940 through 2015. The data are obtained from World Development Indicators. 

Datasets downloaded from IPUMS
acs1970-2015.dta combines 5% decennial US Census from IPUMS in year 1970, 1980, 1990, 2000, and also American Community Survey 2010, 2015. 
acs2007.dta is American Community Survey 2007. 
acs1970-2010.dta combines 5% decennial US Census from IPUMS in year 1970, 1980, 1990, 2000, and American Community Survey 2010. 
cps9415 has the Annual Social and Economic Supplement of Current Population Survey from 1994-2015.
mex1990, mex2000, mex2010 are Mexican Census 1990, 2000 and 2010, respectively --- available from IPUM-International. 
us1990, us2000 are 5% decennial US Census from IPUMS in year 1990 and 2000, respectively. 
us2010 is American Community Survey 2010.
mex1960-2015.dta combines Mexican Census in 1960, 1970, 1980, 1990, 2000 2010 and 2015. 
us1960-2015.dta combines Mexican Census in 1960, 1970, 1980, 1990, 2000 2010 and 2015.

