新手第一次作图,感觉非常垃圾……codes格外多,图也很不简洁美观。这个图的x轴是时间,y轴是死亡率,每个点是一个国家,然后我想看各个地区死亡率随年份的改变。
Codes在这里,求狠拍:
twoway (scatter infant_mortality cohort if geo=="Europe and Central Asia",msize(small)) ///
(scatter infant_mortality cohort if geo=="East, South and South-East Asia",msize(small)) ///
(scatter infant_mortality cohort if geo=="Sub-Saharan Africa",msize(small))///
(scatter infant_mortality cohort if geo=="Latin America and the Caribbean",msize(small)) ///
(scatter infant_mortality cohort if geo=="Middle East and North Africa",msize(small))///
(lfit infant_mortality cohort if geo=="Europe and Central Asia") ///
(lfit infant_mortality cohort if geo=="East, South and South-East Asia") ///
(lfit infant_mortality cohort if geo=="Sub-Saharan Africa")///
(lfit infant_mortality cohort if geo=="Latin America and the Caribbean") ///
(lfit infant_mortality cohort if geo=="Middle East and North Africa"),///
title("Infant Mortality by geographical regions") ///
xtitle("Year") ///
ytitle("Infant Mortality") ylabel(, angle(0)) ///
legend(label(1 "Europe and Central Asia") ///
label(2 "East, South and South-East Asia") ///
label(3 "Sub-Saharan Africa") ///
label(4 "Latin America and the Caribbean") ///
label(5 "Middle East and North Africa")///
label(6 "Fitted Value,Europe and Central Asia")///
label(7 "Fitted Value,East, South and South-East Asia")///
label(8 "Fitted Value,Sub-Saharan Africa")///
label(9 "Fitted Value,Latin America and the Caribbean") ///
label(10 "Fitted Value,Middle East and North Africa")///
size(small))///
graphregion(fcolor(white))