Hi, Everyone,
I'm trying to create a figure plotting the independent variable and dependent variable showing the difference by two groups by a cutoff point of the independent variable (sort of a regression discontinuity combined with dif-in-dif). I have tried different ways but couldn't figure out how to consolidate the labels in the legend for the four plots.
The data I'm using is simply for illustration purposes.
In the code below, the two groups are smaller household(<=262) VS bigger household (>262), dependent variable is income_pc, and I want to show how the relationship between income_pc and fips vary by a cutoff point of the independent variable (fips=252800) in two groups.
In the figure generated from this code, how do I consolidate the legend to showing only one label for 95% CI, one label for orange line (smaller household), and one label for blue line (bigger household)?
I'm trying to create a figure plotting the independent variable and dependent variable showing the difference by two groups by a cutoff point of the independent variable (sort of a regression discontinuity combined with dif-in-dif). I have tried different ways but couldn't figure out how to consolidate the labels in the legend for the four plots.
The data I'm using is simply for illustration purposes.
In the code below, the two groups are smaller household(<=262) VS bigger household (>262), dependent variable is income_pc, and I want to show how the relationship between income_pc and fips vary by a cutoff point of the independent variable (fips=252800) in two groups.
In the figure generated from this code, how do I consolidate the legend to showing only one label for 95% CI, one label for orange line (smaller household), and one label for blue line (bigger household)?
Code:
use http://www.stata-press.com/data/r7/emd.dta twoway (lpolyci income_pc fips if hhsize<=262 & fips<=252800 , clcolor(orange))(lpolyci income_pc fips if hhsize<=262 & fips>252800, clcolor(orange))(lpolyci income_pc fips if hhsize>262 & fips<=252800, clcolor(blue))(lpolyci income_pc fips if hhsize>262 & fips>252800, clcolor(blue))
Comment