------------------------------------------------------------------------------------------------------------------------------------------- name: log: /Users/bernardofanfani/Desktop/teaching/research_topics_labor/lab_4/fourth_lab/example_late.log log type: text opened on: 1 Nov 2024, 10:45:08 . . ********* . * ESTIMATING LATE WITH AN RCT . . use "rapporti_lavoro_2001.dta", clear . . su retrib03 Variable | Obs Mean Std. dev. Min Max -------------+--------------------------------------------------------- retrib03 | 610,951 37372.78 24332.5 479 399924 . . * 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 (457,894 real changes made) . . * let's add the treatment effect to the income variable . replace retrib03=retrib03+treatment (153,057 real changes made) . . * expected LATE . su treatment if compliers Variable | Obs Mean Std. dev. Min Max -------------+--------------------------------------------------------- treatment | 153,057 3729.075 2438.309 -7245.364 14267.17 . * expected Intent to Treat . su treatment if lottery Variable | Obs Mean Std. dev. Min Max -------------+--------------------------------------------------------- treatment | 305,826 1866.293 2540.073 -7245.364 14267.17 . . * let's check if the ITT and LATE models estimate the correct parameter . reg retrib03 lottery Source | SS df MS Number of obs = 610,951 -------------+---------------------------------- F(1, 610949) = 869.87 Model | 5.1778e+11 1 5.1778e+11 Prob > F = 0.0000 Residual | 3.6366e+14 610,949 595244366 R-squared = 0.0014 -------------+---------------------------------- Adj R-squared = 0.0014 Total | 3.6418e+14 610,950 596090899 Root MSE = 24398 ------------------------------------------------------------------------------ retrib03 | Coefficient Std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- lottery | 1841.202 62.42733 29.49 0.000 1718.847 1963.558 _cons | 37385.34 44.1681 846.43 0.000 37298.78 37471.91 ------------------------------------------------------------------------------ . ivregress 2sls retrib03 (compliers=lottery) Instrumental variables 2SLS regression Number of obs = 610,951 Wald chi2(1) = 872.43 Prob > chi2 = 0.0000 R-squared = 0.0044 Root MSE = 24362 ------------------------------------------------------------------------------ retrib03 | Coefficient Std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- compliers | 3678.94 124.5539 29.54 0.000 3434.819 3923.061 _cons | 37385.34 44.10319 847.68 0.000 37298.9 37471.78 ------------------------------------------------------------------------------ Instrumented: compliers Instruments: lottery . . log close name: log: /Users/bernardofanfani/Desktop/teaching/research_topics_labor/lab_4/fourth_lab/example_late.log log type: text closed on: 1 Nov 2024, 10:45:10 -------------------------------------------------------------------------------------------------------------------------------------------