Reduce time in generating a lot of graphs with edited title and legend in Stata

 

sum ln_aid_pop

local dv q179_china q181_dummy q182_china q183_china q184_dummy q185_dummy  

foreach var of local dv{

logit `var' c.ln_aid_pop##i.ethnic_chinese i.education i.income q1dummy q4dummy ln_distance capital,  cluster(province)

margins, at(ln_aid_pop=(-17(5)11) ethnic_chinese=0) at(ln_aid_pop=(-17(5)11) ethnic_chinese=1) post

marginsplot, title("Predictive Margins with 95% confidence interval") ///

subtitle("ethnic Chinese in Malaysia") xtitle(log(Aid/Population)) legend( order(2 "Chinese" 1 "non-Chinese") ring(0) pos(5))

graph export "`var'_Malaysia.png", as(png) replace


}


Comments

Popular Posts