Hello,
I am working on a regression discontinuity design, and trying to create graphs that contain a binned scatterplot, and a regression line on each side of the cutoff with confidence intervals (for the regression lines themselves, not the individual bins), like in the image below. I cannot figure out how to do this, and have looked into the following:
- Binscatter does not have an option for adding confidence intervals.
- Binsreg and rdplot can only add confidence intervals for each bin, and not for the regression lines.
- Twoway lfitci creates the regression lines and confidence intervals I need, but is not compatible with binscatter, binsreg or rdrobust. Combining twoway lfitci with scatter is not an option, since I have a large dataset and need the scatterplot to be in bins.
I cannot find a solution, any help would be greatly appreciated!
Best,
Asdis
-
I am working on a regression discontinuity design, and trying to create graphs that contain a binned scatterplot, and a regression line on each side of the cutoff with confidence intervals (for the regression lines themselves, not the individual bins), like in the image below. I cannot figure out how to do this, and have looked into the following:
- Binscatter does not have an option for adding confidence intervals.
- Binsreg and rdplot can only add confidence intervals for each bin, and not for the regression lines.
- Twoway lfitci creates the regression lines and confidence intervals I need, but is not compatible with binscatter, binsreg or rdrobust. Combining twoway lfitci with scatter is not an option, since I have a large dataset and need the scatterplot to be in bins.
I cannot find a solution, any help would be greatly appreciated!
Best,
Asdis
-