REPLICATION INSTRUCTIONS FOR THE CODE SECTION The codes in this folder are for the model compuatations in the main text. All codes are written in Fortran 90, and they are made sure to run in Intel Fortran 2007 version (operating system: Windows 10). All codes are expected to run under 2 minutes. The codes under "steady_state" subfolder has to be run first. This computes the steady-state outcome of the model. Create the "output" folder to store the output files. The codes under "baseline" subfolder computes the baseline results (Table 5 and the first rows of Tables 6 and 7). The Cox coefficients show up in Logfile.txt. When running the codes, create "input" folder and include fu.txt and fw.txt from the steady state output. Create the "output" folder to store the output. Other business-cycle statistics can be computed by putting the "statsmodel.m" matlab file into the output folder and running it. Similarly, the codes under "z_only" "lambda_u_only" "lambda_e_only" "delta_only" compute the second to fifth rows of Table 6. The subfolder "Table_7" includes the program to compute the contents of Table 7. The current configuration would compute the bottom row. By setting nus_varEE=0.0D0, nus_varUE=0.0D0 in Global.f90 file, the second row is computed. By setting scalexxUE = 0.0d0, scalexxEE = 0.0d0 in Global.f90 file, the third row is computed. With the current configuration, one can generate Figure 4 by using output files "Zdata.txt" (z) "newX.txt" (all new matches) "newUEX.txt" (new matches from unemployment) "newJSX.txt" (new matches from another job). One can generate Figure 5 by using output files "Zdata.txt" (z) "newTypegen.txt" (all new matches) "newUET.txt" (new matches from unemployment) "newJST.txt" (new matches from another job). Only the final 500 observations are used for the figures. REPLICATION INSTRUCTIONS FOR THE EMPIRICAL SECTION: GENERAL INSTRUTIONS This file provides general instructions for replicating the empirical result in “Job Duration and Match Characteristic over the Business Cycle”. We use Matlab and R software for the empirical section and all the files are organized under a folder named after each software. First, we use Matlab to organize data from NLSY 1979 extracted using the “Investigator” utility. Once the dataset is ready for the Cox regressions, we use the R scripts to run the regressions for each model specification. We later use Matlab again to produce some of the figures in the paper using the post-estimation results. All the data we use in this paper is publicly available except for the geocode data from NLSY. Therefore, the folders include the data in the original paper except for the geocode data. To facilitate the replication of the results where we use state level unemployment rate, we included the scripts for this section, which use a data matrix “states” that RANDOMLY assigns each individual to a state. Researchers who have access to the real geocode data need to replace this data matrix with the true values. Computation time for cause-specific hazard regressions is a few minutes, slightly faster for the model under stratification because the risk sets are smaller. Subhazard regressions, on the other hand, are computationally more intensive. As we extend the dataset with Kaplan-Meier weights, the sample size becomes quite large and requires more memory. Depending on the computer specifications, running a subhazard regression for a specific cause takes about 25 minutes. The non-parametric frailty model in the online appendix is high-dimensional and estimation of this model is also computationally intensive. Depending on the computer specifications, the estimation time is about 4 hours. If you have any further questions about these files, please feel free to reach us: Ismail Baydur: ismailb@smu.edu.sg Toshihiko Mukoyama: tm1309@georgetown.edu INSTRUCTIONS FOR CREATING THE DATA EXTRACT FROM NLSY 1979: NLSY 1979 data files (except for the geocode data) are downloaded using the “Investigator” utility from: https://www.nlsinfo.org/investigator/pages/search.jsp?s=NLSY79 Unemployment and employment data (aggregate and state-level) are obtained from Bureau of Labor Statistics website: https://www.bls.gov/sae/ Federal minimum hourly wage and consumer price index are obtained from FRED of Federal Reserve Bank of St. Louis: https://fred.stlouisfed.org Occupation and industry conversion tables are obtained from IPUMS database: https://usa.ipums.org/usa/volii/occ_ind.shtml Unemployment insurance (UI) replacement rate data is obtained from the Department of Labor. RAW DATA FILES: FOLDER “raw data” All of the data are located under the folder “raw data”. NLSY data is under the “NLSY raw” subfolder. Each variable from NLSY is further organized under a subfolder named after the variable, e.g. “industry” folder contains industry information for each job. Researchers who want to use our extract can skip this section and move to the explanations for the file “extract1.m”. The subfolders under “NLSY raw” include a Matlab file called “data_clean.m” which reads in comma separated files from NLSY to a matrix in Matlab environment. For some of the job level characteristics, these files also perform imputation of missing information into these matrices. More specifically, Employer History Roster in NLSY has the following structure for job start and end dates. Take job start year, yemp_start_year, as an example. Each row in this matrix corresponds to an individual and each column is a specific job. The entry shows the year in which the job has started. Similarly, month and day information is included in another matrix with the same format named in a similar fashion. However, not all the job characteristics come in this format. The first step in extracting the data is to convert the other job characteristic variables into this format. Most of the variables instead have separate columns for each survey year. For example, the raw industry data has the following format: the first five columns are industry indicators in year 1979 for the first five jobs an individual has ever held. The number five corresponds to the maximum number of jobs held in that survey year and the fifth column is actually filled with a negative number for most of the individuals. The sixth column corresponds to the industry information of the first job ever held by the individual in the survey 1980. If this job had already ended in 1979, a negative value is entered. If an individual had his sixth ever job in this survey round, the industry information for that is in column 11. The matrix columns extend over the columns in such a manner. In some survey years, some job numbers are missing. For example, industry variable in 1990 for job number 34: this information is perhaps collected in the previous interview round. To make all the variables comparable, “data_clean.m” files insert “-1” for these missing columns. The detailed information on missing columns for every variable is in the excel file “data structure.xlsx” in the parent folder for the raw data. Schooling information uses several variables from NLSY database. Each of these variables are under the folder “schooling”. In-line instructions for finding the last school enrolment dates are provided in “schall.m”. State-level unemployment data is under the folder “BLS data”. Running “readstates.m” files creates a matrix with unemployment rates for each state. The rows indicate time and columns indicate state. Each state information appears in the column number equal to state FIP code plus one (the first row indicates year/month date). When a FIP code is skipped, e.g. number 3, a column vector of -1 is inserted. The last column (58) is the aggregate unemployment rate. For the main analysis, we use this column only. Data on state-level UI benefit replacement rates from the Department of Labor is under the folder “DOL data”. This piece of information is used in one of the robustness analysis in the appendix. Other utility files such as continuous week crosswalk from NLSY are also under the folder “raw data”. DATA EXTRACTS: FOLDER: “extracts” FILE extract1.m: This file converts all the variables from NLSY database to the format in the Employer History Roster. The outcome is saved as “nlsy_raw.mat”. Note that the matrix rows represent an individual and matrix columns correspond to a particular job held by the individual. Because the maximum amount of jobs held by an individual is 65, the resulting matrices have a size of 12686 by 65. This file also labels the job spells as EE, EU, and EN, which are stored in yemp_j2j and yemp_nilf variables. The script assumes the following data are provided to the script. a. nlsy79_rest_in.mat: This Matlab data contains the main NLSY data. b. wages.mat: Wage data from NLSY. c. minw.mat: Minimum wage data d. cpi.mat: CPI data e. ind_occ_cross_ipums.mat: Industry/occupation table for consistent classification. FILE extract2.m: This file takes the output of the file “extract1.m” and creates a single matrix of job spells. extract1.m must be run first. Each line corresponds to a job spell with job characteristics, job start and end dates, and several indicators used to determine transition type. We impose various data restrictions in this file. Please refer to in-line comments for details. FILE extract3.m: This script extends the dataset produced by extract2.m and generates a matrix ready for Cox regressions. extract2.m must be run first. In the final matrix, each line corresponds to a monthly observation of an individual’s particular job spell. Note that the current unemployment rate enters as a time-varying regressor to the matrix at this stage. The next step is to run the Cox regressions under various specifications. Please refer to the “R files” folder. REGRESSIONS: All the files required for the Cox regressions are located under “R files” folder. The only input from the Matlab files required for the regressions in R is the “data_reg.csv” file. To run the regressions, you must copy this file to the same directory where you store the R files in your computer. We also change the name of this file to perform multiple analysis in one folder, e.g. data_reg_main.csv for main text results. We use “coxph” and “coxme” packages in R to run the regressions. Below are descriptions of the files in this folder. 1. euncs.R: This R script produces the results in Table 1: Cause-specific regressions with frailty and stratification. The data file name must be changed to “data_reg_main.csv” 2. eunfg.R: This R script produces the results in Table 2: Subhazard regressions with frailty and stratification. Frailty vs. stratification specification is controlled by an internally defined logical variable “fe” in this file. Refer to the in-line comments in this file. The function that performs Fine and Gray calculations are stored in a file called “rsfg.R”. These estimations are computationally intensive (about 25 minutes for each regression). 3. cif_calc.R: Calculation of cumulative incidence functions and their upper and lower bounds. The functions performing the calculations are located in the file “cif_funcs.R”. The output from this file are copied to cifeun3*.csv files, which are used to draw Figures 1, 2, and 3. 4. pooled.R: This R script produces the results in Table 3. Cox regressions without competing risk. APPENDIX FILES: 1. Quits, Firing, and Other Reasons (QFO): QFO classification requires information on whether a job is lined up or not. Therefore, regression data must be created again with extract2.m and extract3.m by excluding those with missing info on the variable “lined”. See in-line comments in the original extract2.m file. R files under this specification are named with an underscore extension, e.g. euns_qfo.R. 2. Short panel regressions: In extract2.m, there is a variable called “bow”, which indicates whether a time frame same as the analysis in Bowlus (1996) is used. Changing its value to 1 generates a dataset right censored in December 1988. Running extract3.m as is generates a shorter panel. We save this file as “data_reg_short.csv” and repeat the main analysis to obtain short panel regression results. 3. Local Labor Market Controls: The files associated with this section are placed together into a separate folder called “regressions state” for practicality reasons. We included another README file in that folder. 4. Non-parametric Frailty Estimation: This section is performed solely in Matlab. The files are placed under a folder called “regressions npmle cor”. Please refer to the online Appendix and in-line comments for instructions. Computation time about 4 hours. 5. Industry Interaction Application is similar to the main analysis except for some the additional interaction variables. For convenience, euncs_ind.R and eunfg_ind.R files are provided separately for this part and the instructions are similar to the main analysis files.