* choose a working directory and open the log file cd "/Users/bernardofanfani/Desktop/teaching/research_topics_labor/lab_6/sixth_lab" cap log close log using lecture6.log, replace *replication of Lalive, R. (2008). How do extended benefits affect unemployment duration? A regression discontinuity approach. Journal of Econometrics, 142(2), 785-806. *data available at: https://sites.google.com/site/rafaellalive/research ************************************************** ************************************************** * SOME PROGRAMS NEED TO BE INSTALLED TO RUN THE DO FILE. * the next commands install these programs, an internet connection is needed * once these commands are executed, there is no need to repeat the installation net install cmogram, from("http://fmwww.bc.edu/RePEc/bocode/c") replace net install st0085_2, from("http://www.stata-journal.com/software/sj14-2") replace net install rdrobust, from("http://fmwww.bc.edu/RePEc/bocode/r") replace ssc install rddensity, replace net install lpdensity, from("https://raw.githubusercontent.com/nppackages/lpdensity/master/stata") replace * end program installation ************************************************** ************************************************** * open the Lalive database use Lalive_2008_JE.dta, clear describe /* We use only the regions in which the reform on the duration of of unemployment, and only the period after the entry into force of the reform */ keep if tr==1 & period==1 /*** RDD using age as a running variable Study of an increase in the maximum duration of unemployment benefits * IMPORTANT. We separate the analysis between males and females. If females enter unemployment at age 50, with a duration of 229 weeks of the unemployment benefit they can then go directly into old-age retirement without returning to work. For men, this is not possible (the age of access to the pension of old age is higher for men) => the effect of the reform may be different for men and women, for women it is in fact the introduction of a pre-retirement ***/ ************************************************** ************************************************** * (A) GRAPHICAL ANALYSIS *** * HISTOGRAM OF THE RUNNING VARIABLE /* Is the density of the running variable (age) continuous around the threshold 50 years of age? Is there any evidence of manipulation? */ * men hist age if female == 0, name(male, replace) width(0.5) title("Funzione di densità, uomini") * women hist age if female == 1, name(female, replace) width(0.5) title("Funzione di densità, donne") /* There is a test for the continuity of distribution that is based on a semiparametric method: - more accurate density estimation around the threshold - Only observations that are at an optimal distance from the threshold (bandwidth) contribute to the density estimate We do not reject the continuity hypothesis for men (Pv=0.93) We reject the continuity hypothesis for women (Pv=0.00) */ rddensity age if female == 0, c(50) plot plot_ciuniform nohist rddensity age if female == 1, c(50) plot plot_ciuniform nohist *** * CONDITIONAL DISTRIBUTION OF THE PRE-DETERMINED VARIABLES. * Are these variables continuous at the 50-year threshold? * Is there evidence of different sample composition above/below the threshold? * MEN. * log wage in last job before unemployment. cmogram lwage_ljob age if female==0, cut(50) scatter line(50) lfitci noten title("Uomini, log salario nell'ultimo lavoro") * Marital status (married/married) cmogram marr age if female==0, cut(50) scatter line(50) lfitci noten * Education (=1 if highly educated) cmogram educ_hi age if female==0, cut(50) scatter line(50) lfitci noten * Occupation (=1 if white collar) cmogram white_collar age if female==0, cut(50) scatter line(50) lfitci noten * Sector (=1 if agriculture) cmogram landw age if female==0, cut(50) scatter line(50) lfitci noten * Sector (=1 if construction) cmogram bau age if female==0, cut(50) scatter line(50) lfitci noten * WOMEN * log wage in last job before unemployment. cmogram lwage_ljob age if female==1, cut(50) scatter line(50) lfitci noten title("Donne, log salario nell'ultimo lavoro") * Occupation (=1 if white collar) cmogram white_c age if female==1, cut(50) scatter line(50) lfitci noten *** * GRAPHICAL EVIDENCE ON THE EFFECT OF MAXIMUM BENEFIT DURATION ON UNEMPLOYMENT DURATION. * MEN cmogram unemployment_duration age if female==0, cut(50) scatter line(50) lfitci noten * WOMEN cmogram unemployment_duration age if female==1, cut(50) scatter line(50) lfitci noten ************************************************** ************************************************** * (B) REGRESSION ANALYSIS. * x is our running variable, it is convenient to express it as age-50 gen x = age - 50 gen x2 = x^2 gen x3 = x^3 gen x4 = x^4 gen x5 = x^5 * d is our treatment variable (50-year-olds are subject to a longer unemployment benefit) gen d = 1 if (x>=0) replace d = 0 if x<0 ************************************************** * CONTINUITY TEST PREDETERMINED VARIABLES * Are the pre-determined variables continuous at the 50-year threshold? * They are not if we observe a significant coefficient associated with d when the outcome is a predetermined variable * In this case we want it not to be significant * MEN. * Parametric approach (wage in last job). reg lwage_ljob d x x2-x3 if female == 0, robust reg lwage_ljob d x x2-x4 if female == 0, robust reg lwage_ljob d x x2-x5 if female == 0, robust * Non-parametric linear approach (wage in last job) reg lwage_ljob d x i.d#c.x if female == 0, robust * Non-parametric polynomial approach (wage in last job) reg lwage_ljob d x i.d#c.x x2 i.d#c.x2 if female == 0, robust reg lwage_ljob d x i.d#c.x x2 i.d#c.x2 x3 i.d#c.x3 if female == 0, robust * Non-parametric linear with choice of badwidth (distance from the 50-year threshold) less than 2 years (age range 48-52) reg lwage_ljob d x i.d#c.x if female == 0 & abs(x)<2, robust * Non-parametric linear with choice of badwidth (distance to 50-year threshold) endogenous, i.e., data-driven rdrobust lwage_ljob x if female == 0, c(0) * Quadratic nonparametric with endogenous badwidth rdrobust lwage_ljob x if female == 0, c(0) p(2) * EXERCISE: * 1) REPEAT AND INTERPRET THESE TESTS IN THE CASE OF WOMEN AND/OR WITH OTHER PRE-DETERMINED VARIABLES. * 2) TEST OTHER SPECIFICATIONS (DIFFERENT BANDWITH, POLYNOMIALS OF DIFFERENT DEGREES...) ************************************************** * EFFECT OF MAXIMUM BENEFIT DURATION ON UNEMPLOYMENT DURATION. * duration of unemployment is measured in weeks sum unemployment_duration if female==0 * MEN. * Parametric approach reg unemployment_duration d x x2-x3 if female == 0, robust reg unemployment_duration d x x2-x4 if female == 0, robust reg unemployment_duration d x x2-x5 if female == 0, robust * Non-parametric linear approach reg unemployment_duration d x i.d#c.x if female == 0, robust * Non-parametric polynomial approach reg unemployment_duration d x i.d#c.x x2 i.d#c.x2 if female == 0, robust reg unemployment_duration d x i.d#c.x x2 i.d#c.x2 x3 i.d#c.x3 if female == 0, robust * Non-parametric linear with choice of badwidth (distance from the 50-year threshold) less than 2 years (age range 48-52) reg unemployment_duration d x i.d#c.x if female == 0 & abs(x)<2, robust * Non-parametric linear with choice of badwidth (distance to 50-year threshold) endogenous, i.e., data-driven rdrobust lwage_ljob x if female == 0, c(0) * Quadratic nonparametric with endogenous badwidth. rdrobust unemployment_duration x if female == 0, c(0) p(2) ************************************************** ************************************************** * C) FUZZY RDD /* Let's use the reform on maximum benefit duration as an instrument for the variable "duration of unemployment." We want to estimate the relationship (post unemployment wage) = a + b (duration of unemployment) The hypothesis is that at the 50-year mark, the maximum duration of the unemployment benefit has an influence on the post-unemployment wage only because it has an influence on the duration of the unemployment period (validity IV) */ ************************************************** * GRAPHICAL EVIDENCE * effect of benefit duration on unemployment duration (first-stage) cmogram unemployment_duration age if female==0, cut(50) scatter line(50) lfitci noten * effect of benefit duration on post unemployment wage (second-stage) cmogram rwage age if female==0, cut(50) scatter line(50) lfitci noten ************************************************** * REGRESSIONS * First-Stage reg unemployment_duration d x 1.d#c.x if female == 0 & abs(x)<2, robust test d * Reduced-form reg rwage d x 1.d#c.x if female == 0 & abs(x)<2, robust * 2nd Stage (NB: b_iv = b_reduced / b_first) ivreg2 rwage (unemployment_duration = d) x 1.d#c.x if female == 0 & abs(x)<2, robust log close