Hello Statalisters! I am trying to make a dotplot of a continuous variable over values of a string variable. That part is easy enough, using the "over()" statement. However, I would like to see these all grouped by the levels of a third variable. I don't necessarily want separate plots, though I will settle for that if necessary, but rather to have a small break in the x-axis that distinguishes each group (similar in look to a coefplot after mlogit, but vertical and without the error bars like the plot below)

Using the automobile data as an example, imagine I would like something like a dotplot of mpg over make of automobile (see code below), but with all the foreign cars on the left side of the plot, with a label of "Foreign" under them, and all the domestic cars on the right side of the plot with the word "Domestic" under them. In my actual data, I have 6-10 groups and will be repeating this a few times with the groups changing, so, making this somewhat automated will be very helpful.
Using the automobile data as an example, imagine I would like something like a dotplot of mpg over make of automobile (see code below), but with all the foreign cars on the left side of the plot, with a label of "Foreign" under them, and all the domestic cars on the right side of the plot with the word "Domestic" under them. In my actual data, I have 6-10 groups and will be repeating this a few times with the groups changing, so, making this somewhat automated will be very helpful.
Code:
sysuse auto, clear dotplot mpg, over(make) xlab(,angle(90))
Comment