'How to label y axis in coefplot?
How do I label/rename the variables on y axis?
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)
None of the option in this coefplot: Putting names of regressions on y-axis is what I want. I want to to change Mileage (mpg) to Mileage and so on.
Edit: Sorry for not being clear in my question. I want to label variables on y axis like this:
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}" ///
I got this error message:
command headings is unrecognized r(199); –
Solution 1:[1]
rename
works fine for me. Maybe you referred to variable labels instead of the variable names in rename
before?
coefplot Option1 Option2, drop(_cons) xline(1) rename(mpg = Mileage)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Wouter |