Hi,
I am running the code below and it generates and plots four lines. Instead, I want to plot bands of the confidence interval for each line (l4, l8, l12 and lboth). How to do that?
reg smean byr byrsq test1 test2 test3 test4 if ES & math
gen l4 =_b[_cons]+_b[byr]*byr + _b[byrsq]*byrsq if ES & math
reg smean byr byrsq test1 test2 test3 test4 if MS & math
gen l8 =_b[_cons]+_b[byr]*byr + _b[byrsq]*byrsq if MS & math
reg smean byr byrsq test1 test2 test3 test4 if HS & math
gen l12 =_b[_cons]+_b[byr]*byr + _b[byrsq]*byrsq if HS & math
reg smean byr byrsq test1 test2 test3 test4 ES MS HS if math
gen lboth =_b[_cons]+_b[byr]*byr + _b[byrsq]*byrsq
sort birthyr
twoway (scatter l4 birthyr if ES, msize(vsmall) connect(l) mcolor(red) lcolor(red)) ///
(scatter l8 birthyr if MS, msize(vsmall) connect(l) mcolor(navy) lcolor(navy)) ///
(scatter l12 birthyr if HS, msize(vsmall)connect(l) mcolor(dkgreen) lcolor(dkgreen)) ///
(scatter lboth birthyr, msize(vsmall) connect(l) mcolor(maroon) lcolor(maroon) ///
title("Levels for four categories", size(small)) xtitle("Year", size(small)) legend(off) xlabel(1900(10)2000, labsize(small)) ///
ytitle("Mean value", size(small)) ylab(-.8(.1).5, labsize(small) angle(horizontal)) ///
name(fig5, replace) yscale(titlegap(*-20)) ///
text(.1 1980 "first case", size(2) color(red)) ///
text(.13 1986 "second case", size(2) color(navy)) ///
text(-.02 1990 "third case", size(2) color(dkgreen)) ///
text(.13 1997 "Combined", size(2) color(maroon)))
I am running the code below and it generates and plots four lines. Instead, I want to plot bands of the confidence interval for each line (l4, l8, l12 and lboth). How to do that?
reg smean byr byrsq test1 test2 test3 test4 if ES & math
gen l4 =_b[_cons]+_b[byr]*byr + _b[byrsq]*byrsq if ES & math
reg smean byr byrsq test1 test2 test3 test4 if MS & math
gen l8 =_b[_cons]+_b[byr]*byr + _b[byrsq]*byrsq if MS & math
reg smean byr byrsq test1 test2 test3 test4 if HS & math
gen l12 =_b[_cons]+_b[byr]*byr + _b[byrsq]*byrsq if HS & math
reg smean byr byrsq test1 test2 test3 test4 ES MS HS if math
gen lboth =_b[_cons]+_b[byr]*byr + _b[byrsq]*byrsq
sort birthyr
twoway (scatter l4 birthyr if ES, msize(vsmall) connect(l) mcolor(red) lcolor(red)) ///
(scatter l8 birthyr if MS, msize(vsmall) connect(l) mcolor(navy) lcolor(navy)) ///
(scatter l12 birthyr if HS, msize(vsmall)connect(l) mcolor(dkgreen) lcolor(dkgreen)) ///
(scatter lboth birthyr, msize(vsmall) connect(l) mcolor(maroon) lcolor(maroon) ///
title("Levels for four categories", size(small)) xtitle("Year", size(small)) legend(off) xlabel(1900(10)2000, labsize(small)) ///
ytitle("Mean value", size(small)) ylab(-.8(.1).5, labsize(small) angle(horizontal)) ///
name(fig5, replace) yscale(titlegap(*-20)) ///
text(.1 1980 "first case", size(2) color(red)) ///
text(.13 1986 "second case", size(2) color(navy)) ///
text(-.02 1990 "third case", size(2) color(dkgreen)) ///
text(.13 1997 "Combined", size(2) color(maroon)))
Comment