Hello Statalist Community,
I am working on creating a bar graph in Stata, where I want to display the top 5 countries (sorted in descending order by the size of their observations), and also aggregate the counts of the remaining categories to create a new "Others" category. I
I would love to have the "Other" category stacked and self-adjusting, like in the example below.
So far, I've ranked the variable and retained the top 5 (using the command myaxis countries_top = countries, sort(count) descending keep if countries_top <= 5). However, I need assistance in adding the "Other" category to my graph and stacking only within this category to show the sizes of the other countries.

Can you help me with how to make these adjustments in my Stata graph, specifically focusing on stacking within the "Other" category?
Thank you in advance for your assistance!
Kind regards
Franciska Strittmatter
I am working on creating a bar graph in Stata, where I want to display the top 5 countries (sorted in descending order by the size of their observations), and also aggregate the counts of the remaining categories to create a new "Others" category. I
I would love to have the "Other" category stacked and self-adjusting, like in the example below.
So far, I've ranked the variable and retained the top 5 (using the command myaxis countries_top = countries, sort(count) descending keep if countries_top <= 5). However, I need assistance in adding the "Other" category to my graph and stacking only within this category to show the sizes of the other countries.

Can you help me with how to make these adjustments in my Stata graph, specifically focusing on stacking within the "Other" category?
Thank you in advance for your assistance!
Kind regards
Franciska Strittmatter
Comment