So this bothers me for a while. I want to have a bar graph for group means with confidence intervals. graph bar works perfectly except for that it does not allow confidence intervals. So I learned to take a detour from https://stats.idre.ucla.edu/stata/fa...th-error-bars/

However, the twoway requires the x-axis to be a numerical variable, so I have to encode. After encoding, how can I order the bars by a variable and still use the original characters as labels for bars?