Description of programs used to generate all tables and figures for "Who Works for Whom: Worker Sorting in a Model of Entrepreneurship with Heterogenous Labor Markets" Prepared for Review of Economic Dynamics Programs are divided into sections where the relevant statistics appear in the text. All programs were run in a linux environment (RHEL 5). SAS 9.2 was used to execute .sas programs. Stata 14 MP was used to execute .do programs. Intel Fortran 64 Compiler XE (Version 14.0.1.106) was used to execute .f90 programs. MATLAB R2013a was used to execute .m programs. Approximate runtimes are noted when appropriate. 1. Empirical Analysis for Motivating Observations (Section 2) Access to microdata needed to replicate our findings can only be obtained as part of an approved project at the U.S. Census Bureau. Analysis must be done at a secure enclave facility, and all results must go through disclosure avoidance review to protect confidentiality. All microdata used to generate all results is maintained by the U.S. Census Bureau and archived on servers that can be accessed at the U.S. Census Bureau or a secure facility. These secure facilities are located throughout the United States. For more information, please see https://www.census.gov/fsrdc Once data access has been established, sipp_entrep_table1.sas found in folder sipp_only_statistics can be run to replicate the statistics in Section 2 sourced from the SIPP survey (Expected run time: 1 hour). For other statistics in Table 1, run the following program: lbd_ent_def.do - Program that creates all statistics from LBD in Table 1. (Expecte runtime: less than 5 minutes). 2. Model (Sections 3-7) Numerical solution of model and related experiments are found in "model" folder. The numerical solution is described in Online Appendix A. The programs that find a numerical approximation to the solution are are described as follows: main_simplex.f90 - Main program that runs the Nelder-Mead optimization algorithm. This program is used to calculate optimal parameter vector M with an initial guess. The program contains flags to save corresponding output (savedata) and to skip the optimization step and to calculate stationary equilibrium using an initial guess (skipnm). This program is adapted from Alan Miller's Fortran Software Repository currently hosted by Jason Blevins (https://jblevins.org/mirror/amiller/). minim.f90 - Nelder-Mead optimization algorithm from Alan Miller's Fortran Software Repository currently hosted by Jason Blevins (https://jblevins.org/mirror/amiller/). This program was adapted to use nrtype.f90. sub_main.f90 - Program that performs value function iteration using OpenMP. This program also performs most of the experiments found in the Results section. These are defined by a do loop over the counter "ix3" when Nelder Mead optimization is disabled (skipnm=0). These experiments replicate Table 5, 6, 7, and 8. sub_simulation.f90 - Programs that performs simulation of the economy and calculates moments of interest. Final simulation output is written in this program. mod_common.f90 - Auxiliary program that defines global variables and memory assignment for private objects needed for multithreading by OpenMP. Input parameters are found in the top panel of Table 2. nrtype.f90 - Auxiliary program used to define object precision. File is adapted from "The Art of Scientific Computing". Second Edition. Volume 1 of. Fortran Numerical Recipes by William H. Press sub_linintp1.f90 - Program for 1 dimensional linear interpolation sub_golden_a2.f90 - Program used perform golden search on asset space. File is adapted from "The Art of Scientific Computing". Second Edition. Volume 1 of. Fortran Numerical Recipes by William H. Press sub_opt.f90 - Program used to perform grid bracketing in preparation for golden search in sub_golden_a2.f90 sub_wealth - Program used to calculate agent income given the state space sub_tauchen.f90 - Program that discretizes the state space for entrepreneurial ability valfcn.f90 - Program that calculates the value function by interpolating over the choice of assets tomorrow. Please note that these programs have to be compiled before they are executed. The program requires OpenMP, which is set using the -openmp flag at compilation. Processor optimization was performed using the -march=native flag specified at compilation time. Computation time for all experiments and results from an appropriate initial guess on a system with 12 CPUs and 8GB memory require approximately 7 days to complete. Recovered parameters from the Nelder Mead Opimization procedure are found in the bottom panel of Table 2. Once simulation output is saved, final calculation of additional moments for results tables and figures is performed using several MATLAB programs: results_tables_figures.m - Program that calculates all moments reported in tables and Figures 1 and 2 results_graph_figure3.m - Program that creates model Figure 3 prctile.m - Auxiliary program used to calculate percentiles rouwenhorst.m - Auxiliary program used to discretize the labor productivity process suplabel.m - Auxiliary program used to create labels for Figures 1 and 2 These programs recover the moments printed in Table 3 and Table 4 as well as Figures 1, 2, and 3. Expected runtime for MATLAB programs is 30 minutes. In order to replicate Table 9 and 10, the following changes need to be made to the above programs before the Nelder-Mead optimization procedure can be rerun. For Table 9, the entrepreneurship ability shock is revealed before the entrepreneurship decision is made. To allow this change in the code, set nouncertflag=0 in mod_common_var.f90 (line 36). For Table 10, the borrowing limit in line 102 of sub_main.f90 needs to be changed from 1.5 to infinity. 3. Net Worth and Earnings Empirical Analysis (Section 8) Access to microdata needed to replicate our findings can only be obtained as part of an approved project at the U.S. Census Bureau. Analysis must be done at a secure enclave facility, and all results must go through disclosure avoidance review to protect confidentiality. SIPP microdata linked to LEHD infrastructure files used to generate all results is maintained by the U.S. Census Bureau and archived on servers that can be accessed at the U.S. Census Bureau or a secure facility. These secure facilities are located throughout the United States. For more information, please see https://www.census.gov/fsrdc. Once data access has been established, the following programs found in folder lehd_sipp_regressions can be run to replicate the findings in Section 8: 01.make_dombrans.sas - Load LEHD data and create a measure of employment 02.merge_sipp_lehd_red.sas - Link employment records in LEHD with survey respondents in SIPP 03.proc_reg_asset_red.sas - Create relevant covariates for analysis 04.estimates_table_red.sas - Runs OLS and Quantile regressions. This program generates Table 12 and D2. 05.estimates_table_red_naics4.sas - Runs OLS and Quantile regressions with 4 digit NAICS fixed effects. This program generates Table 12, D3, and D4. 06.means_table_red.sas - Calculates means and medians. This program generates Table 11 and D1. Expected runtime: 24 hours. 4. Parameters of the firm productivity process and returns to scale Access to microdata needed to replicate our findings can only be obtained as part of an approved project at the U.S. Census Bureau. Analysis must be done at a secure enclave facility, and all results must go through disclosure avoidance review to protect confidentiality. ASM microdata linked to LBD used to generate all results is maintained by the U.S. Census Bureau and archived on servers that can be accessed at the U.S. Census Bureau or a secure facility. These secure facilities are located throughout the United States. For more information, please see https://www.census.gov/fsrdc. Once data access has been established, the following programs found in folder "productivity_process" can be run to obtain the estimates of firm productivity process and returns to scale used in calibration (Section 4) -- all code below is run on Stata 14 MP in a Unix environment: age_merge.do - This program creates the dataset "final_data.dta" that is used as an input to the next two programs below (expected runtime: less than 5 minutes) prod1.do - Generates solow residuals based on cost shares and creates the main estimation sample (expected runtime: less than 5 minutes) prod2.do - This program uses GMM estimation based on Abraham and White (2015) to estimate the returns to scale and the parameters of the productivity process for young and old firms (expected runtime: less than 10 minutes) All programs have been reviewed to ensure no confidential data are disclosed.