I am constructing scatterplots with LOWESS curves fit over them. I have done this successfully with several groups of data, but one set is giving me problems. The LOWESS curve extends beyond the y range of the scatterplot. I've tried all sorts of y range commands, but nothing seems to work. How do I limit the y range of the LOWESS, or perhaps the trick is to limit the x range, which I've tried as well? I've attached an example of graph that works well and the graph that isn't working. All uses same code, just different data. The lowest value of USD_1996 is 10,000, so I don't understand why the LOWESS is plunging so low.
Thank you,
Clay Bavinger
University of Michigan
Code:
twoway /// (scatter USD_1996 DALY_1996, mlabel(display_name) mlabgap(3.5) msymbol(O) mcolor(blue) mlabcolor(blue) mlabvp(position_label) title("All Continents") msize(small) ytitle("Child Health Aid") yscale(log) ylabel(10000 "< $10,000" 10000000 "$10 Million" 10000000000 "$10 Billion", angle(0)) ysc(r(10000 10000000000)) xsc(r(0330000000)) xlabel(160000000 "160 Million" 320000000 "320 Million" , angle(0)) xtitle("DALY")) /// (lowess USD_1996 DALY_1996, ysc(r(1000 100000000)) ylabel(10000 "< $10,000" 10000000 "$10 Million" 10000000000 "$10 Billion", angle(0)) ysc(r(10000 10000000000)) lwidth(thin) lcolor(blue) yscale(log) bwidth(.6))
Thank you,
Clay Bavinger
University of Michigan
Comment