I am a beginner Stata user. For a research project, whose information I must unfortunately keep confidential, I am trying to adjust a bar graph so that the order of the bars are "Increase", "Same", "Decrease" instead of the default alphabetical "Decrease", "Increase", "Same".
To create this graph, I load in my cleaned dataset and run:
graph bar, by(byvar) over(groupvar) .
In an attempt to try to re-order the bars, I ran:
gen order=1 if groupvar=="Increase"
replace order=2 if groupvar=="Same"
replace order=3 if groupvar=="Decrease"
graph bar, by(byvar) over(groupvar, sort(order)) .
I get the error message "variable mean not found".
How should I fix this?
(Apologies if this is too difficult to answer without being able to see the graph and data.)
Related Posts with How can I change the order of the bars in this bar graph?
Finding "new" occurrences in panel dataDear Stata Users, I am trying to identify when an observation is a "new "occurrence in within a pan…
How to standardize variables to make max value 1 and min value -1 ?Hello, I am having trouble standardizing to standardize some panel data from VDEM. The data doesn't…
xteprobit convergece failHi, I tried to estimate a probit panel data model with endogenous binary variable using xteprobit. F…
Bivariate and Multiple linear regressionHello guys, I have cross-sectional data and I intend to perform a bivariate (linear) regression and…
Intergrowth 21th neonatal birth weight standard commandHi all I am trying to calculate the proportion of newborns born small-for-gestational age for newbo…
Subscribe to:
Post Comments (Atom)
0 Response to How can I change the order of the bars in this bar graph?
Post a Comment