Setting up data
To create the commuting zone analysis, data download programs (and in some cases, cleaning programs) are in the raw
folder. They are not downloaded by the SAS and Stata programs in the $programs
folder. Download is accomplished using Linux tools, but can also be done by hand, using the URLs mentioned above or in the scripts.
filename
|
01_get_data.sh
|
02_convert.R
|
03_get_adh.sh
|
nhgis/main.sh
|
nhgis/nhgis0008_ds95_1970_county.do
|
nhgis/nhgis0008_ds98_1970_county.do
|
nhgis/nhgis0008_ds99_1970_county.do
|
nhgis/nhgis0009_ds122_1990_county.do
|
nhgis/nhgis0009_ds123_1990_county.do
|
nhgis/nhgis0010_ds146_2000_county.do
|
nhgis/nhgis0010_ds151_2000_county.do
|
nhgis/nhgis0011_ds195_20095_2009_county.do
|
nhgis/nhgis0011_ds196_20095_2009_county.do
|
nhgis/nhgis0012_ds103_1980_county.do
|
nhgis/nhgis0012_ds107_1980_county.do
|
Notes:
$raw/adh_data/Public Release Data/dta
Main program files
The main program files are split into three groups: the creation and analysis of the commuting zones, for which all programs are in the main $programs
directory, and case studies 1 (QCEW) and 2 (ADH). The programs for each of the case studies are in subdirectories 06_qcew
and 07_adh
, respectively.
In all cases, programs should be executed in the numeric sequence implied by the name of the program. If programs have the same numeric prefix, they can be executed in any order, or in parallel.
Order of programs to run
To create the replicated commuting zones, run the following programs in numerical order:
01_dataprep.sas |
02_01_clusters.sas |
02_02_export_data.sas |
03_prep_figures.sas |
04_figures2_3.do |
05_01_flows.do |
05_02_bootstrap_1990.sas |
05_03_bootstrap_2009.sas |
05_04_export_bootstraps.sas |
05_05_bootstrap_graphs_new.do |
05_06_bootstraps_graphs_jtw2009.do |
08_map_inset.sas |
09_maps_paper.sas |
config.do |
config.sas |
Reading in various datasets
sas 01_dataprep.sas
(runtime: 2.81s)
Clustering process
sas 02_01_clusters.sas
(runtime: 3:25.73 minutes)
OUTPUT: $data/clusfin_jtw1990.sas7bdat
Run the Bootstrap
Projects MOEs from 2009-2013 onto 1990 data, creates the 1000 realizations of commuting zones.
stata -b do 05_01_flows.do
sas 05_02_bootstrap.sas
The first program runs in seconds, the second one takes (runtime: 56 hours).
Replication programs for Case Study 1 in Section 4.1
All programs are in $programs/06_qcew/
subdirectory. Change working directory, and execute in numerical order.
Data preparation
Required data are commuting zones, BEA-collected receipt of UI benefits (Bureau of Economic Analysis 2019), QCEW employment data (Bureau of Labor Statistics 2020).
Programs prefixed with 00
prepare the data:
filename
|
06_qcew/00_bea_readin.do
|
06_qcew/00_describe_bootclusters.do
|
06_qcew/00_qcew_extraction.sas
|
06_qcew/00_qcew_post_extraction.do
|
06_qcew/00_readin_czones.do
|
Analysis programs
The remaining programs generate the analysis described in the manuscript, and output tables and figures as per the list below. Programs with non-numeric prefixes are called by other programs, and should not be run separately. Scripts (*.sh
) are for convenience, and are not necessary - simply execute all programs in numerical order.
filename
|
06_qcew/01_regressions_table.do
|
06_qcew/02_01_cluster_loop.do
|
06_qcew/02_02_cluster_loop.do
|
06_qcew/03_01_cluster_graphs.do
|
06_qcew/03_02_cutoff_graphs.do
|
06_qcew/zz_bartik_merge.do
|
The complete sequence of programs ran in about 36 hours.
Replication programs for Case Study 2 in Section 4.2
All programs in $programs/07_adh/
subdirectory. Change working directory, and execute in numerical order.
Data preparation
Required data are commuting zones, and various ADH-related data listed earlier.
Programs prefixed with 00
prepare the data:
filename
|
07_adh/00_01_census_creation.do
|
07_adh/00_02_ctyindustry_creation.do
|
07_adh/00_03_IPW_creation.do
|
07_adh/00_04_cbp_readin.do
|
07_adh/00_05_subset_qcewdata.do
|
07_adh/00_06_subset_seerpop.do
|
07_adh/00_07_mergecounty.do
|
07_adh/00_08_cz_merge.do
|
Analysis programs
The remaining programs generate the analysis described in the manuscript, and output tables and figures as per the list below. Programs with non-numeric prefixes are called by other programs, and should not be run separately. Scripts (*.sh
) are for convenience, and are not necessary - simply execute all programs in numerical order.
filename
|
07_adh/01_table3.do
|
07_adh/02_01_cutoff_loop.do
|
07_adh/02_02_overall_loop.do
|
07_adh/03_01_cutoff_graphs.do
|
07_adh/03_02_overall_graphs.do
|
07_adh/zz_aggregatedata.do
|
07_adh/zz_ctymerge.do
|
The complete sequence of programs ran in about 36 hours.