Hello,
I am using the following commands to produce the graph below:
#delimit ;
graph bar, over(COUNTRY) over (PEMP1921cat)
asyvars
blabel(bar, format(%9.1f))
percentages
bar(1, color(blue))
bar(2, color(orange))
ytitle("Number of companies");
For each of the three categories of PEMP1921cat, the bars show the percentage of companies in each country (CAN or USA) relative to the total number of companies in both countries, for a total of 100%.
I would prefer having either the number of companies for each country by category or having the percentage of companies in each category relative to the total number of companies in total for that same category. In other words, if there were 100 Canadian companies in total that were distributed 20, 40, 40 in the three categories, I would like the bars to show either the counts (20, 40, 40) or, even better, the corresponding percentages, i.e. 20%, 40% and 40%. Same for the US companies.
I tried different commands without success. Is this feasible?
Thank you!
I am using the following commands to produce the graph below:
#delimit ;
graph bar, over(COUNTRY) over (PEMP1921cat)
asyvars
blabel(bar, format(%9.1f))
percentages
bar(1, color(blue))
bar(2, color(orange))
ytitle("Number of companies");
For each of the three categories of PEMP1921cat, the bars show the percentage of companies in each country (CAN or USA) relative to the total number of companies in both countries, for a total of 100%.
I would prefer having either the number of companies for each country by category or having the percentage of companies in each category relative to the total number of companies in total for that same category. In other words, if there were 100 Canadian companies in total that were distributed 20, 40, 40 in the three categories, I would like the bars to show either the counts (20, 40, 40) or, even better, the corresponding percentages, i.e. 20%, 40% and 40%. Same for the US companies.
I tried different commands without success. Is this feasible?
Thank you!

Comment