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?
Event Study and Two-Way Fixed-Effect Diff-in-Diff with varying treatment timingI have MSA level data from 1990-2018 where I am looking at professional sports teams and what happen…
How to adjust the scale on the axes of a graph before outputting in a batch file, if the yscale/xscale option is not availableIf I am not using the twoway plot or some other library that has the yscale() or xscale() option, ho…
Combining 2 ifs and andHi All, I have the following dataset: Code: * Example generated by -dataex-. To install: ssc inst…
How to obtain goodness of fit statitics after running a biprobit model with svy prefixAre there any ways to obtain goodness of fit statistics after running a biprobit model with svy pref…
Count the number of yearsHi, I have a question of calculating the number of years in Stata. In the data, each ID has an Iss…
Subscribe to:
Post Comments (Atom)
0 Response to How can I change the order of the bars in this bar graph?
Post a Comment