This is similar to my last post here, but different in that I am attempting to visualize two means at once, each for a series of locations. I want the locations to be noted with a tick mark and label below each respective set of means. The means should be stationed vertically above one another, OR offset slightly with the location tick mark & label positioned directly in between the two. I want 1 set of means (m1-m3 in the example below) to be one color, and one set of means (M1-M3 below) to be another color. I ALSO want to be able to control the shape of the markers. While I'm further along after Andrew's help with the last problem, I still can't figure this out. Maybe it's not possible to do with coefplot? Thoughts/code appreciated.
Reproducible example below. Note on what is right / is not right shown here.
Reproducible example below. Note on what is right / is not right shown here.
Code:
clear matrix
sysuse auto , clear
xtile p3=price, nquantiles(3)
forval i=1/3 {
qui mean weight if p3==`i'
estimate store m`i'
}
forval i=1/3 {
preserve
gen e = rnormal(0,500)
replace weight = weight+e+1000
qui mean weight if p3==`i'
restore
estimate store M`i'
}
coefplot (m1 M1, mc(navy orange) ciopts(color(navy orange))) ///
(m2 M2, mc(navy orange) ciopts(color(navy orange) msymbol(t))) ///
(m3 M3, mc(navy orange) ciopts(color(navy orange))) , ///
vert swapnames asequation ///
eqrename(m1= "First location" M1="First location" ///
m2= "Second location" M2="Second location" ///
m3= "Third location" M3="Third location") ///
xlabel(, angle(45)) ytitle("Blah") ///
legend(order(2 "Label for circles" 4 "Label for squares")) ///
graphregion(color(white)) ciopts(color(navy))

Comment