1

如何标记/重命名 y 轴上的变量?

sysuse auto, clear
regress price mpg trunk length turn if foreign==0
estimates store Option1
regress price mpg trunk length turn if foreign==1
estimates store Option2
coefplot Option1 Option2, drop(_cons) xline(1)

这个coefplot 中没有一个选项:将回归的名称放在 y 轴上是我想要的。我想将里程 (mpg) 更改为里程等。

编辑:对不起,我的问题不清楚。我想像这样在 y 轴上标记变量:

sysuse auto, clear 
keep if rep78>=3 
regress mpg headroom i.rep##i.foreign coefplot, xline(0) omitted baselevels drop(_cons) /// 
headings(3.rep78 = "{bf:Repair Record}" /// 
0.foreign = "{bf:Car Type}" /// 
3.rep78#0.foreign = "{bf:Interaction Effects}") headings(3.rep78 = "{bf:Repair Record}" /// 

我收到此错误消息:

command headings is unrecognized r(199); – 
4

1 回答 1

1

rename对我来说很好。也许您之前提到了变量标签而不是变量名rename

coefplot Option1 Option2, drop(_cons) xline(1) rename(mpg = Mileage)
于 2022-02-27T08:34:35.337 回答