更改图的示例等:
graph twoway (lfit rincom98 edcat if sex==1,sort clwidth(thick) clpattern(solid) clcolor(blue))(lfit rincom98 edcat if sex==0,sort clwidth(thick) clpattern(solid) clcolor(red)),title("Relationship between income and education") legend(order(1 "男" 2 "女") cols(1) ring(0) position(11)) ytitle("income") xtitle("education") saving(exercise5.jpg,replace) //拟合直线
更加详细的内容可以参见:
https://zhuanlan.zhihu.com/p/35900875