我正在使用Stata 中的coefplot
命令(source,docs)绘制类别上连续变量的方法。
可重复的小例子:
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")
还有其他可能吗?