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
How to merge two datasets and How to use keepHello everyone! I'm a very beginner using STATA so please I'd like to get some help with merge comm…
Counting unique idsWhen I use the following code: Code: bys month: count(refer_id) Is there anything I can add to it …
multilevel model with dependent ordinal value(Likert scale) and longitudinal dataHello everyone, i am handling the data with Likert scale(Survey data) and i have to use multilevel …
Pooling Data in Longitudinal/Cross-Sectional SurveyHello everyone; I am working with the National Longitudinal Survey of Children and Youth (NLSCY); a…
Graphing averages using collapse mean and loops with same suffixHello, I am trying to graph cross-country distributions along with international averages using loo…
Subscribe to:
Post Comments (Atom)
0 Response to stata bar graph binary variable
Post a Comment