The following code will generate a coefficient plot:
sysuse auto, clear
regress price mpg trunk length turn if foreign==0
estimates store D
regress price mpg tru
I think this is a terrible idea. If you keep repeating Domestic/Foreign
, then there is no way for the reader to know which pair corresponds to each variable.
Here's a better approach:
sysuse auto, clear
estimates clear
regress price mpg trunk length turn if foreign==0
estimates store D
regress price mpg trunk length turn if foreign==1
estimates store F
coefplot (D, asequation(Domestic) \ F, asequation(Foreign)), drop(_cons) xline(0)
Alternatively:
coefplot (D, asequation \ F, asequation), drop(_cons) xline(0) ///
eqlabels("Domestic" "Foreign", asheadings)
EDIT:
The only way you can achieve what you want is by using the following hack:
coefplot D F, drop(_cons mpg length turn) ///
coeflabels(trunk = `""Domestic -" " " " " " " " " " " " " " " "Foreign -""') ///
ylabel(, notick labgap(0)) xline(0) legend(off)
You will obviously have to adapt it for your different use cases.