Dear All,
I am trying to make a graph bar similar to the one attached below (see 'capture'). I have a dummy variable called "religion_dummy" coded 1=jews 2=arabs, and a categorical variable for life satisfaction coded 1=very dissatisfied, 2=not so satisfied, 3=satisfied, 4=very satisfied.
I have found a pretty useful code for this:
graph bar, over(religion_dummy) over( life_satisfaction) asyvars blabel(bar, format(%9.1f))
by running this code I get a graph shown in 'capture 2'
However, I am trying to show the percentage of each category by itself (as shown in the first capture). So for the Jews (Arabs) I would like to see a separate percentage out of all the Jews (Arabs) respondents with a total of 100% for each religion.
I hope I am clear. Let me know if you have any more questions.
Kind regards,
Shir.
Related Posts with stata bar graph binary variable
Identify observations appeared in the previous yearDear All, I find this question here. The data set is Code: * Example generated by -dataex-. To inst…
Pooling dataHi everyone. I have a question on how pooling data in stata. I am working with a repeated cross-sect…
Generating Probabilities from RangeHi everyone, I have question regarding how to calculate probabilities from data. My idea is to crea…
Parallel trends assumption with continuous treatment variable - DiDHi, I have survey data on individual firms from 2008-2017. I want to test how a reform that happene…
ArdlHello STATA users, what technics can be used to fix heteroskedasticity in ARDL model besides droppin…
Subscribe to:
Post Comments (Atom)
0 Response to stata bar graph binary variable
Post a Comment