Dear all,
Maybe this is an extremely simple question, but I haven't been able to solve the following problem.
I am comparing two variables "data" and "fitted" in a bar graph using the following command:
graph bar (mean) data fitted, over(quintile) by(ccode)
which produces the attached graph.
As you can see, bar plots are sorted alphabetically by ccode: ALB, ARG, ARM and BGR.
What I would like to do, however, is to have bar graphs for each country, but sorting them by the value of a different variable, call it x. As you can see in the graph, the value of x for each country is 4 for ALB, .18 for ARG, .53 for ARM and 1.5 for BGR.
Thus, I would like to produce the same graph as above but sorted by x, so the order would look like: ALB, BGR, ARM and ARG.
Thanks for your help.
Alejandro
Maybe this is an extremely simple question, but I haven't been able to solve the following problem.
I am comparing two variables "data" and "fitted" in a bar graph using the following command:
graph bar (mean) data fitted, over(quintile) by(ccode)
which produces the attached graph.
As you can see, bar plots are sorted alphabetically by ccode: ALB, ARG, ARM and BGR.
What I would like to do, however, is to have bar graphs for each country, but sorting them by the value of a different variable, call it x. As you can see in the graph, the value of x for each country is 4 for ALB, .18 for ARG, .53 for ARM and 1.5 for BGR.
Thus, I would like to produce the same graph as above but sorted by x, so the order would look like: ALB, BGR, ARM and ARG.
Thanks for your help.
Alejandro
Comment