Replication Files: "Human Capital Portfolios", by P. Silos and E. Smith 1 Instructions to Run the Computer Code Uncompress the file Rep_Code_HKP_RED.tar.bz using the command tar -jxvf Rep_Code_HKP_RED.tar.bz. The compressed file extracts six directories: HKP_Data, HKP_Data_Regression_Results, HKP_Files_for_Struc_Estimation, HKP_Fortran_Code, HKP_Latex_Files, and HKP_R_Code. The HSB and PETS data should be placed in the first directory. The second and third directories HKP_Data_Regression_Results and HKP_Files_for_Struc_Estimation receive raw output files from the R code located int the HKP_R_Code folder. All the Fortran code is located in HKP_Fortran_Code. Finally the HKP_Latex_Files con- tains tables in .tex form generated by some of the R scripts, and a .tex file with the manuscript itself. 1.1 R Code The data are restricted-access so in order to run the R code the user needs to request the data from the National Center of Education Statistics (NCES). The two datasets used are the High School and Beyond - Sophomores of 1980 (HSB) and the Post-Secondary Education Transcript Study (PETS). The NCES provides the datasets in a CD along with the corresponding codebooks. Save all the HSB data as HSB.Rdata and the PETS data as PETS.Rdata. With these two files in the HKP_Data_Folder run the R files in the following order. First, hkp_data_results_June2014.R. That file generates multiple regression tables and files with data summaries, locat- ing them in the HKP_Data_Regression_Results folder. After that run hkp_data_for_fortran.R. The R code uses the original labels for variables used by the NCES so it's straight- forward to find out which variables are needed. After running the Fortran code itself, which is the object of the next section, run the following two remaining scripts: - hsb_model.R performs the regression analysis using model-simulated data. Note: at the end of the execution you will see a warning stating "glm.fit:algorithm did not converge". Do not worry, the reason for that warning is that R is fitting the probit model to the simulated data from the model in which there is no uncertainty, and hence no occupational switching. - hkp_main_tables_June2014.R generates all the tables in the paper in Latex format using the output from several R files. 1.2 Fortran Code The Fortran files are located in the HKP_Fortran_Code. Compile using: ifort -heap-arrays -openmp -traceback -g -check bounds mod_types.f90 MersenneTwister_mod.f90 riskyparam.f90 dchdc.f utils.f90 humfun2.f90 uncmin.f refsor.f90 modfun.f90 redohk_psi.f90 /path/to/subplexlib /path/to/slateclib The two external libraries (SUBPLEX and SLATEC) are not provided here but they are easily downloadable at www.netlib.org. Occasionally, the code will seg- fault. If this happens, you need to increase the amount of memory that can be allocated to the Fortran compiler. Doing so differs across operating systems. We include a file seeds.txt with the seeds for the random number generator. There are 24 seeds because we used 24 threads. A different number of threads and/or different seeds will result in different numbers than those in the published version of the paper. The code will generate 3 large files with the simulations of 150,000 agents under the baseline parameterization and the two counterfactual scenarios. Re- member that one needs to go back to the R code and run two scripts two generate the necessary tables (see subsection 1.1). 1.3 Latex Code To generate a pdf version of the manuscript just compile the (only) .tex file in the HKP_Latex_Files/HKP_RED_Final folder file with pdflatex. The numbers and tables in the resulting pdf file should be the same as those in the published version.