Stata coefplot:将回归名称放在y轴上
以下代码将生成系数图:Stata coefplot:将回归名称放在y轴上,stata,Stata,以下代码将生成系数图: sysuse auto, clear regress price mpg trunk length turn if foreign==0 estimates store D regress price mpg trunk length turn if foreign==1 estimates store F coefplot D F, drop(_cons) xline(0) 但是,我想在y轴上为每个存储的回归结果集设置自定义名称: 我尝试了各种有关缩放和标签的方法
sysuse auto, clear
regress price mpg trunk length turn if foreign==0
estimates store D
regress price mpg trunk length turn if foreign==1
estimates store F
coefplot D F, drop(_cons) xline(0)
但是,我想在y轴上为每个存储的回归结果集设置自定义名称:
我尝试了各种有关缩放和标签的方法,如xrescale
,但都失败了
编辑: 我无意重复
国内
和国外
。我只想保留行李箱
。
所有其他系数都不是必需的。所以
国内
和国外
只会出现一次。我认为这是一个糟糕的想法。如果您不断重复国内/国外,则读者无法知道每个变量对应哪一对
这里有一个更好的方法:
sysuse auto, clear
estimates clear
regress price mpg trunk length turn if foreign==0
estimates store D
regress price mpg trunk length turn if foreign==1
estimates store F
coefplot (D, asequation(Domestic) \ F, asequation(Foreign)), drop(_cons) xline(0)
或者:
coefplot (D, asequation \ F, asequation), drop(_cons) xline(0) ///
eqlabels("Domestic" "Foreign", asheadings)
编辑: 实现目标的唯一方法是使用以下技巧:
coefplot D F, drop(_cons mpg length turn) ///
coeflabels(trunk = `""Domestic -" " " " " " " " " " " " " " " "Foreign -""') ///
ylabel(, notick labgap(0)) xline(0) legend(off)
显然,您必须根据不同的用例对其进行调整