I'm trying to make a plot that shows both the scatter and line of best fit; x=regional hospital HHI, y = share of people enrolled in silver or below insurance plans. I used lfitci because I want the confidence interval to show on the graph. However, the graph that's produced doesn't have the gray shaded region repping the confidence interval. What should I do about this?
My code is
foreach l of numlist 2014/2019{
graph twoway (scatter sh_silverbelow_regyr region_hhi [fweight=ccenroll_regyr], graphregion(fcolor(gs16)) msize(small) msymbol(circle_hollow) mcolor(dknavy)) ///
(lfitci sh_silverbelow_regyr region_hhi [fweight=ccenroll_regyr]) ///
if year==`l' & silvtag==1, ///
title(`l' Share Silver or Lower) xtitle("Region HHI") ytitle("% silver or lower") ///
note("Circles show relative population of each regional market.")
graph export "${silverfigure}/`l'silver_lower_hhi - new.pdf", replace
}
I created the silvtag variable (it's a tag variable flagging the first observation of region-year-regional silver/below share for that year so it would take less time to loop through all the data since it contains over 7 million observations. But I don't believe that should matter in this case because the silver/below shares are calculated at the region-year level and every observation for that region-year will have the same value for that variable.
My code is
foreach l of numlist 2014/2019{
graph twoway (scatter sh_silverbelow_regyr region_hhi [fweight=ccenroll_regyr], graphregion(fcolor(gs16)) msize(small) msymbol(circle_hollow) mcolor(dknavy)) ///
(lfitci sh_silverbelow_regyr region_hhi [fweight=ccenroll_regyr]) ///
if year==`l' & silvtag==1, ///
title(`l' Share Silver or Lower) xtitle("Region HHI") ytitle("% silver or lower") ///
note("Circles show relative population of each regional market.")
graph export "${silverfigure}/`l'silver_lower_hhi - new.pdf", replace
}
I created the silvtag variable (it's a tag variable flagging the first observation of region-year-regional silver/below share for that year so it would take less time to loop through all the data since it contains over 7 million observations. But I don't believe that should matter in this case because the silver/below shares are calculated at the region-year level and every observation for that region-year will have the same value for that variable.
Comment