I am trying to reorder the bars in -gr hbar-, and what I'm trying from the documentation is not working for me. Here is an example using our favorite dataset:
Error message:
"variable mean not found"
Can someone suggest how I can obtain the bars in the order I'd like?
Many thanks,
Laura
Code:
sysuse auto, clear *To create a string variable: gen temp=substr(make,1,2) * just to reduce the number of bars: keep if temp<"D" * this works fine: gr hbar (count), over(temp) * suppose I want the "B" bars first. * this is what the helpfile says to do if you want them in a different order: gen order=1 if temp=="BM" replace order=2 if temp=="Bu" replace order=3 if temp=="AM" replace order=4 if temp=="Au" replace order=5 if temp=="Ca" replace order=6 if temp=="Ch" gr hbar (count), over(temp, sort(order))
"variable mean not found"
Can someone suggest how I can obtain the bars in the order I'd like?
Many thanks,
Laura
Comment