Hi
I'd like to arrange regression coefficients from multiple models with -coefplot- (available from SSC) in a way that I am convinced should be possible but I can't figure out how. Here's an example (all code in one go is enclosed at the bottom for convenience):
I am interested in one coefficient (price, see below), and I have two model specifications (called 1 and 2) and two samples (called large and small), so in total it's four coefficients that I want to plot. These are the models:
I can plot the four coefficients without further options like this, with the legend on the right-hand side doing all the lifting, which is not optimal in my book:

I can stratify the plot by large and small, which is better, because the legend is decluttered by only showing the model specification (that is once you relabel it properly, sorry):

I like this version better, but it's not optimal: The y-axis is sitting basically idle while the information displayed in the y-dimension has to be deciphered using a legend? Not ideal. Is there a way to get the information from the legend onto the y-axis?
Many thanks for you consideration
KS
I'd like to arrange regression coefficients from multiple models with -coefplot- (available from SSC) in a way that I am convinced should be possible but I can't figure out how. Here's an example (all code in one go is enclosed at the bottom for convenience):
Code:
*ssc install coefplot // Install coefplot from SSC if necessary sysuse auto, clear // Open data generate headroomlarge = (headroom > 3) // Generate two groups ("large" and "small") of no substantive meaning
Code:
regress mpg price if headroomlarge eststo large1 regress mpg price trunk weight length if headroomlarge eststo large2 regress mpg price if !headroomlarge eststo small1 regress mpg price trunk weight length if !headroomlarge eststo small2
Code:
coefplot large* small*, keep(price)
I can stratify the plot by large and small, which is better, because the legend is decluttered by only showing the model specification (that is once you relabel it properly, sorry):
Code:
coefplot large* || small*, keep(price)
I like this version better, but it's not optimal: The y-axis is sitting basically idle while the information displayed in the y-dimension has to be deciphered using a legend? Not ideal. Is there a way to get the information from the legend onto the y-axis?
Many thanks for you consideration
KS
Code:
// Data *ssc install coefplot sysuse auto, clear gen headroomlarge = (headroom > 3) // Models regress mpg price if headroomlarge eststo large1 regress mpg price trunk weight length if headroomlarge eststo large2 regress mpg price if !headroomlarge eststo small1 regress mpg price trunk weight length if !headroomlarge eststo small2 // Figures // A coefplot large* small*, keep(price) // B coefplot large* || small*, keep(price)
Comment