Hello,
I'm, running a Regression Discontinuity in Time specification with time fixed effects such as monthly fixed effects. While there is no issue with the regression itself, the problem arises when I try to use twoway to plot the discontinuity.
Comparing the regression output with the plot, it's clear that the regression estimate is not reflected in the plot. Why is this the case? Notably, the plot using lfit does not change when I include fixed effects, hence this issue must be caused by including fixed effects.
If anyone knows any remedies to make the graph reflect the regression output, that'd be much appreciated. Below is some example code and a twoway plot.
Kind regards,
Angus
* Syphilis tests monthFE
reg Total time i.treatment c.time#i.treatment i.month if in_bandwidth, vce(robust)
estimates store Syphilistest
predict yhat_Syphilistest, xb
twoway (scatter Total time if in_bandwidth, mcolor(gs12) msymbol(o)) ///
(lfit yhat_Syphilistest time if treatment == 0 & in_bandwidth, lcolor(blue) lpattern(solid)) ///
(lfit yhat_Syphilistest time if treatment == 1 & in_bandwidth, lcolor(red) lpattern(solid)), ///
title("Syphilis Tests Over Time") ///
xlabel(#12) ///
ylabel(, angle(horizontal)) ///
xtitle("Months from August 2013") ///
ytitle("Syphilis test count") ///
xline(0, lcolor(black) lpattern(dash)) ///
legend(off) ///
name(Syphilistest, replace)


I'm, running a Regression Discontinuity in Time specification with time fixed effects such as monthly fixed effects. While there is no issue with the regression itself, the problem arises when I try to use twoway to plot the discontinuity.
Comparing the regression output with the plot, it's clear that the regression estimate is not reflected in the plot. Why is this the case? Notably, the plot using lfit does not change when I include fixed effects, hence this issue must be caused by including fixed effects.
If anyone knows any remedies to make the graph reflect the regression output, that'd be much appreciated. Below is some example code and a twoway plot.
Kind regards,
Angus
* Syphilis tests monthFE
reg Total time i.treatment c.time#i.treatment i.month if in_bandwidth, vce(robust)
estimates store Syphilistest
predict yhat_Syphilistest, xb
twoway (scatter Total time if in_bandwidth, mcolor(gs12) msymbol(o)) ///
(lfit yhat_Syphilistest time if treatment == 0 & in_bandwidth, lcolor(blue) lpattern(solid)) ///
(lfit yhat_Syphilistest time if treatment == 1 & in_bandwidth, lcolor(red) lpattern(solid)), ///
title("Syphilis Tests Over Time") ///
xlabel(#12) ///
ylabel(, angle(horizontal)) ///
xtitle("Months from August 2013") ///
ytitle("Syphilis test count") ///
xline(0, lcolor(black) lpattern(dash)) ///
legend(off) ///
name(Syphilistest, replace)