cd "/Users/bernardofanfani/Desktop/teaching/research_topics_labor/lab_4/fourth_lab/" log using example_late.log, replace ********* * ESTIMATING LATE WITH AN RCT use "rapporti_lavoro_2001.dta", clear su retrib03 * define a treatment that gives a positive shock on income of approximately 10%, and which has a given variability across individuals (10% of the income standard deviation) ge treatment=rnormal(`r(mean)'/10, `r(sd)'/10) * there is a lottery that gives access to the treatment with 50% probability ge lottery=runiform()<.5 * however, only 50% of the lottery winners actually get the treatment (the compliers) ge compliers=runiform()<.5 & lottery==1 * thus, only compliers have non-zero treatment effect replace treatment = 0 if compliers!=1 * let's add the treatment effect to the income variable replace retrib03=retrib03+treatment * expected LATE su treatment if compliers * expected Intent to Treat su treatment if lottery * let's check if the ITT and LATE models estimate the correct parameter reg retrib03 lottery ivregress 2sls retrib03 (compliers=lottery) log close