* Lab session 5 * choose the working directory cd "/Users/bernardofanfani/Desktop/teaching/research_topics_labor/lab_5/fifth_lab" cap log close log using lesson_5.log, replace * this command is used to install the ivreg2 program. * caution, you need an internet connection for this command to work * once ivreg2 is installed, it is unnecessary to repeat the installation ssc install ivreg2, replace //***// ANGRIST & KRUEGER 1991 //***// //***// DOES COMPULSORY SCHOOL ATENDANCE AFFECT SCHOOLING AND EARNINGS? //***// use "NEW7080_class.dta", clear des * quarter of birth (this is our instrument) tab QOB * structural equation (the equation of interest we want to estimate) reg LWKLYWGE EDUC AGE AGEQSQ * since EDUC is endogenous, I use the trimester of birth as the instrument (Z) * First-Stage reg EDUC i.QOB AGE AGEQSQ, robust * Are instrumental variables relevant? (do they explain the variation in X?) * we can test the hypothesis with an F-test. *(H0: the coefficients associated with each quarter of birth are all equal to zero) test 1.QOB = 2.QOB = 3.QOB = 4.QOB = 0 * now we estimate the predicted values of the first-stage regression cap drop educ_hat1 predict educ_hat1, xb * one way to obtain the estimated IV coefficient is as follows. * with this procedure the standard error is incorrect reg LWKLYWGE educ_hat1 AGE AGEQSQ, robust * to correctly estimate the IV coefficient and standard error ivreg2 LWKLYWGE AGE AGEQSQ (EDUC = i.QOB), robust ************ * MONOTONICITY ASSUMPTION * this analysis is not part of the original paper results * maybe the Monotonicity assumption is not likely to be satisfied, because being born in Jan-March could be negatively correlated with education among drop-outs, but it also has a positive effect on school performance (thus schooling) among those that stay longer in school and obtain a higher education (this would also be a violation of the exclusion restriction, i.e. instrument validity) * first check if QUOB has the same effect for different education levels * NB: THIS IS NOT A FORMAL TEST ON THE MONOTONICITY ASSUMPTION (WHICH IS UNTESTABLE) * IT IS MORE OF A ROBUSTNESS CHECK (HEURISTIC TEST) reg EDUC i.QOB AGE AGEQSQ if inrange(EDUC,0,11), robust reg EDUC i.QOB AGE AGEQSQ if inrange(EDUC,12,20), robust * indeed it seems that quarter of birth has an opposite effect on schooling among likely drop-outs and among higher-educated people * let's estimate the IV separately for the two groups ivreg2 LWKLYWGE AGE AGEQSQ (EDUC = i.QOB) if inrange(EDUC,0,11), robust ivreg2 LWKLYWGE AGE AGEQSQ (EDUC = i.QOB) if inrange(EDUC,12,20), robust * THE INSTRUMENT IS WEAK IN BOTH SPECIFICATIONS (WEAKER ABOVE 12 YEARS OF EDUCATION) * BELOW 12 YEARS OF EDUCATION THE MAIN RESULT IS SIMILAR TO THE FULL-SAMPLE RESULT * IT SEEMS THAT THE IV RESULT IS DRIVEN BY LOW EDUCATED (DROP-OUTS) cap log close