Hello Stata community, I hope everyone is doing well.
I hope I could get some help for my question, here's the situation:
I have this data:
It's basically 70 countries with their Economic Freedom Score and their Gini Index.
My goal is to draw a bar grapgh that shows all the 70 countries, the X axis should be The Economic Freedom Index and the Y axis should be the Gini Index. By "based on a variable's median" in the title of my post, I mean that, on the X axis, I wanna have my 70 countries devised into 2 groups according to the median of the variable "Economic Freedom", so, on the right side of the graph, I wanna have the countries who are more economically free (compared to the median country), and on the left side of the graph, I wanna have the less economically free countries (compared to the median country, again). And on the Y axis, I wanna have the Gini index, all in a single bar chart.
I do wish I was very clear with myexplanation, and I do also wish I could get some help with this.
Thanks very much in advance.
I hope I could get some help for my question, here's the situation:
I have this data:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str30 Country float(EconomicFreedom Gini2017) "Albania" 7.65 33.1 "Argentina" 4.72 41.1 "Armenia" 7.84 33.6 "Austria" 7.91 29.7 "Belgium" 7.85 27.4 "Bhutan" 6.75 37.4 "Bolivia" 6.25 44.6 "Brazil" 6.49 53.3 "Bulgaria" 7.62 40.4 "Canada" 8.29 33.3 "Chile" 7.91 44.4 "China" 6.21 39.1 "Colombia" 6.69 49.7 "Costa Rica" 7.64 48.3 "Croatia" 7.23 30.4 "Cyprus" 7.43 31.4 "Czech Republic" 7.93 24.9 "Denmark" 8.11 28.7 "Dominican Republic" 7.53 42.2 "Ecuador" 6.02 44.7 "Egypt, Arab Rep." 5.52 31.5 "El Salvador" 7.49 38 "Estonia" 8.05 30.4 "Finland" 7.92 27.4 "France" 7.72 31.6 "Gabon" 5.44 38 "Georgia" 8.31 37.9 "Germany" 7.96 31.2 "Greece" 7.17 34.4 "Honduras" 7.26 49.4 "Hungary" 7.51 30.6 "Iceland" 7.33 26.1 "Indonesia" 7.07 38.1 "Iran, Islamic Rep." 5.1 40.8 "Ireland" 8.24 31.4 "Israel" 7.58 38.2 "Italy" 7.67 35.9 "Kazakhstan" 7.14 27.5 "Kyrgyz Republic" 7.14 27.3 "Latvia" 8.12 35.6 "Lesotho" 6.55 44.9 "Lithuania" 8.08 37.3 "Luxembourg" 7.85 34.5 "Malta" 7.97 29.2 "Mauritius" 7.9 36.8 "Moldova" 7.01 25.9 "Montenegro" 7.39 36.9 "Myanmar" 5.75 30.7 "Netherlands" 7.94 28.5 "North Macedonia" 7.52 34.2 "Norway" 7.82 27 "Panama" 7.7 49.9 "Paraguay" 7.01 48.5 "Peru" 7.76 43.3 "Poland" 7.54 29.7 "Portugal" 7.74 33.8 "Romania" 7.91 36 "Russian Federation" 6.59 37.2 "Serbia" 6.78 36.2 "Slovak Republic" 7.7 23.2 "Slovenia" 7.31 24.2 "Spain" 7.75 34.7 "Sweden" 7.93 28.8 "Switzerland" 8.49 32.7 "Thailand" 6.56 36.5 "Ukraine" 5.96 26 "United Kingdom" 8.16 35.1 "United States" 8.18 41.2 "Uruguay" 7.26 39.5 "Zimbabwe" 5.9 44.3 end
My goal is to draw a bar grapgh that shows all the 70 countries, the X axis should be The Economic Freedom Index and the Y axis should be the Gini Index. By "based on a variable's median" in the title of my post, I mean that, on the X axis, I wanna have my 70 countries devised into 2 groups according to the median of the variable "Economic Freedom", so, on the right side of the graph, I wanna have the countries who are more economically free (compared to the median country), and on the left side of the graph, I wanna have the less economically free countries (compared to the median country, again). And on the Y axis, I wanna have the Gini index, all in a single bar chart.
I do wish I was very clear with myexplanation, and I do also wish I could get some help with this.
Thanks very much in advance.
Comment