1. Software and operating system used Maple 2016, StataIC 14, Mathematica 10.3, Microsoft Excel 2010, Windows 10 2. 2.1. Estimation in StataIC 14 A. Data: German Socio-Economic Panel (GSOEP), wave 2011 GSOEP data is available to academic users from the European Economic Area and Switzerland without financial costs but it requires signing a contract and registration at the German Institute for Economic Research (DIW, Berlin) https://www.diw.de/en/diw_02.c.222516.en/data.html Files: bbp.dta, bbpgen.dta, bbpequiv.dta, bapequiv.dta, zpequiv.dta, ypequiv.dta, xpequiv.dta, wpequiv.dta Our definition of the immigrant status is based on variables bbp140 (German nationality) and bbp14201 (German nationality since birth). Only if both variables take value 1 we classify the individual as a native. Otherwise the person is assigned an immigrant status. Thus our definition of immigrants includes individuals with foreign citizenship and those who changed their citizenship for the German one at some later stage in their life. The definition of occupational mismatch is based on variables bbp29 and bbp30. The definition of unemployment is based on variable bbp06 (Registered unemployed). Our definition of employment is based on variable bbp09. Thus workers are classified as employed if they are full-time employed or regularly part-time employed. The skill level of workers is based on variable bbbilzeit, which takes values between 7 and 18. Low skill workers are those with schooling less or equal to 12 years, workers with more schooling years are classified as high skilled. The sector of production is based on variable e1110611. Sector 1 includes Agriculture, Energy, Mining, Manufacturing, Construction and Trade, whereas Sector 2 includes Transportation, Banking, Insurance and Other services. Sector information for unemployed workers is recovered from their jobs in the previous 5 years (2006-2010) based on variables e1110606, e1110607, e1110608, e1110609, e1110610. Do file with commands: do_file_bbp2011 Results are saved in the file Stata_log_file.log Sizes of all worker groups (population fractions) from this file are summarized in Table 1. B. Time series on the absolute number of unemployed and employed workers as well as the absolute number of vacancies and vacancy durations can be accessed on the webpage of the Federal Employment office (BA): https://statistik.arbeitsagentur.de/Navigation/Statistik/Statistik-nach- Themen/Zeitreihen/zu-den-Produkten-Nav.html These time series (2000-2017) are exported into StataIC 14, file name matching_function_revised.dta and used in the estimation of the matching function. This data is also used to produce Figure 2. 2.2. Estimation in Microsoft Excel 2010 A. Additional aggregate time series data is taken from DESTATIS, Statistisches Bundesamt, 2015: Fachserie 18 Reihe 1.2: Volkswirtschaftliche Gesamtrechnungen File Inlandsproduktberechnung.xlsx, time period 1991-2015 Information on the total gross wages by sector is provided on page 2.4, the number of employees by sector is provided on page 2.5 and the brutto GDP per employee is provided on page 11. Industries 2 (agriculture), 3 (manufacturing), 5 (construction) and 6 (trade) are assigned to sector 1. Other industries 7-12 are assigned to sector 2. The average ratios of wages to GDP in 2011 are calculated in the file: wages_GDP.xlsx Data from this file is used to produce Figure 1. B. Time series on the number of individuals with migration background is obtained from DESTATIS, Bev?lkerung mit Migrationshintergrund -- Ergebnisse des Mikrozensus, Fachserie 1, Reihe 2.2 The data for years 2005-2016 is collected in the file immigr_numbers_revised.xlsx Figure 3 is based on this data. 2.3. Estimation in Maple 2016 A. Unemployment rates and mismatch rates for high skill workers are manually transferred from Stata_log_file.log to files migration_sector1_rates_revised.mw (for sector 1) and migration_sector2_rates_revised.mw (for sector 2) to obtain the job-finding rates mL and mH as well as hiring multipliers hL and hH h_MI and h_MN in both sectors. Parameters obtained from these files are summarized in Tables 2 and 3. B. The multiplier on the matching function x=0.5801 is calculated in the file matching_function.mw and is based on the estimated elasticity parameter eta=0.4607 calculated in the file matching_function_revised.dta Parameters obtained from this file are summarized in Table 4. C. The job-finding rates mL and mH as well as hiring multipliers hL and hH h_MI and h_MN and matching function parameters from the file matching_fucntion.mw are manually inserted into files migration_sector1_wages_revised.mw and migration_sector2_wages_revised.mw. Running these files generates values of the following variables and parameters: Present values of vacancies VH and VL, bargaining powers bH and bL, flow costs of hiring cH and cL, productivities, wages and unemployment benefits of all workers groups separately in each sector. Parameters obtained from these files are summarized in Tables 5 and 6. D. All parameters and variables from the previous step are manually transferred into files sector_1_CD_revised.mw and sector_2_CD_revised.mw separately for every sector. Running these files produces parameter values of the Cobb-Douglas production function for each sector as well as prices p1 and p2. Parameters obtained from these files are summarized in Table 7. E. All parameters and variables from the previous step and both sectors are manually transferred into one file large_calibration_CD_revised.mw. Running this file allows us to calibrate the preference parameter of the utility function a1. Also Figure 4 is constructed in this file. F. Welfare values Omega are calculated for all worker groups in the file equilibrium_welfare_revised.mw These welfare values are used as a benchmark case. G. The empirical change in the stock of immigrants calculated in the Excel 2010 file immigr_numbers_revised.xlsx is introduced into the model in the file first_experiment_last_step.mw New welfare values for all worker groups are calculated and compared with the benchmark values from the previous step. Initial values of endogenous variables and their changes are summarized in Tables 8-11. H. Extension I on a frictionless labour market is conducted in file frictionless model calibration.mw This files generates parameters values summarized in Table 12. These parameters are manually transferred into file frictionless model equilibrium.mw, where we also calculate welfare values for all workers groups in a labour market without search frictions. Empirically observed increase in immigration is incorporated into this model in the file first experiment frictionless model.mw In this file we also calculate welfare changes summarized in Tables 13-14. I. Extension II on endogenous unemployment benefits is conducted in the file endog_unempl_benefits.mw Parameters from this file are summarized in Table 15. Welfare changes upon immigration are calculated in the file RED_Unemployment_Benefit_Exp1.nb in Mathematica 10.3 and summarized in Tables 16-17. J. Extension III where we estimate parameters of the CES production function with the elasticity of substitution parameter from D?Amuri et al. (2010) is conducted in the file calibration_dAmuri.mw Parameters from this file are summarized in Tables 18-19. Parameters from this file are manually transferred into file equilibrium_dAmuri.mw, where we also calculate welfare values of all worker groups in this model. Changes in endogenous variables as well as welfare in response to immigration are calculated in the file first_experiment_dAmuri. These changes are summarized in Tables 20-21. 3. The longest file takes no more than 1 minute to run. 4. We do not use random numbers.