Readme file for: "The Fall and Rise of Immigrant Employment During the Covid-19 Pandemic", by George Borjas and Hugh Cassidy. Forthcoming, Research in Labor Economics.

Instructions to replicate results:
-Download Current Population Survey (CPS) monthly basic data, 2005-July 2021. Save file as "Data\fullseries.dta".  Also download 2019-2020 ASEC supplement. Save file as "Data\cpsbasic.dta". Note that the "cpsbasic.dta" file contains more variables than "fullseries.dta". Source: https://cps.ipums.org/cps/.

-Download O*NET task data, version 17.0, available here: https://www.onetcenter.org/db_releases.html. Save in folder "Data\ONET".

-Run Stata file: main.do. Executing this file will generate all of the results, including generation remotability measures and assigning undocumented status. Log files are saved in the folder "Logs", tables in folder "Tables, and figures in folder "Figures". Note that Table 8 is manually created from output in the log file "Table_8_UIrecovery.log".

This data package includes all log files, figures, and tables. It also includes data file "state_ui.dta" which contains state-specific UI information, collected from the DOL (source: https://oui.doleta.gov/unemploy/ui_replacement_rates.asp).

List of files:

assignLegalStatus.do: Uses March ASEC to assign legal status (native/legal immigrant/undocumented immigrant)
createtasksmain.do: Main file called to generate remotable measure
Figure_1_employment20052019.do: Generates figure 1.
Figure_2_employment20192021.do: Generates figure 2.
Figure_3_jobloss.do: Generates figure 3.
Figure_4_jobfinding.do: Generates figure 4.
Figure_5a_employmentremotability.do: Generates figure 5a.
Figure_5b_joblossremotability.do: Generates figure 5b.
Figure_6_occjoblossremotability.do: Generates figure 6.
Figure_7_employmentlegalstatus.do: Generates figure 7.
Figure_8_joblosslegalstatus.do: Generates figure 8.
Figure_9_UIrecovery.do: Generates figure 9.
generate_sample_variables.ado: Generates variables. Merges legal status and remotability measures.
generate_weekly.do: Uses the March 2020 ASEC to generate the mean weekly wage by state to calculate replacement ratio. File is merged with "Data\state_ui", which is included in this data package, and contains UI information for each state collected from the Department of Labor. Results saved in "Data\aggdata.dta"
label.ado: Assigns variable labels.
main.do: Main .do file that runs all of the code. Only main.do needs to be executed to generate all of the results.
mergeACSCPS.do: Merge occupational characteristics, now assigned by occ2010 occupation codes, with the CPS and creates our remotability measure. Measured save in file "Data\occtasks_remotableindex.dta".
mergeONETACS.do: Merges ONET measures with Census data using SOC occupation code. Takes mean value of occupational characteristics within occ2010 Census occupation code.
saveONET.do: Read in raw ONET occupational characteristics and prepares the data for merging with Census using SOC occupation codes.
Table_1_sumstats.do: Generates table 1.
Table_2_employmentregs.do: Generates table 2.
Table_3_jobloss.do: Generates table 3.
Table_4_jobremotability.do: Generates table 4.
Table_5_joblossremotability.do: Generates table 5.
Table_6_joblossremotabilitystatus.do: Generates table 6.
Table_7_recoveryimm.do: Generates table 7.
Table_8_UIrecovery.do: Generates table 8.

