Dear all
I have a twoway graph with a scatter plot and a second order fitted polynomial. I tried restricting the scale and label of the y-axis to begin from 0 but because the fitted polynomial has negative values, it did not work. Is there a way to either impose that the polynomial must have positive values or to avoid any negative values in the y-axis to be plotted?
I have a twoway graph with a scatter plot and a second order fitted polynomial. I tried restricting the scale and label of the y-axis to begin from 0 but because the fitted polynomial has negative values, it did not work. Is there a way to either impose that the polynomial must have positive values or to avoid any negative values in the y-axis to be plotted?
Code:
twoway lpolyci percap_pri prop60plus if year==2015, degree(2) nofit color(%40) || /// scatter percap_pri1 prop60plus1 if year==2015, /// msymbol(p) mla(location) mlabsiz(1.8) mcolor(blue*1.3) mlabcol(blue*1.3) || /// scatter percap_pri2 prop60plus2 if year==2015, /// msymbol(o) mla(location) mlabsiz(1.8) mcolor(red*1.2) mlabcol(red*1.2) /// ytitle("private health spending per capita") xtitle("% population > 60 years old") /// ylab(0(1000)5000, grid) ysc(range(0 5000)) ylab(,labsize(vsmall) format(%15.0fc)) /// xlab(0(5)35, grid) xsc(range(0 35)) xlab(,labsize(vsmall)) /// graphregion(color(white)) legend(off) name(graf_disp_pri, replace)
Comment