In: Statistics and Probability
Stata command for running an RDD with 2 treamtents and cut-off lines
// Before program participation set seed 2 set obs 1000 range x_obs -1 1 1000 g y_pre = x_obs^3 + rnormal() tw scatter y_pre x_obs, msize(small) mcolor(gs10) /// || lfit y_pre x_obs, range(-.35 .35) lcolor(black) lw(thick) /// xline(0, lpattern(-)) /// yt("Outcome variable (Y)") /// xt("Assignment variable (X)") /// t("Before program participation") /// legend(off) /// xline(-.35 .35, lp(-) lc(gs10)) /// text(-4.5 -.35 "{it:-h}") /// text(-4.5 +.35 "{it:h}") // After program participation set seed 2 local tau = 1.25 cap drop y_post g y_post= x +`tau' + rnormal() if x=0 tw scatter y_post x_obs, msize(small) mcolor(gs10) yl(-4(2)4) /// || lfit y_post x_obs if inrange(x_obs, -.35, 0), /// range(-.35 0 ) lcolor(black) lw(thick) /// || lfit y_post x_obs if inrange(x_obs, 0, .35), /// range(0 .35 ) lcolor(black) lw(thick) /// xline(0, lpattern(-)) /// yt("Outcome variable (Y)") /// xt("Assignment variable (X)") /// t("After program participation") /// legend(off) /// text(.9 0.05 "{&tau}", size(*2)) /// xline(-.35 .35, lp(-) lc(gs10)) /// text(-4.5 -.35 "{it:-h}") /// text(-4.5 +.35 "{it:h}")