发布
社区首页 >问答首页 >获取coefplot以使用评估标题或结果标签

获取coefplot以使用评估标题或结果标签
EN

Stack Overflow用户
提问于 2017-08-23 13:51:01
回答 1查看 282关注 0票数 0

考虑以下使用社区贡献的Stata命令coefplot的玩具示例

代码语言:javascript
代码运行次数:0
复制
sysuse auto

reg weight i.foreign
eststo, title("Weight"): margins, eydx(foreign) post

reg price i.foreign
eststo, title("Price"): margins, eydx(foreign) post

coefplot est1 est2, horizontal

有没有可能在图例中获得标题(甚至是变量标签),而不是估计名称(即WeightPrice而不是est1est2)?

我知道如何手动操作,但我不知道如何在许多模型中自动完成此操作。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-04-15 20:39:33

使用estimates store而不是eststo可以做到这一点:

代码语言:javascript
代码运行次数:0
复制
clear
sysuse auto

reg weight i.foreign
margins, eydx(foreign) post
estimates store weight

reg price i.foreign
margins, eydx(foreign) post
estimates store price

coefplot weight price, horizontal

类似地,使用listfor循环:

代码语言:javascript
代码运行次数:0
复制
local list_of_names weight price

foreach item of local list_of_names {
    reg `item' i.foreign
    margins, eydx(foreign) post
    estimates store `item'      
}

coefplot `list_of_names', horizontal

当然,您可以为变量名和‘lists’使用两种不同的标签。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45831575

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档