当前,我有以下代码:
sysuse auto, clear
estimates clear
gen year=.
replace year=1988 if foreign==0
replace year=1989 if foreign==1
regress price mpg trunk length turn if year==1988
estimates store Year1988
regress price mpg trunk length turn if year==1989
estimates store Year1989
coefplot Year1988 Year1989, vertical keep(trunk) xline(0) xlabel("")
这将生成:
但是,我想为每个存储的回归结果集(如:
)添加自定义名称我该怎么做?我尝试了xtick
和xlabel
,但没有用。
请注意:here可以找到没有vertical
选项的答案。
答案 0 :(得分:1)
想法是相同的:
sysuse auto, clear
estimates clear
gen year=.
replace year=1988 if foreign==0
replace year=1989 if foreign==1
regress price mpg trunk length turn if year==1988
estimates store Year1988
regress price mpg trunk length turn if year==1989
estimates store Year1989
local gap1 : display _dup(45) " "
local gap2 : display _dup(40) " "
coefplot Year1988 Year1989, vertical keep(trunk) xline(0) ///
coeflabels(trunk = `""|`gap1'|""1988`gap2'1989""') ///
xlabel(, notick labgap(0)) xline(0) legend(off)