clear cd "/Users/vojtabartos/Documents/4 Teaching/2017 Development Economics LMU/Tutorials/Exercise 1/Data/" import delimited "pwt61_data.csv", delimiter(";") set more off keep if year==1960 | year==1985 *rename ïcountry country /* Let's definte the variables as in MRW: */ * Tease the number of workers from the fact that we have GDP per worker as well as GDP per person gen workers = rgdpch*pop/rgdpwok *Y/L: real GDP divided by the working-age population gen y_l = (cgdp*pop)/workers * n: average rate of growth of working-age population (annual) reshape wide pop xrat ppp cgdp cc ci cg p pc pg pi openc cgnp csave y rgdpl rgdpch rgdpeqa rgdpwok rgdptt openk kc kg ki grgdpch y_l workers, i(country) j(year) *gen n=exp(ln(pop1985/pop1960)/(1985-1960))-1 gen n=ln(pop1985/pop1960)/(1985-1960) * s: average share of real investment (including government investment) in real GDP gen s1985=((ci1985+cg1985+ci1960+cg1960)/2)/100 * g and delta: g+delta is assumed to be 0.05 gen g_d=0.05 * generate variables for regressions gen ln_y_l1960=log(y_l1960) gen ln_y_l1985=log(y_l1985) gen ln_s1985=log(s1985) gen ln_n_g_d=log(n+g_d) * generate sub-samples gen intermediate= country=="Algeria" | country=="Argentina" | country=="Australia" | country=="Austria" | country=="Bangladesh" | country=="Belgium" | country=="Bolivia" | country=="Botswana" | country=="Brazil" | country=="Burma" | country=="Cameroon" | country=="Canada" | country=="Chile" | country=="Colombia" | country=="Costa Rica" | country=="Cote d`Ivoire" | country=="Denmark" | country=="Dominican Republic" | country=="Ecuador" | country=="El Salvador" | country=="Ethiopia" | country=="Finland" | country=="France" | country=="Germany" | country=="Greece" | country=="Guatemala" | country=="Haiti" | country=="Honduras" | country=="Hong Kong" | country=="India" | country=="Indonesia" | country=="Ireland" | country=="Israel" | country=="Italy" | country=="Jamaica" | country=="Japan" | country=="Jordan" | country=="Kenya" | country=="Korea, Republic of" | country=="Madagascar" | country=="Malawi" | country=="Malaysia" | country=="Mali" | country=="Mexico" | country=="Morocco" | country=="Netherlands" | country=="New Zealand" | country=="Nicaragua" | country=="Nigeria" | country=="Norway" | country=="Pakistan" | country=="Panama" | country=="Paraguay" | country=="Peru" | country=="Philippines" | country=="Portugal" | country=="Senegal" | country=="Singapore" | country=="South Africa" | country=="Spain" | country=="Sri Lanka" | country=="Sweden" | country=="Switzerland" | country=="Syria" | country=="Tanzania" | country=="Thailand" | country=="Trinidad &Tobago" | country=="Tunisia" | country=="Turkey" | country=="United Kingdom" | country=="United States" | country=="Uruguay" | country=="Venezuela" | country=="Zambia" | country=="Zimbabwe" gen oecd= country=="Australia" | country=="Austria" | country=="Belgium" | country=="Canada" | country=="Denmark" | country=="Finland" | country=="France" | country=="Germany" | country=="Greece" | country=="Ireland" | country=="Italy" | country=="Japan" | country=="Netherlands" | country=="New Zealand" | country=="Norway" | country=="Portugal" | country=="Spain" | country=="Sweden" | country=="Switzerland" | country=="Turkey" | country=="United Kingdom" | country=="United States" /* Importantly, we assume that the countries have reached the steady state in 1985 or that their deviations from steady state are random with mean zero. We try to explain cross-country differences by differences in the determinants of the steady state: capital accummulation and population growth. What are the assumptions we have to make so that OLS is a valid estimator? We assume that the rates of saving and population growth are independent of country-specific factors shifting the production function. That is, we assume that s and n are independent of e. This assumption implies that we can estimate equation (7) with ordinary least squares (OLS).*/ * UNRESTRICTED MODEL reg ln_y_l1985 ln_s1985 ln_n_g_d if intermediate outreg2 using "table1.xls" , replace dec(2) se test ln_s1985-ln_n_g_d=0 reg ln_y_l1985 ln_s1985 ln_n_g_d if oecd outreg2 test ln_s1985-ln_n_g_d=0 * RESTRICTED MODEL * see calculations, the coefficient for ln_sk and ln_n_g_d should have the same size and opposing signs * thus we impose the following restriction (just rewrite the model) gen ln_s1985_ln_n_g_d=ln_s1985-ln_n_g_d reg ln_y_l1985 ln_s1985_ln_n_g_d if intermediate outreg2 nlcom (alpha: (_b[ln_s1985_ln_n_g_d]/(_b[ln_s1985_ln_n_g_d]+1))), post test _b[alpha] = 1/3 reg ln_y_l1985 ln_s1985_ln_n_g_d if oecd outreg2 nlcom (alpha: (_b[ln_s1985_ln_n_g_d]/(_b[ln_s1985_ln_n_g_d]+1))), post test _b[alpha] = 1/3 /* What can we learn from the alphas? Because the model predicts that factors are paid their marginal products, it predicts not only the signs but also the magnitudes of the coefficients on saving and population growth. Specifically, because capital's share in income ($\alpha$) is roughly one third, the model implies an elasticity of income per capita with respect to the saving rate of approximately 0.5 and an elasticity with respect to $n + g + \delta$ of approximately -0.5. To see why: (1/3)/(1-1/3)=0.5 [...] If OLS yields coefficients that are substantially different from these values, then we can reject the joint hypothesis that the Solow model and our identifying assumption are correct.*/ ******************** * Convergence gen ln_y_l_diff=ln_y_l1985-ln_y_l1960 * Unconditional convergence reg ln_y_l_diff ln_y_l1960 if intermediate outreg2 using "table2.xls" , replace dec(2) se reg ln_y_l_diff ln_y_l1960 if oecd outreg2 * Conditional convergence * unrestricted reg ln_y_l_diff ln_y_l1960 ln_s1985 ln_n_g_d if intermediate outreg2 * this will be used for the graphs later predict ln_gdppw_diff_conditional_inter local r2_inter: display %5.2f e(r2) reg ln_y_l_diff ln_y_l1960 ln_s1985 ln_n_g_d if oecd outreg2 * this will be used for the graphs later predict ln_gdppw_diff_conditional_oecd local r2_oecd: display %5.2f e(r2) * restricted reg ln_y_l_diff ln_y_l1960 ln_s1985_ln_n_g_d if intermediate outreg2 nlcom (lambda: (-(ln(_b[ln_y_l1960]+1)/(1985-1960)))), post test _b[lambda] = 0 reg ln_y_l_diff ln_y_l1960 ln_s1985_ln_n_g_d if oecd outreg2 nlcom (lambda: (-(ln(_b[ln_y_l1960]+1)/(1985-1960)))), post test _b[lambda] = 0 * Graphs graph twoway (scatter ln_gdppw_diff_conditional_inter ln_y_l1960, mlabel(country_isocode)) (lfit ln_gdppw_diff_conditional_inter ln_y_l1960) if intermediate, note(R-squared=`r2_inter') title("Intermediate") graph twoway (scatter ln_gdppw_diff_conditional_oecd ln_y_l1960, mlabel(country_isocode)) (lfit ln_gdppw_diff_conditional_oecd ln_y_l1960) if oecd, note(R-squared=`r2_oecd') title("OECD") * Include human capital preserve use BL2013.dta, clear rename WBcode country_isocode keep if year==1960 keep if agefrom==15 & ageto==999 save bl_educ.dta, replace restore merge 1:1 country_isocode using bl_educ.dta gen school=(ls+lh)/100 reg ln_y_l_diff ln_y_l1960 ln_s1985 ln_n_g_d school if intermediate outreg2 reg ln_y_l_diff ln_y_l1960 ln_s1985 ln_n_g_d school if oecd outreg2