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?
individual log likelihoods using -frontier for Vuong testHi, I am looking to run a Vuong test to compare model specification after using the -frontier comman…
Calculating subsequent surgeries with data in long formatDear STATAList forum, I'm working with ophthalmic surgery data, trying to calculate which types of …
Tobit model in cmp -- marginal effect on probability of positive outcomeHi all, I am trying to estimate the marginal effect of the regressors on the probability of an unce…
Question concerning structuring long format dataHi, I am working with longitudinal data in long format. Idnr is identification number and time is t…
how to identify cases with error when the relationship code and the age do not matchDear All I have a dataset where I want to check the relationship code and age of the household head…
Subscribe to:
Post Comments (Atom)
0 Response to How can I change the order of the bars in this bar graph?
Post a Comment