我正在使用coefplot命令(来源,文档)来绘制连续变量在cateories上的绘图方法。
可报道的小例子:
sysuse auto, clear
drop if rep78 < 3
la de rep78 3 "Three" 4 "Four" 5 "Five"
la val rep78 rep78
mean mpg if foreign == 0, over(rep78)
eststo Domestic
mean mpg if foreign == 1, over(rep78)
eststo Foreign
su mpg, mean
coefplot Domestic Foreign , xtitle(Mpg) xline(`r(mean)') 给我的结果:

我想要添加的是一个额外的‘组’标签的Y轴。尝试回归示例中的选项似乎不起作用:
coefplot Domestic Foreign , headings(0.rep78 = "Repair Record 1978")
coefplot Domestic Foreign , groups(?.rep78 = "Repair Record 1978")还有其他的可能性吗?
发布于 2015-07-02 14:05:07
这似乎能胜任这项工作。
coefplot Domestic Foreign , xtitle(Mpg) xline(`r(mean)') ///
groups(Three Four Five = "Repair Record 1978")但是,我不知道它将如何处理带有相同标签的分类变量的情况?
https://stackoverflow.com/questions/31186101
复制相似问题